-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
170 lines (167 loc) · 4.96 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# FIXME: while libreoffice fails to build
nixpkgs-dc460ec7.url = "github:nixos/nixpkgs/dc460ec76cbff0e66e269457d7b728432263166c";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
baywatch = {
url = "github:padok-team/baywatch/fix/sort-fzf";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
kolide-launcher = {
url = "github:/kolide/nix-agent/main";
inputs.nixpkgs.follows = "nixpkgs";
};
k0s = {
url = "github:cterence/k0s-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-work-config = {
url = "github:cterence/nixos-work-config";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
home-manager,
k0s,
kolide-launcher,
nix-index-database,
nixos-hardware,
nixos-work-config,
nixpkgs,
plasma-manager,
sops-nix,
...
}@inputs:
let
inherit (self) outputs;
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (
system:
nixpkgs.legacyPackages.${system} {
overlays = [
self.overlays.default
];
}
);
in
{
packages = {
inherit (pkgs)
baywatch
guacamole
playground
;
};
overlays = import ./overlays { inherit inputs; };
checks = forAllSystems (system: {
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
deadnix.enable = true;
flake-checker.enable = true;
nil.enable = true;
nixfmt-rfc-style.enable = true;
statix.enable = true;
};
};
});
devShells = forAllSystems (system: {
default = nixpkgs.legacyPackages.${system}.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
};
});
formatter = forAllSystems (system: {
${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
});
nixosConfigurations = {
stronghold = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
modules = [
./hosts/stronghold/configuration.nix
home-manager.nixosModules.default
nix-index-database.nixosModules.nix-index
sops-nix.nixosModules.sops
];
};
t14s = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
modules = [
./hosts/t14s/configuration.nix
home-manager.nixosModules.default
nix-index-database.nixosModules.nix-index
nixos-hardware.nixosModules.lenovo-thinkpad-t14s-amd-gen1
sops-nix.nixosModules.sops
];
};
homelab = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs k0s;
};
modules = [
./hosts/homelab/configuration.nix
home-manager.nixosModules.default
k0s.nixosModules.default
nix-index-database.nixosModules.nix-index
sops-nix.nixosModules.sops
];
};
homelab2 = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs k0s;
};
modules = [
./hosts/homelab2/configuration.nix
home-manager.nixosModules.default
k0s.nixosModules.default
nix-index-database.nixosModules.nix-index
sops-nix.nixosModules.sops
];
};
framework = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs plasma-manager;
};
modules = [
./hosts/framework/configuration.nix
home-manager.nixosModules.default
kolide-launcher.nixosModules.kolide-launcher
nixos-hardware.nixosModules.framework-13-7040-amd
nix-index-database.nixosModules.nix-index
nixos-work-config.nixosModules.system
sops-nix.nixosModules.sops
];
};
};
};
}