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;
57 # Configure network proxy if necessary
58 # networking.proxy.default = "http://user:password@proxy:port/";
59 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
62 networking.networkmanager.enable = true;
65 time.timeZone = "Europe/Berlin";
67 # Select internationalisation properties.
68 i18n.defaultLocale = "de_DE.UTF-8";
70 i18n.extraLocaleSettings = {
71 LC_ADDRESS = "de_DE.UTF-8";
72 LC_IDENTIFICATION = "de_DE.UTF-8";
73 LC_MEASUREMENT = "de_DE.UTF-8";
74 LC_MONETARY = "de_DE.UTF-8";
75 LC_NAME = "de_DE.UTF-8";
76 LC_NUMERIC = "de_DE.UTF-8";
77 LC_PAPER = "de_DE.UTF-8";
78 LC_TELEPHONE = "de_DE.UTF-8";
79 LC_TIME = "de_DE.UTF-8";
82 programs.dconf.enable = true;
83 programs.steam.enable = true;
89 # privateNetwork = true;
90 localAddress = "10.23.45.2";
91 hostAddress = "10.23.45.1";
93 bindMounts."/per".hostPath = "/var/lib/nixos-containers/im";
94 bindMounts."/per".isReadOnly = false;
97 "--property='MemoryMax=60M'"
98 "--property='MemoryHigh=50M'"
99 "--property='CPUQuota=4%'"
102 config = { config, pkgs, ... }: {
103 imports = [ inputs.impermanence.nixosModules.impermanence ];
105 environment.persistence."/per" = {
109 { directory = "/home/ps"; user = "ps"; group = "users"; mode = "0750"; }
113 environment.systemPackages = with pkgs; [ helix python312 deno ];
115 users.users.ps = { isNormalUser = true; };
117 networking.firewall.allowedTCPPorts = [ 80 8080 ];
119 system.stateVersion = "25.05";
123 networking.nat.enable = true;
124 networking.nat.internalInterfaces = ["ve-+"];
125 networking.nat.externalInterface = "eth0";
126 networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
131 defaultSession = "xfce+i3";
142 package = pkgs.qogir-theme;
146 package = pkgs.qogir-icon-theme;
149 name = "volantes_light_cursors";
150 package = pkgs.volantes-cursors;
153 background = "${wallpaper}";
158 xterm.enable = false;
165 windowManager.i3.enable = true;
166 windowManager.awesome.enable = true;
170 variant = "nodeadkeys";
171 options = "caps:ctrl_modifier";
173 excludePackages = [ pkgs.xterm ];
174 videoDrivers = ["amdgpu"];
175 # libinput.enable = true;
179 services.autorandr = {
184 "set-wallpaper" = "set-wallpaper";
189 services.syncthing = {
192 dataDir = "/home/ps/sync";
193 configDir = "/home/ps/.config/syncthing";
199 CPU_SCALING_GOVERNOR_ON_AC = "performance";
200 CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
202 CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
203 CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
205 PLATFORM_PROFILE_ON_AC = "balanced";
206 PLATFORM_PROFILE_ON_BAT = "low-power";
208 CPU_BOOST_ON_AC = "1";
209 CPU_BOOST_ON_BAT = "0";
211 AMDGPU_ABM_LEVEL_ON_AC = "0";
212 AMDGPU_ABM_LEVEL_ON_BAT = "3";
214 CPU_MIN_PERF_ON_AC = 0;
215 CPU_MAX_PERF_ON_AC = 100;
216 CPU_MIN_PERF_ON_BAT = 0;
217 CPU_MAX_PERF_ON_BAT = 20;
219 START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
220 STOP_CHARGE_THRESH_BAT0 = 85; # 85 and above it stops charging
224 services.udev.extraRules = ''
225 KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
237 support32Bit.enable = true;
241 # services.logind = {
242 # extraConfig = "HandlePowerKey=suspend";
243 # lidSwitch = "suspend";
246 # Configure console keymap
247 console.keyMap = "de-latin1-nodeadkeys";
249 # Enable CUPS to print documents.
250 services.printing.enable = true;
251 services.printing.drivers = [ pkgs.gutenprint ];
254 hardware.sane.enable = true;
255 hardware.sane.extraBackends = [ pkgs.hplipWithPlugin pkgs.sane-airscan ];
256 services.avahi.enable = true;
257 services.avahi.nssmdns4 = true;
258 services.avahi.reflector = true;
259 services.udev.packages = [ pkgs.sane-airscan ];
262 hardware.bluetooth.enable = true;
263 hardware.bluetooth.powerOnBoot = false;
264 services.blueman.enable = true;
266 # Enable sound with pipewire.
267 services.pulseaudio.enable = false;
268 security.rtkit.enable = true;
269 services.pipewire = {
272 alsa.support32Bit = true;
274 # If you want to use JACK applications, uncomment this
277 # use the example session manager (no others are packaged yet so this is enabled by default,
278 # no need to redefine it in your config for now)
279 #media-session.enable = true;
285 # Enable touchpad support (enabled default in most desktopManager).
286 # services.libinput.touchpad = {
287 # naturalScrolling = false;
290 # Define a user account. Don't forget to set a password with ‘passwd’.
291 users.groups.ssh = {};
295 description = "Patrick";
297 extraGroups = [ "networkmanager" "wheel" "dialout" "jackaudio" "lp" "incus-admin" ];
313 initialPassword = "chirp";
317 security.polkit.enable = true;
318 security.sudo.wheelNeedsPassword = false;
321 backupFileExtension = "backup";
327 # "ps" = import ./home.nix;
329 users.ps.imports = [ ./home.nix ];
332 # Enable automatic login for the user.
333 # services.displayManager.autoLogin.enable = true;
334 # services.displayManager.autoLogin.user = "ps";
335 # services.getty.autologinUser = "ps";
337 # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
338 # systemd.services."getty@tty1".enable = false;
339 # systemd.services."autovt@tty1".enable = false;
341 # Allow unfree packages
342 nixpkgs.config.allowUnfree = true;
344 # List packages installed in system profile. To search, run:
346 environment.systemPackages = with pkgs; [
347 args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zig
348 args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zls
349 args.inputs.psch-flakes.packages.${pkgs.system}.resetmsmice
350 vim wget file git kitty i3 gdb
362 xfce.xfce4-pulseaudio-plugin
363 # xfce.xfce4-verve-plugin
364 xfce.xfce4-notes-plugin
365 # xfce.xfce4-timer-plugin
366 # xfce.xfce4-windowck-plugin
367 xfce.thunar-archive-plugin
368 # xfce.xfce4-i3-workspaces-plugin
369 # xfce.xfce4-xkb-plugin
370 xfce.xfce4-whiskermenu-plugin
374 programs.xfconf.enable = true;
375 programs.nix-ld.enable = true;
377 services.fwupd.enable = true;
379 # Some programs need SUID wrappers, can be configured further or are
380 # started in user sessions.
381 # programs.mtr.enable = true;
382 # programs.gnupg.agent = {
384 # enableSSHSupport = true;
387 # List services that you want to enable:
389 # Enable the OpenSSH daemon.
394 PasswordAuthentication = false;
395 PermitRootLogin = "no";
397 authorizedKeysCommand =
398 let keys = pkgs.writers.writePython3Bin "keys" {} ''
407 authorizedKeysCommandUser = "ps";
410 # Open ports in the firewall.
411 networking.firewall.allowedTCPPorts = [ 22 1234 5900 6011 6021 6022 8080 53317 ];
412 networking.firewall.allowedUDPPorts = [ 5901 53317 ];
413 # Or disable the firewall altogether.
414 # networking.firewall.enable = false;
416 # This value determines the NixOS release from which the default
417 # settings for stateful data, like file locations and database versions
418 # on your system were taken. It‘s perfectly fine and recommended to leave
419 # this value at the release version of the first install of this system.
420 # Before changing this value read the documentation for this option
421 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
422 system.stateVersion = "24.05"; # Did you read the comment?