Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
173 lines (159 loc) · 4.8 KB
/
Copy pathflake.nix
File metadata and controls
173 lines (159 loc) · 4.8 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
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
171
172
173
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
agenix.url = "github:ryantm/agenix";
agenix-rekey = {
url = "github:oddlama/agenix-rekey";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
zellij-sessionizer = {
url = "github:cncptpr/zellij-sessionizer";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
noctalia = {
url = "github:noctalia-dev/noctalia-shell";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nixos-generators,
flake-utils,
agenix,
agenix-rekey,
treefmt-nix,
nixos-wsl,
zen-browser,
zellij-sessionizer,
home-manager,
noctalia,
...
}:
{
nixosConfigurations.contiwsl = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
zellij-sessionizer = zellij-sessionizer;
};
modules = [
agenix.nixosModules.default
agenix-rekey.nixosModules.default
nixos-wsl.nixosModules.default
./hosts/contiwsl/configuration.nix
./secrets
./modules
];
};
nixosConfigurations.cncptvps = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
agenix.nixosModules.default
agenix-rekey.nixosModules.default
./hosts/cncptvps/configuration.nix
./secrets
./modules
];
};
nixosConfigurations.nix-vps = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
agenix.nixosModules.default
agenix-rekey.nixosModules.default
./hosts/nix-vps/configuration.nix
./secrets
./modules
];
};
nixosConfigurations."0T2" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
zen-browser = zen-browser;
noctalia = noctalia;
};
modules = [
./hosts/0T2/configuration.nix
agenix.nixosModules.default
agenix-rekey.nixosModules.default
./secrets
./modules
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.cncptpr = ./hosts/0T2/home.nix;
}
];
};
nixosConfigurations.cncptpi = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
./hosts/cncptpi/configuration.nix
agenix.nixosModules.default
agenix-rekey.nixosModules.default
# extra imported, because the sdcard doesn't require this file
./hosts/cncptpi/hardware-configuration.nix
./secrets
./modules
];
};
# $ nix build .#packages.aarch64-linux.cncptpi-sdcard
# Needs to be run on a aarch64 system
# ./result/sd-image will contain the compressed .img
# Load that on the sd with imager or any other image media creation tool
packages.aarch64-linux.cncptpi-sdcard = nixos-generators.nixosGenerate {
system = "aarch64-linux";
format = "sd-aarch64";
modules = [
agenix.nixosModules.default
agenix-rekey.nixosModules.default
./hosts/cncptpi/configuration.nix
./modules/sdcard-extras.nix
./modules
];
};
agenix-rekey = agenix-rekey.configure {
userFlake = self;
nixosConfigurations = self.nixosConfigurations;
# Example for colmena:
# nixosConfigurations = ((colmena.lib.makeHive self.colmena).introspect (x: x)).nodes;
};
formatter =
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
formattingConfig =
{ ... }:
{
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
};
treeFmtEval = treefmt-nix.lib.evalModule pkgs formattingConfig;
in
{
"${system}" = treeFmtEval.config.build.wrapper;
};
}
// flake-utils.lib.eachDefaultSystem (system: rec {
pkgs = import nixpkgs {
inherit system;
overlays = [ agenix-rekey.overlays.default ];
};
devShells.default = pkgs.mkShell {
packages = [ pkgs.agenix-rekey ];
};
});
}