-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
48 lines (45 loc) · 1.38 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-old.url = "github:NixOS/nixpkgs/nixos-22.11";
nixpkgs-master.url = "github:NixOS/nixpkgs";
fenix.url = "github:nix-community/fenix";
};
outputs = {
self,
nixpkgs,
fenix,
...
} @ inputs: let
defaultSystems = [
"x86_64-linux"
"aarch64-linux" # untested
];
eachDefaultSystem = f:
builtins.listToAttrs (map (system: {
name = system;
value = f (import nixpkgs {inherit system;});
})
defaultSystems);
lib = import ./nix/lib.nix;
in {
packages = eachDefaultSystem (pkgs: {
default = self.packages.${pkgs.system}.sandkasten;
sandkasten = pkgs.callPackage ./nix/sandkasten.nix {inherit fenix;};
packages = import ./nix/packages {
inherit inputs lib;
inherit (pkgs) system;
};
time = pkgs.callPackage ./nix/time {};
generate = pkgs.writeShellScriptBin "generate" ''
${nixpkgs.lib.getExe pkgs.crate2nix} generate
'';
});
nixosModules.sandkasten = import ./nix/nixos/module.nix {
inherit self lib;
};
devShells = eachDefaultSystem (pkgs: import ./nix/dev/shell.nix {inherit self pkgs lib;});
templates.vm.path = ./nix/nixos/vm;
checks = builtins.mapAttrs (_: packages: packages // {packages = packages.packages.all;}) self.packages;
};
}