-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
47 lines (44 loc) · 1011 Bytes
/
flake.nix
File metadata and controls
47 lines (44 loc) · 1011 Bytes
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
{
description = "file-hash-name-change";
inputs.nixpkgs.url = "nixpkgs/nixos-25.11";
outputs = { self, nixpkgs }: let
version = builtins.substring 0 8 self.lastModifiedDate;
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
allpkgs = forAllSystems (system: import nixpkgs { inherit system; });
in
{
# nix build .#<name>
packages = forAllSystems (system:
let pkgs = allpkgs.${system}; in
rec {
default = main-js;
main-js = pkgs.buildNpmPackage
{
pname = "main-js";
inherit version;
src = ./.;
npmDepsHash = "sha256-PkAd9VGO5H5GNU1TVq1IM5Cik4f112PHQQeoMPy5c7E=";
postInstall = ''
mkdir $out/bin
cp main.js manifest.json $out/bin
'';
};
}
);
# nix develop
devShell = forAllSystems(
system:
let pkgs = allpkgs.${system}; in
pkgs.mkShell
{
buildInputs = [ pkgs.nodejs ];
shellHook = ''
npm install
zsh
exit
'';
}
);
};
}