-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
58 lines (55 loc) · 1.7 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
templates.url = "github:nix-community/templates";
zen-browser.url = "github:MarceColl/zen-browser-flake";
wallust.url = "git+https://codeberg.org/explosion-mental/wallust?ref=master";
subcat.url = "github:anuramat/subcat";
};
outputs =
inputs:
let
epsilon =
path: path |> builtins.readDir |> builtins.attrNames |> builtins.filter (a: a != "default.nix");
inherit ((import ./nix/machines) { inherit inputs epsilon; })
hostnames
mkCluster
mkModules
;
mkSystem =
name:
let
pkgscfg = inputs.self.nixosConfigurations.${name}.config.nixpkgs;
in
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
cluster = mkCluster name;
inherit inputs;
dummy = path: path |> epsilon |> map (name: path + /${name});
unstable = import inputs.nixpkgs-unstable {
inherit (pkgscfg) config;
inherit (pkgscfg.hostPlatform) system;
};
};
modules = mkModules name ++ [
./nix/common
];
};
in
{
nixosConfigurations =
hostnames
|> map (name: {
inherit name;
value = mkSystem name;
})
|> builtins.listToAttrs;
};
}