-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
185 lines (166 loc) · 6.24 KB
/
flake.nix
File metadata and controls
185 lines (166 loc) · 6.24 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
174
175
176
177
178
179
180
181
182
183
184
185
{
description = "";
inputs = {
# Core NixOS
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11-small";
nixos-hardware.url = "github:nixos/nixos-hardware";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
# Home Manager
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# Rust Toolchain
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
# Determinate nix
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
determinate.inputs.nixpkgs.follows = "nixpkgs";
# sops
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# Disko
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs";
# Hyprland Ecosystem
hyprnix.url = "github:hyprwm/hyprnix";
hyprnix.inputs.nixpkgs.follows = "nixpkgs";
hyprland-plugins.url = "github:hyprwm/hyprland-plugins";
hyprland-plugins.inputs.hyprland.follows = "hyprnix/hyprland";
hyprland-plugins.inputs.nixpkgs.follows = "nixpkgs";
# Hyprcursor
rose-pine-hyprcursor.url = "github:ndom91/rose-pine-hyprcursor";
rose-pine-hyprcursor.inputs.nixpkgs.follows = "nixpkgs";
rose-pine-hyprcursor.inputs.hyprlang.follows = "hyprnix/hyprlang";
# Silent SDDM Theme
silentSDDM.url = "github:uiriansan/SilentSDDM";
silentSDDM.inputs.nixpkgs.follows = "nixpkgs";
# ashell
ashell.url = "github:MalpenZibo/ashell";
ashell.inputs.nixpkgs.follows = "nixpkgs";
#Vicinae
vicinae.url = "github:vicinaehq/vicinae";
vicinae.inputs.nixpkgs.follows = "nixpkgs";
vicinae-extensions.url = "github:vicinaehq/extensions";
vicinae-extensions.inputs.nixpkgs.follows = "nixpkgs";
# VS Code Extensions Mirror
# nix4vscode.url = "github:nix-community/nix4vscode";
# nix4vscode.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ nixpkgs, ashell, ... }@inputs:
let
inherit (nixpkgs) lib;
############################################
# Overlay Setup
############################################
globalOverlays =
with lib;
map (n: import (./overlays + ("/" + n))) (
(filter (n: match ".*\\.nix" n != null)) (attrNames (readDir ./overlays))
);
# Assumes machine path
specificOverlays =
machinePath:
with lib;
if pathExists "${(dirOf machinePath)}/overlays" then
(map (n: import ("${(dirOf machinePath)}/overlays" + ("/" + n))) (
(filter (n: match ".*\\.nix" n != null)) (attrNames (readDir "${(dirOf machinePath)}/overlays"))
))
else
[ ];
withOverlays = configModule: [
{
nixpkgs.overlays = [
inputs.fenix.overlays.default
inputs.vicinae.overlays.default
# inputs.nix4vscode.overlays.default
(final: prev: {
ashell = inputs.ashell.packages.${prev.stdenv.hostPlatform.system}.default;
})
inputs.hyprnix.overlays.default
inputs.hyprland-plugins.overlays.default
]
++ globalOverlays
++ (specificOverlays configModule);
}
configModule
];
############################################
# Dev Shell Utils
############################################
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
in
rec {
############################################
# manifold
############################################
nixosConfigurations.manifold = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./modules/wsl.nix ++ [ { networking.hostName = "manifold-wsl"; } ];
};
############################################
# portal
############################################
nixosConfigurations.portal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./modules/wsl.nix ++ [ { networking.hostName = "portal-wsl"; } ];
};
############################################
# nemesis
############################################
nixosConfigurations.nemesis = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./hosts/nemesis/default.nix;
};
############################################
# fabricator
############################################
nixosConfigurations.fabricator = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./hosts/fabricator/default.nix;
};
images.fabricator = nixosConfigurations.fabricator.config.system.build.image;
############################################
# archiver
############################################
nixosConfigurations.archiver = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./hosts/archiver/default.nix;
};
############################################
# durandal
############################################
nixosConfigurations.durandal = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = withOverlays ./hosts/durandal/default.nix;
};
images.durandal = nixosConfigurations.durandal.config.system.build.image;
############################################
# Dev Shells
############################################
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
inputs.fenix.overlays.default
];
};
in
{
rust = import ./shells/rust.nix { inherit pkgs system; };
troubleshoot = import ./shells/troubleshoot.nix { inherit pkgs system; };
}
);
};
}