-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
30 lines (27 loc) · 1.06 KB
/
flake.nix
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
{ description = "Default set of templates for Nixie projects";
inputs.nixpkgs.url = github:nixos/nixpkgs;
inputs.flake-utils.url = github:numtide/flake-utils;
nixConfig.extra-substituters = "https://nix-wrap.cachix.org";
nixConfig.extra-trusted-public-keys = "nix-wrap.cachix.org-1:FcfSb7e+LmXBZE/MdaFWcs4bW2OQQeBnB/kgWlkZmYI=";
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let pkgs = import nixpkgs { inherit system; };
templates = pkgs.lib.filterAttrs (m: v: (m != "override") && (m != "overrideDerivation"))
(pkgs.callPackage ./templates.nix {});
in
{ packages =
{ predicates = pkgs.stdenv.mkDerivation {
name = "nixie-templates-predicates";
src = pkgs.emptyDirectory;
installPhase =
builtins.foldl'
(l: r: l + "\ncp ${templates."${r}"}/lib/predicate $out/predicates/${r}")
"mkdir -p $out/predicates"
(builtins.attrNames templates);
};
};
legacyPackages = templates;
}
);
}