1 # Edit this configuration file to define what should be installed on
2 # your system. Help is available in the configuration.nix(5) man page
3 # and in the NixOS manual (accessible by running ‘nixos-help’).
5 { config, pkgs, inputs, lib, ... } @ args:
9 # tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
10 # session = "${pkgs.sway}/bin/sway";
12 wallpaper = pkgs.fetchurl {
13 url = "https://w.wallhaven.cc/full/ex/wallhaven-exrqrr.jpg";
14 sha256 = "sha256-RYN8KwJPDMfxrcosbpmjON0Y+I58IhB1Ke36LdohsxA=";
20 [ # Include the results of the hardware scan.
21 ./hardware-configuration.nix
22 inputs.home-manager.nixosModules.default
23 inputs.extra-container.nixosModules.default
24 inputs.microvm.nixosModules.host
28 boot.tmp.cleanOnBoot = true;
29 boot.loader.systemd-boot.enable = true;
30 boot.loader.efi.canTouchEfiVariables = true;
31 boot.plymouth.enable = true;
32 boot.plymouth.theme = "bgrt";
33 boot.initrd.verbose = false;
34 boot.initrd.systemd.enable = true;
35 boot.initrd.kernelModules = [ "amdgpu" ];
36 boot.consoleLogLevel = 0;
37 boot.kernelPackages = pkgs.linuxPackages_latest;
38 boot.kernelParams = [ "quiet" "udev.log_level=0" "amdgpu.runpm=0" ];
40 # incus admin init --minimal
41 # incus image list images:
42 # incus launch images:ubuntu/noble <name>
43 # incus exec <name> -- /bin/bash
44 # incus exec <name> -- adduser --shell /bin/bash --ingroup sudo ps
45 # incus exec <name> -- su - ps -c 'tmux new-session -A -s main'
46 virtualisation.incus.enable = true;
47 virtualisation.incus.ui.enable = true;
48 networking.nftables.enable = true;
49 networking.firewall.trustedInterfaces = [ "incusbr0" ];
51 networking.hostName = "thinkpad"; # Define your hostname.
52 # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
54 nix.settings.experimental-features = [ "nix-command" "flakes" ];
55 nix.settings.download-buffer-size = 500000000;
56 nix.settings.trusted-users = ["root" "ps"];
58 # Configure network proxy if necessary
59 # networking.proxy.default = "http://user:password@proxy:port/";
60 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
63 networking.networkmanager.enable = true;
66 time.timeZone = "Europe/Berlin";
68 # Select internationalisation properties.
69 i18n.defaultLocale = "de_DE.UTF-8";
71 i18n.extraLocaleSettings = {
72 LC_ADDRESS = "de_DE.UTF-8";
73 LC_IDENTIFICATION = "de_DE.UTF-8";
74 LC_MEASUREMENT = "de_DE.UTF-8";
75 LC_MONETARY = "de_DE.UTF-8";
76 LC_NAME = "de_DE.UTF-8";
77 LC_NUMERIC = "de_DE.UTF-8";
78 LC_PAPER = "de_DE.UTF-8";
79 LC_TELEPHONE = "de_DE.UTF-8";
80 LC_TIME = "de_DE.UTF-8";
83 programs.dconf.enable = true;
84 programs.steam.enable = true;
90 # privateNetwork = true;
91 localAddress = "10.23.45.2";
92 hostAddress = "10.23.45.1";
94 bindMounts."/per".hostPath = "/var/lib/nixos-containers/im";
95 bindMounts."/per".isReadOnly = false;
98 "--property='MemoryMax=60M'"
99 "--property='MemoryHigh=50M'"
100 "--property='CPUQuota=4%'"
103 config = { config, pkgs, ... }: {
104 imports = [ inputs.impermanence.nixosModules.impermanence ];
106 environment.persistence."/per" = {
110 { directory = "/home/ps"; user = "ps"; group = "users"; mode = "0750"; }
114 environment.systemPackages = with pkgs; [ helix python312 deno ];
116 users.users.ps = { isNormalUser = true; };
118 networking.firewall.allowedTCPPorts = [ 80 8080 ];
120 system.stateVersion = "25.05";
124 networking.nat.enable = true;
125 networking.nat.internalInterfaces = ["ve-+"];
126 networking.nat.externalInterface = "eth0";
127 networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
132 defaultSession = "xfce+i3";
143 package = pkgs.qogir-theme;
147 package = pkgs.qogir-icon-theme;
150 name = "volantes_light_cursors";
151 package = pkgs.volantes-cursors;
154 background = "${wallpaper}";
159 xterm.enable = false;
165 plasma6.enable = true;
167 windowManager.i3.enable = true;
168 windowManager.awesome.enable = true;
169 windowManager.herbstluftwm.enable = true;
173 variant = "nodeadkeys";
174 options = "caps:ctrl_modifier";
176 excludePackages = [ pkgs.xterm ];
177 videoDrivers = ["amdgpu"];
178 # libinput.enable = true;
182 systemd.user.services.plasma-i3wm = {
183 wantedBy = [ "plasma-workspace-x11.target" ];
184 description = "Launch Plasma with i3wm.";
185 environment = lib.mkForce {};
187 ExecStart = "${pkgs.i3}/bin/i3";
191 systemd.user.services.plasma-workspace-x11.after = [ "plasma-i3wm.target" ];
192 systemd.user.services.plasma-kwin_x11.enable = false;
194 services.autorandr = {
199 "set-wallpaper" = "set-wallpaper";
204 services.syncthing = {
207 dataDir = "/home/ps/sync";
208 configDir = "/home/ps/.config/syncthing";
211 # services.auto-cpufreq.enable = true;
212 services.auto-cpufreq.settings = {
214 governor = "powersave";
218 governor = "performance";
226 # CPU_SCALING_GOVERNOR_ON_AC = "performance";
227 # CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
229 # CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
230 # CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
232 # PLATFORM_PROFILE_ON_AC = "balanced";
233 # PLATFORM_PROFILE_ON_BAT = "low-power";
235 # CPU_BOOST_ON_AC = "1";
236 # CPU_BOOST_ON_BAT = "0";
238 # AMDGPU_ABM_LEVEL_ON_AC = "0";
239 # AMDGPU_ABM_LEVEL_ON_BAT = "3";
241 # CPU_MIN_PERF_ON_AC = 0;
242 # CPU_MAX_PERF_ON_AC = 100;
243 # CPU_MIN_PERF_ON_BAT = 0;
244 # CPU_MAX_PERF_ON_BAT = 20;
246 # # START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
247 # STOP_CHARGE_THRESH_BAT0 = 90; # 85 and above it stops charging
251 services.udev.extraRules = ''
252 KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
260 extraPackages = with pkgs; [
269 support32Bit.enable = true;
273 # services.logind = {
274 # extraConfig = "HandlePowerKey=suspend";
275 # lidSwitch = "suspend";
278 # Configure console keymap
279 console.keyMap = "de-latin1-nodeadkeys";
281 # Enable CUPS to print documents.
282 services.printing.enable = true;
283 services.printing.drivers = [ pkgs.gutenprint ];
286 hardware.sane.enable = true;
287 hardware.sane.extraBackends = [ pkgs.hplipWithPlugin pkgs.sane-airscan ];
288 services.avahi.enable = true;
289 services.avahi.nssmdns4 = true;
290 services.avahi.reflector = true;
291 services.udev.packages = [ pkgs.sane-airscan ];
294 hardware.bluetooth.enable = true;
295 hardware.bluetooth.powerOnBoot = false;
296 # services.blueman.enable = true;
298 # Enable sound with pipewire.
299 services.pulseaudio.enable = false;
300 security.rtkit.enable = true;
301 services.pipewire = {
304 alsa.support32Bit = true;
306 # If you want to use JACK applications, uncomment this
309 # use the example session manager (no others are packaged yet so this is enabled by default,
310 # no need to redefine it in your config for now)
311 #media-session.enable = true;
317 # Enable touchpad support (enabled default in most desktopManager).
318 # services.libinput.touchpad = {
319 # naturalScrolling = false;
322 # Define a user account. Don't forget to set a password with ‘passwd’.
323 users.groups.ssh = {};
327 description = "Patrick";
329 extraGroups = [ "networkmanager" "wheel" "dialout" "jackaudio" "lp" "incus-admin" ];
332 # isSystemUser = true;
345 initialPassword = "chirp";
349 security.polkit.enable = true;
350 security.sudo.wheelNeedsPassword = false;
353 backupFileExtension = "backup";
359 "ps" = import ./home.nix;
363 # Enable automatic login for the user.
364 # services.displayManager.autoLogin.enable = true;
365 # services.displayManager.autoLogin.user = "ps";
366 # services.getty.autologinUser = "ps";
368 # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
369 # systemd.services."getty@tty1".enable = false;
370 # systemd.services."autovt@tty1".enable = false;
372 # Allow unfree packages
373 nixpkgs.config.allowUnfree = true;
376 environment.variables = {
377 RUSTICL_ENABLE = "radeonsi";
379 # List packages installed in system profile. To search, run:
381 environment.systemPackages = with pkgs; [
382 args.inputs.zls.inputs.zig-overlay.packages.${pkgs.system}.master
383 args.inputs.zls.packages.${pkgs.system}.zls
384 args.inputs.psch-flakes.packages.${pkgs.system}.resetmsmice
385 args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zuban
386 vim wget file git kitty i3 gdb
390 asciinema asciinema-agg
406 xfce.xfce4-pulseaudio-plugin
407 # xfce.xfce4-verve-plugin
408 xfce.xfce4-notes-plugin
409 # xfce.xfce4-timer-plugin
410 # xfce.xfce4-windowck-plugin
411 xfce.thunar-archive-plugin
412 # xfce.xfce4-i3-workspaces-plugin
413 # xfce.xfce4-xkb-plugin
414 xfce.xfce4-whiskermenu-plugin
418 programs.xfconf.enable = true;
419 programs.nix-ld.enable = true;
421 services.fwupd.enable = true;
423 # Some programs need SUID wrappers, can be configured further or are
424 # started in user sessions.
425 # programs.mtr.enable = true;
426 # programs.gnupg.agent = {
428 # enableSSHSupport = true;
431 # List services that you want to enable:
433 # Enable the OpenSSH daemon.
438 # PasswordAuthentication = false;
439 # PermitRootLogin = "no";
441 # authorizedKeysCommand =
442 # let keys = pkgs.writers.writePython3Bin "keys" {} ''
450 # "${keys}/bin/keys";
451 # authorizedKeysCommandUser = "ps";
454 # Open ports in the firewall.
455 networking.firewall.allowedTCPPorts = [ 22 1234 5900 6011 6021 6022 8080 53317 7236 7250 ];
456 networking.firewall.allowedUDPPorts = [ 5901 53317 7236 5353 ];
457 # Or disable the firewall altogether.
458 # networking.firewall.enable = false;
460 # This value determines the NixOS release from which the default
461 # settings for stateful data, like file locations and database versions
462 # on your system were taken. It‘s perfectly fine and recommended to leave
463 # this value at the release version of the first install of this system.
464 # Before changing this value read the documentation for this option
465 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
466 system.stateVersion = "24.05"; # Did you read the comment?