-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
160 lines (142 loc) · 4.93 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
{
description = "Manage my Nix-based machines";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.disko.url = github:nix-community/disko;
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.url = "github:lnl7/nix-darwin";
inputs.darwin.inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.url = "github:nix-community/home-manager/release-24.05";
inputs.home-manager.inputs.nixpkgs.follows = "nixpkgs";
inputs.agenix.url = "github:ryantm/agenix";
inputs.agenix.inputs.nixpkgs.follows = "nixpkgs";
inputs.agenix.inputs.home-manager.follows = "home-manager";
inputs.agenix.inputs.darwin.follows = "darwin";
inputs.alacritty-theme.url = "github:alexghr/alacritty-theme.nix";
inputs.attic.url = "github:zhaofengli/attic";
inputs.vscode-server.url = "github:nix-community/nixos-vscode-server";
inputs.vscode-server.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, nixpkgs-unstable, darwin, home-manager, agenix, alacritty-theme, disko, attic, vscode-server }@attrs: {
overlays.unstable = final: prev: {
unstable = import nixpkgs-unstable {
system = prev.system;
config.allowUnfree = prev.config.allowUnfree;
};
};
nixosModules = builtins.listToAttrs (map (x: {
name = x;
value = import (./modules + "/${x}");
})
(builtins.attrNames (builtins.readDir ./modules)));
nixosConfigurations = {
hk47 = let system = "aarch64-linux"; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{ imports = builtins.attrValues self.nixosModules; }
home-manager.nixosModule
agenix.nixosModules.default
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
nixpkgs.overlays = [
alacritty-theme.overlays.default
];
})
./hosts/hk47/configuration.nix
./users/ag.nix
];
};
palpatine = let system = "x86_64-linux"; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [
# https://nixos.wiki/wiki/Flakes#Importing_packages_from_multiple_channels
({ config, pkgs, ...}: {
nixpkgs.overlays = [
self.overlays.unstable
alacritty-theme.overlays.default
attic.overlays.default
];
})
home-manager.nixosModule
agenix.nixosModules.default
{ imports = builtins.attrValues self.nixosModules; }
vscode-server.nixosModules.default
(import ./hosts/palpatine/configuration.nix { nixpkgsFlakePath = nixpkgs; })
./users/ag.nix
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
fonts.packages= [pkgs.victor-mono];
})
];
};
nixosIso = let system = "x86_64-linux"; in nixpkgs.lib.nixosSystem {
inherit system;
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
({ pkgs, ... }:
{
networking.networkmanager.enable = true;
networking.wireless.enable = false;
environment.systemPackages = with pkgs; [
git
vim
file
parted
];
})
];
};
b1 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
})
self.nixosModules.attic
self.nixosModules.tailscale
disko.nixosModules.disko
agenix.nixosModules.default
attic.nixosModules.atticd
./hosts/b1/configuration.nix
];
};
r5d4 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
})
self.nixosModules.tailscale
agenix.nixosModules.default
(import ./hosts/r5d4/configuration.nix { nixpkgsFlakePath = nixpkgs; })
];
};
};
darwinConfigurations = {
mackey = let system = "aarch64-darwin"; in darwin.lib.darwinSystem {
inherit system;
modules = [
({ config, pkgs, ...}: {
nixpkgs.overlays = [
self.overlays.unstable
alacritty-theme.overlays.default
];
})
home-manager.darwinModule
agenix.darwinModules.default
./modules/home-manager
./modules/cachix
./modules/system
./modules/attic
./hosts/mackey/darwin-configuration.nix
./users/ag.nix
({ pkgs, ... }: {
nix.registry.nixpkgs.flake = nixpkgs;
fonts.packages = [pkgs.victor-mono];
})
];
};
};
};
}