-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
143 lines (140 loc) · 3.89 KB
/
flake.nix
File metadata and controls
143 lines (140 loc) · 3.89 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
{
description = "Home manager flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
};
nixGL = {
url = "github:dyfrgi/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix-rekey = {
url = "github:oddlama/agenix-rekey";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
home-manager,
agenix,
agenix-rekey,
...
}@inputs:
let
system = "x86_64-linux";
overlays.default = (import ./overlays);
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pkgs-unstable = import inputs.nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
extraSpecialArgs = { inherit inputs pkgs-unstable; };
defaultHomeModules = [ ./home ];
# maybe add primamryUser to mkNixos?
mkNixos =
name: prev:
nixpkgs.lib.nixosSystem (
{
inherit pkgs;
specialArgs = { inherit inputs pkgs-unstable defaultHomeModules; };
modules = [
./nixos
overlays.default
./hosts/${name}/configuration.nix
agenix.nixosModules.default
agenix-rekey.nixosModules.default
];
}
// prev
);
in
{
nixosConfigurations = {
snail = mkNixos "snail" {
system = "x86_64-linux";
};
slab = mkNixos "slab" {
system = "x86_64-linux";
};
splat = mkNixos {
system = "x86_64-linux";
};
};
homeConfigurations = {
"mleuchtenburg" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = extraSpecialArgs // {
username = "mleuchtenburg";
};
modules = defaultHomeModules // [
overlays.default
./modules-hm/non-nixos.nix
./modules-hm/non-nixos-gui.nix
./modules-hm/gui.nix
./modules-hm/singlestore.nix
];
};
"mleuchtenburg@msl" = home-manager.lib.homeManagerConfiguration {
# work coder instance
inherit pkgs;
extraSpecialArgs = extraSpecialArgs // {
username = "mleuchtenburg";
};
modules = defaultHomeModules // [
overlays.default
./modules-hm/non-nixos.nix
./modules-hm/singlestore.nix
];
};
"msl" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = extraSpecialArgs // {
username = "msl";
};
inherit pkgs;
modules = defaultHomeModules // [
./modules-hm/gui.nix
];
};
"msl@splat" = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = extraSpecialArgs // {
username = "msl";
};
inherit pkgs;
modules = defaultHomeModules // [
];
};
};
agenix-rekey = agenix-rekey.configure {
userFlake = self;
nixosConfigurations = self.nixosConfigurations;
};
devShells.${system}.default = pkgs.mkShell {
packages = [
agenix-rekey.packages.${system}.default
pkgs.age-plugin-yubikey
pkgs.rage
pkgs.age
];
env.AGENIX_REKEY_ADD_TO_GIT = "true";
};
};
}