-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathflake.nix
217 lines (175 loc) · 5.89 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{
inputs = {
# Update channels
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
follows = "chaotic/nixpkgs";
};
# Modules
home-manager = {
url = "github:nix-community/home-manager";
follows = "chaotic/home-manager";
};
nerivations = {
url = "github:icedborn/nerivations";
inputs.nixpkgs.follows = "nixpkgs";
};
steam-session = {
url = "github:Jovian-Experiments/Jovian-NixOS";
follows = "chaotic/jovian";
};
# Apps
hyprlux = {
url = "github:amadejkastelic/Hyprlux";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprpanel = {
url = "github:Jas-SinghFSU/HyprPanel";
inputs.nixpkgs.follows = "nixpkgs";
};
pipewire-screenaudio = {
url = "github:IceDBorn/pipewire-screenaudio";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
home-manager,
nerivations,
nixpkgs,
pipewire-screenaudio,
self,
hyprlux,
hyprpanel,
chaotic,
steam-session,
zen-browser,
...
}@inputs:
{
nixosConfigurations."desktop" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
# Read configuration location
(
{ lib, ... }:
let
inherit (lib) mkOption types;
in
{
options.icedos.configurationLocation = mkOption {
type = types.str;
default = "/home/icedborn/.code/icedos";
};
}
)
# Symlink configuration state on "/run/current-system/source"
{
# Source: https://github.com/NixOS/nixpkgs/blob/5e4fbfb6b3de1aa2872b76d49fafc942626e2add/nixos/modules/system/activation/top-level.nix#L191
system.extraSystemBuilderCmds = "ln -s ${self} $out/source";
}
# Internal modules
(
{ lib, ... }:
let
inherit (lib) filterAttrs;
getModules =
path:
builtins.map (dir: "/${path}/${dir}") (
builtins.attrNames (
filterAttrs (n: v: v == "directory" && !(n == "desktop" && path == ./system)) (
builtins.readDir path
)
)
);
in
{
imports =
[
./hardware
./internals.nix
./options.nix
]
++ getModules (./system)
++ getModules (./hardware);
config.system.stateVersion = "23.05";
}
)
# External modules
chaotic.nixosModules.default
home-manager.nixosModules.home-manager
nerivations.nixosModules.default
./system/desktop
# Is First Build
{ icedos.internals.isFirstBuild = false; }
steam-session.nixosModules.default
./system/desktop/steam-session
./system/desktop/hyprland
hyprlux.nixosModules.default
{ nixpkgs.overlays = [ hyprpanel.overlay ]; }
./system/applications/modules/zen-browser
./system/users/icedborn
(
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."luks-8e034466-adc7-4f83-81cd-4ceb2397eb2d".device =
"/dev/disk/by-uuid/8e034466-adc7-4f83-81cd-4ceb2397eb2d";
fileSystems."/" = {
device = "/dev/disk/by-uuid/e2a8d4bf-b1fc-446f-b347-c3671eda1ccb";
fsType = "btrfs";
options = [ "subvol=@" ];
};
boot.initrd.luks.devices."luks-ab2a2fb9-08aa-4c27-ab62-a1581a0113ff".device =
"/dev/disk/by-uuid/ab2a2fb9-08aa-4c27-ab62-a1581a0113ff";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/1456-AC74";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/a642dc73-75f4-425f-8cc9-cbef30039563"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp9s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
)
];
};
};
}