-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (52 loc) · 1.22 KB
/
Copy pathflake.nix
File metadata and controls
59 lines (52 loc) · 1.22 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
54
55
56
57
58
59
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = {nixpkgs, ...}: let
systems = ["x86_64-linux" "aarch64-linux"];
eachSystem = nixpkgs.lib.genAttrs systems;
pkgsFor = eachSystem (
system:
import nixpkgs {inherit system;}
);
mkBulidInputs = pkgs:
with pkgs; [
clang-tools
pkg-config
gnumake
cmake
gcc
openssl
ncurses
];
in {
devShells = eachSystem (
system: let
pkgs = pkgsFor.${system};
nativeBuildInputs = mkBulidInputs pkgs;
in
with pkgs; {
default = mkShell {
packages = nativeBuildInputs;
};
}
);
packages = eachSystem (
system: let
pkgs = pkgsFor.${system};
nativeBuildInputs = mkBulidInputs pkgs;
fs = nixpkgs.lib.fileset;
npassm = pkgs.stdenv.mkDerivation {
pname = "npassm";
version = "0.1";
src = fs.toSource {
root = ./.;
fileset = fs.difference ./. (fs.maybeMissing ./build);
};
inherit nativeBuildInputs;
};
in {
inherit npassm;
default = npassm;
}
);
};
}