-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
45 lines (44 loc) · 1.41 KB
/
Copy pathflake.nix
File metadata and controls
45 lines (44 loc) · 1.41 KB
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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence/4b3e914cdf97a5b536a889e939fb2fd2b043a170";
};
contain = {
url = "github:timon-schelling/contain";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
let
pkgs = inputs.nixpkgs;
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: pkgs.lib.genAttrs systems (system: f system);
lib = pkgs.lib.extend (_: _: import ./lib { lib = pkgs.lib;});
overlays = (map (e: import e inputs) (lib.imports.type "overlay" ./overlays));
hostDirs = (lib.attrsets.filterAttrs (file: kind: kind == "directory" ) (builtins.readDir ./hosts));
hostNames = builtins.attrNames hostDirs;
mkHost = host: inputs: import ./src/main.nix { inherit host lib overlays inputs; };
hosts = builtins.foldl' (acc: host: acc // { "${host}" = (mkHost host inputs); }) {} hostNames;
in
{
nixosConfigurations = hosts;
legacyPackages = forAllSystems (system: (
import pkgs {
inherit system;
overlays = overlays;
}
));
};
}