phanpy/flake.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2023-07-16 12:26:31 +00:00
{
2023-10-15 12:36:19 +00:00
inputs.nixpkgs.url = github:nixOS/nixpkgs/nixos-unstable;
2023-07-16 12:26:31 +00:00
inputs.flake-utils.url = github:numtide/flake-utils;
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
in
2023-10-15 12:36:19 +00:00
rec {
2023-07-16 12:26:31 +00:00
packages.default = pkgs.buildNpmPackage {
2023-07-16 12:32:57 +00:00
pname = "dtth-phanpy";
2023-07-16 12:26:31 +00:00
version = "0.1.0";
buildInputs = with pkgs; [ git ];
src = lib.cleanSource ./.;
2023-10-15 12:36:19 +00:00
npmDepsHash = "sha256-LpvZfIzIdgxXg4upcDKm7jbK7CjrRvg//HULO4GDTdU=";
2023-07-23 00:24:20 +00:00
# npmDepsHash = lib.fakeHash;
2023-07-16 12:26:31 +00:00
2023-07-16 12:32:57 +00:00
# DTTH-specific env variables
VITE_CLIENT_NAME = "DTTH Phanpy";
VITE_CLIENT_ID = "ch.dtth.phanpy";
VITE_WEBSITE = "https://social.dtth.ch";
2023-07-16 12:26:31 +00:00
installPhase = ''
runHook preInstall
mkdir -p $out/lib
cp -r dist $out/lib/phanpy
runHook postInstall
'';
};
devShells.default = pkgs.mkShell {
2023-10-15 12:36:19 +00:00
inputsFrom = [ packages.default ];
2023-07-16 12:26:31 +00:00
buildInputs = with pkgs; [ nodejs ];
};
});
}