-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration-msi.nix
More file actions
270 lines (252 loc) · 8.67 KB
/
configuration-msi.nix
File metadata and controls
270 lines (252 loc) · 8.67 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
config,
pkgs,
lib,
inputs,
...
}:
let
secrets = builtins.fromTOML (builtins.readFile ./secrets.toml);
in
{
imports = [
./hardware-configuration-msi.nix
./configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Wifi Card and ethernet
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
# boot.kernelPackages = pkgs.linuxPackages_latest;
services.xserver.enable = true;
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = true;
services.desktopManager.plasma6.enable = true;
# services.xserver = {
# enable = true;
# displayManager.gdm.enable = true;
# desktopManager.gnome.enable = true;
# };
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
services.printing.enable = true;
services.openssh = {
enable = true;
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFQADV9Bz8wBDUpV31xw5IOv04PlEJ5x11cp/VQjx3l6 nixos@nixos"
];
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
programs.steam.enable = true;
# Nvidia setup
services.xserver.videoDrivers = [ "nvidia" ];
hardware.graphics.enable = true;
hardware.bluetooth = {
enable = true; # enables support for Bluetooth
powerOnBoot = true; # powers up the default Bluetooth controller on boot
settings = {
General = {
Privacy = "device";
JustWorksRepairing = "always";
Class = "0x000100";
FastConnectable = "true";
};
};
};
hardware.xone.enable = true;
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
programs.fish.enable = true;
environment.systemPackages = with pkgs; [
ollama-cuda
lmstudio
prismlauncher
# KDE
libvirt
kdePackages.discover # Optional: Install if you use Flatpak or fwupd firmware update sevice
kdePackages.kcalc # Calculator
kdePackages.kcharselect # Tool to select and copy special characters from all installed fonts
kdePackages.kclock # Clock app
kdePackages.kcolorchooser # A small utility to select a color
kdePackages.kolourpaint # Easy-to-use paint program
kdePackages.ksystemlog # KDE SystemLog Application
kdePackages.sddm-kcm # Configuration module for SDDM
kdiff3 # Compares and merges 2 or 3 files or directories
kdePackages.isoimagewriter # Optional: Program to write hybrid ISO files onto USB disks
kdePackages.partitionmanager # Optional: Manage the disk devices, partitions and file systems on your computer
# Non-KDE graphical packages
hardinfo2 # System information and benchmarks for Linux systems
vlc # Cross-platform media player and streaming server
wayland-utils # Wayland utilities
wl-clipboard # Command-line copy/paste utilities for Wayland
linuxKernel.packages.linux_zen.xone
librewolf
firefox
wl-clipboard # Command-line copy/paste utilities for Wayland
# Non-KDE graphical packages
hardinfo2 # System information and benchmarks for Linux systems
vlc # Cross-platform media player and streaming server
wayland-utils # Wayland utilities
signal-desktop
spotify
qbittorrent
(lutris.override {
# Intercept buildFHSEnv to modify target packages
buildFHSEnv =
args:
pkgs.buildFHSEnv (
args
// {
multiPkgs =
envPkgs:
let
# Fetch original package list
originalPkgs = args.multiPkgs envPkgs;
# Disable tests for openldap
customLdap = envPkgs.openldap.overrideAttrs (_: {
doCheck = false;
});
in
# Replace broken openldap with the custom one
builtins.filter (p: (p.pname or "") != "openldap") originalPkgs ++ [ customLdap ];
}
);
})
kitty
discord
cinny-desktop
inputs.nix-software-center.packages.${pkgs.stdenv.hostPlatform.system}.nix-software-center
# vlc
monero-gui
cemu
qemu
quickemu
ffmpeg
(pkgs.makeAutostartItem {
name = "mullvad-vpn";
package = pkgs.mullvad-vpn;
})
];
# environment.plasma6.excludePackages = with pkgs; [
# kdePackages.kate
# kdePackages.discover # Optional: Install if you use Flatpak or fwupd firmware update sevice
# kdePackages.kcalc # Calculator
# kdePackages.kcharselect # Tool to select and copy special characters from all installed fonts
# kdePackages.kclock # Clock app
# kdePackages.kcolorchooser # A small utility to select a color
# kdePackages.kolourpaint # Easy-to-use paint program
# kdePackages.ksystemlog # KDE SystemLog Application
# kdePackages.sddm-kcm # Configuration module for SDDM
# ];
services.mullvad-vpn.enable = true;
services.mullvad-vpn.package = pkgs.mullvad-vpn;
networking.firewall.allowedTCPPorts = [ 57621 ];
programs.appimage.enable = true;
programs.appimage.binfmt = true;
# virtualisation.virtualbox.host.enable = true;
# users.extraGroups.vboxusers.members = [ "nixos" ];
# virtualisation.virtualbox.host.enableExtensionPack = true;
programs.virt-manager.enable = true;
users.groups.libvirtd.members = [ "your_username" ];
virtualisation.libvirtd.enable = true;
virtualisation.spiceUSBRedirection.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
# programs.adb.enable = true;
users.users.nixos.extraGroups = [
"adbusers"
"kvm"
];
networking.wireless.enable = true;
services.restic.backups.msi-backup = {
initialize = true;
repository = "b2:msi-backup-5d841ca7-4eac-455d-9f12-8ab57a33eb36:msi-backup-5d841ca7-4eac-455d-9f12-8ab57a33eb36";
environmentFile = toString (
pkgs.writeText "restic-b2.env" ''
B2_ACCOUNT_KEY=${secrets.B2_ACCOUNT_KEY}
B2_ACCOUNT_ID=${secrets.B2_ACCOUNT_ID}
RESTIC_PASSWORD=${secrets.RESTIC_PASSWORD}
''
);
paths = [
"/home"
];
timerConfig = {
OnCalendar = "weekly";
Persistent = true;
};
runCheck = true;
progressFps = 0.1;
};
services.swapspace.enable = true;
systemd.services.restic-forget-container-backup = {
description = "Restic forget/prune and cache cleanup for container-backup-homelab";
serviceConfig = {
Type = "oneshot";
EnvironmentFile = toString (
pkgs.writeText "restic-b2.env" ''
B2_ACCOUNT_KEY=${secrets.B2_ACCOUNT_KEY}
B2_ACCOUNT_ID=${secrets.B2_ACCOUNT_ID}
RESTIC_PASSWORD=${secrets.RESTIC_PASSWORD}
''
);
ExecStart = [
"${pkgs.restic}/bin/restic --repo b2:container-backup-homelab:container-backup-homelab forget --prune --group-by \"\" --keep-last 1 --keep-tag undying"
"${pkgs.restic}/bin/restic cache --cleanup"
];
};
};
systemd.timers.restic-forget-container-backup = {
description = "Weekly restic forget/prune for container-backup-homelab";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "weekly";
Persistent = true;
};
};
}