-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
53 lines (44 loc) · 1.48 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
{
description = "NixOS and home-manager configuration";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
cdunster-nixpkgs.url = "github:cdunster/nixpkgs?ref=wps-fonts";
home-manager = {
url = "home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# The catppuccin theme for everything
catppuccin = {
url = "github:catppuccin/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# Enable Secure Boot on NixOS.
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
neorg-overlay = {
url = "github:nvim-neorg/nixpkgs-neorg-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs = { ... }@inputs:
let
# Get all of the hosts from the hosts directory, returning them as a set.
allHostsAsSet = builtins.readDir ./hosts;
# Takes each attribute from the passed set, discards the value and returns a `nixosSystem` with the same name.
# e.g. `{ hostOne = { foo = 42; }; }` becomes `{ hostOne = nixosSystem { ... }; }`.
mkNixosSystem = hostName: _: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{ networking.hostName = "${hostName}"; }
./hosts/${hostName}
./configuration.nix
];
};
in
{
nixosConfigurations = builtins.mapAttrs mkNixosSystem allHostsAsSet;
};
}