-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
58 lines (51 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
49
50
51
52
53
54
55
56
57
58
{
description = "";
inputs = {
nixos.url = "nixpkgs/23.11"; # for live media
klokkijker.url = "github:koenw/klokkijker";
};
outputs = { self, nixpkgs, nixos, klokkijker }@inputs:
let
devSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forAllDevSystems = fn:
nixpkgs.lib.genAttrs devSystems
(system: fn {
pkgs = import nixpkgs { inherit system; };
});
in {
nixosConfigurations.sdImage = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
self.nixosModules.sdImage
self.nixosModules.stratum
];
};
nixosModules = rec {
stratum = ( import ./default.nix { inherit klokkijker; } );
default = stratum;
sdImage = ./modules/sd-image;
};
packages = forAllDevSystems ( { pkgs }: {
default = self.nixosConfigurations.sdImage.config.system.build.sdImage;
mdDocs = pkgs.callPackage ./modules/docs.nix {};
});
devShells = forAllDevSystems ( { pkgs }: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
just
];
shellHook = ''
cat <<EOF
$(just -l |sed 's/^Available recipes:/The following `just` recipes are available:/')
EOF
user_shell=$(getent passwd "$(whoami)" |cut -d: -f 7)
exec "$user_shell"
'';
};
});
};
}