-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
61 lines (54 loc) · 1.74 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
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
60
61
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
utils = { url = "github:numtide/flake-utils"; };
tlms-rust = {
url = "github:tlm-solutions/tlms.rs";
flake = false;
};
json-structs = {
url = "github:jorgen/json_struct";
flake = false;
};
};
outputs = { self, nixpkgs, utils, tlms-rust, json-structs, ... }:
(utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
package = pkgs.callPackage ./derivation.nix {
tlms-rust = tlms-rust;
json-structs-src = json-structs;
};
in rec {
checks = packages;
packages = {
funnel = package;
default = package;
docs = (pkgs.nixosOptionsDoc {
options = (nixpkgs.lib.nixosSystem {
inherit system;
modules = [ self.nixosModules.default ];
}).options.TLMS;
}).optionsCommonMark;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs =
(with packages.funnel; buildInputs ++ nativeBuildInputs);
};
}) // {
overlays.default = final: prev: {
inherit (self.packages.${prev.system}) funnel;
};
nixosModules = rec {
default = funnel;
funnel = import ./nixos-module;
};
hydraJobs = let hydraSystems = [ "x86_64-linux" "aarch64-linux" ];
in builtins.foldl' (hydraJobs: system:
builtins.foldl' (hydraJobs: pkgName:
nixpkgs.lib.recursiveUpdate hydraJobs {
${pkgName}.${system} = self.packages.${system}.${pkgName};
}) hydraJobs (builtins.attrNames self.packages.${system})) { }
hydraSystems;
});
}