-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathflake.nix
More file actions
53 lines (51 loc) · 1.41 KB
/
flake.nix
File metadata and controls
53 lines (51 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
napalm = {
url = "github:nix-community/napalm";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
napalm,
}:
flake-utils.lib.eachDefaultSystem (system: let
name = "hybooru";
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
lib = pkgs.lib;
nodejs = pkgs.nodejs_20;
in rec {
packages = {
hybooru-raw = napalm.legacyPackages."${system}".buildPackage ./. {
inherit nodejs;
patchPackages = false;
installPhase = "npm run build:prod && cp -r dist $out";
nativeBuildInputs = [
pkgs.python3Full
];
};
hybooru-unwrapped = napalm.legacyPackages."${system}".buildPackage packages.hybooru-raw {
inherit nodejs;
patchPackages = false;
installPhase = "cp -r ./ $out";
nativeBuildInputs = [
pkgs.python3Full
];
};
hybooru-wrapped = pkgs.writeShellScriptBin name ''
${lib.getExe pkgs.nodejs} ${packages.hybooru-unwrapped}/server.js "$@"
'';
default = packages.hybooru-wrapped;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
nodejs
pkgs.python3Full
];
};
});
}