-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
90 lines (80 loc) · 2.05 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
description = "Unstable + HM";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:rycee/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-programs-sqlite = {
url = "github:wamserma/flake-programs-sqlite";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
home-manager,
nixpkgs,
flake-programs-sqlite
}: let
pkgs = (import nixpkgs) {
system = "x86_64-linux";
};
hosts = map (pkgs.lib.removeSuffix ".nix") (
pkgs.lib.attrNames (
pkgs.lib.filterAttrs
(_: entryType: entryType == "regular")
(builtins.readDir ./hosts)
)
);
build-target = host: {
name = host;
value = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nixpkgs.nixosModules.notDetected
home-manager.nixosModules.home-manager
flake-programs-sqlite.nixosModules.programs-sqlite
(import (./hosts + "/${host}.nix"))
];
};
};
live-usb = {
name = "live-usb";
value = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-base.nix"
nixpkgs.nixosModules.notDetected
home-manager.nixosModules.home-manager
(import ./live-usb/live-usb.nix)
];
};
};
live-usb-min = {
name = "live-usb-min";
value = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
nixpkgs.nixosModules.notDetected
home-manager.nixosModules.home-manager
(import ./live-usb/min.nix)
];
};
};
in {
nixosConfigurations = builtins.listToAttrs (
pkgs.lib.flatten (
map
(
host: [
(build-target host)
]
)
hosts
++ [live-usb live-usb-min]
)
);
};
}