Changes
8 changed files (+297/-221)
-
-
@@ -2,7 +2,6 @@config, lib, pkgs, pkgs-old, ... }:
-
@@ -12,179 +11,7 @@./hardware-configuration.nix ]; hardware = { # Auto screen rotation in tablet mode sensor.iio.enable = true; # VA-API graphics.extraPackages = with pkgs; [ intel-media-driver ]; }; boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; networking = { # TODO: Make KDE Connect use Wi-Fi interface instead of Ethernet hostName = "ThinkPad-X1-Yoga-Gen-6"; networkmanager.enable = true; }; programs = { firefox = { enable = true; preferences = { # Screw you useless Firefox AI garbage "browser.ml.chat.menu" = false; # INFINITE HISTORY "places.history.expiration.max_pages" = 2147483647; "widget.use-xdg-desktop-portal.file-picker" = 1; }; }; # Disable Akonadi and other evil things # KMail can and will hurt you kde-pim.enable = false; kdeconnect.enable = true; # I'm lazy # gitui is kinda buggy so use lazygit instead lazygit.enable = true; # So I can use my computer like a normal person nix-ld.enable = true; ssh = { # Use KWallet to store SSH password enableAskPassword = true; startAgent = true; }; thunderbird = { enable = true; preferences."widget.use-xdg-desktop-portal.file-picker" = 1; }; }; # Enable Podman because I'm weak and need my Ubuntu help I need it I really need it virtualisation.podman.enable = true; environment = { systemPackages = with pkgs; [ # Math and programming # For installing Lean beta versions # Also, lean4 from nixpkgs is often outdated and doesn't work with the mathlib binary cache # TODO: Updating gcc breaks toolchains elan # For Lean FFI stuff gcc # Unfortunately python3 # WolframAlpha at home # Don't try to build sage-tests if missing from cache.nixos.org # A bit questionable since that means some Sage test is failing but whatever (sage.override { requireSageTests = false; }) # 100x faster than pip! uv # Patch for XDG support # https://discourse.nixos.org/t/can-i-install-vscodium-and-tweak-its-product-json/54481/3 (vscodium.overrideAttrs (old: { postInstall = (old.postInstall or "") + '' substituteInPlace $out/lib/vscode/resources/app/product.json --replace-fail .vscode-oss .local/share/VSCodium ''; })) # Apps deja-dup kdePackages.neochat kdePackages.plasma-keyboard kdePackages.tokodon keepassxc kile # TODO: Wait for the Krita 6 PR to be merged # https://github.com/NixOS/nixpkgs/pull/487214 # krita (mpv.override { scripts = with pkgs.mpvScripts; [ mpris visualizer ]; }) # TODO: Rnote in nixos-unstable is broken due to gtk4 # I could replace only gtk4 in the buildInputs which would shrink the closure, but that requires compiling Rnote # https://github.com/flxzt/rnote/issues/1543 pkgs-old.rnote signal-desktop # Utilities and other random junk ffmpeg fusee-nano hugo hunspellDicts.en-us-large imagemagick ripgrep sqlite # Compared to texliveBasic, this includes some useful packages like setspace and subfigure texliveSmall tlrc typst typstyle ]; variables = { # Lean toolchains are huge so put them outside of ~ so they don't end up in backups or snapshots ELAN_HOME = "/opt/elan"; # Make Electron apps use Wayland # This seems necessary for VSCodium in particular NIXOS_OZONE_WL = "1"; # For LuaLaTeX TEXMFVAR = "$HOME/.cache/texmf-var"; # Make VSCodium use XDG VSCODE_CLI_DATA_DIR = "$HOME/.local/share/VSCodium"; }; }; fonts = { # The default CJK font (Unifont) looks atrocious packages = with pkgs; [ wqy_microhei ]; # Fix broken emojis in fcitx5 and other places # https://github.com/NixOS/nixpkgs/issues/336989 # https://discourse.nixos.org/t/firefox-doesnt-render-noto-color-emojis/51202 # Ugh why do I still have to deal with font problems in this day and age? fontconfig.useEmbeddedBitmaps = true; # TODO: CJK fonts in Electron apps are broken # https://github.com/NixOS/nixpkgs/issues/463615 }; i18n.inputMethod = { enable = true; type = "fcitx5"; fcitx5 = { addons = with pkgs; [ qt6Packages.fcitx5-chinese-addons ]; waylandFrontend = true; }; }; # KDE! YAY! services.desktopManager.plasma6 = { enable = true; # Save some disk space enableQt5Integration = false; }; # PLM services.displayManager = { autoLogin.user = "a"; plasma-login-manager.enable = true; }; # Give PLM permission to read LUKS password for autologin systemd.services.plasmalogin.serviceConfig.KeyringMode = "inherit"; # PAM is evil dark magic # The default /etc/pam.d/plasmalogin-autologin doesn't invoke auth pam_kwallet5.so # Thus we need to manually do it with auth include sddm security.pam.services.plasmalogin-autologin.text = pkgs.lib.mkBefore '' auth optional ${pkgs.systemd}/lib/security/pam_systemd_loadkey.so auth include plasmalogin ''; # My hardware is pretty well supported wow what a surprise services.fwupd.enable = true; networking.hostName = "ThinkPad-X1-Yoga-Gen-6"; # Fingerprint authentication services.fprintd.enable = true;
-
@@ -199,46 +26,4 @@before = [ "sleep.target" ]; serviceConfig.ExecStart = "${pkgs.killall}/bin/killall fprintd"; }; # Back up local /home and Unnamed-Server's /srv using btrfs snapshots and btrbk services.btrbk.instances.btrbk.settings.volume = { "/".subvolume = "/home"; "ssh://unnamed.website/" = { ssh_user = "btrbk"; subvolume = "srv"; snapshot_dir = "/.snapshots"; snapshot_preserve_min = "all"; snapshot_create = "no"; target = "/.snapshots"; target_preserve = "3d 3w 3m *y"; target_preserve_min = "latest"; send_compressed_data = "yes"; }; }; systemd.services.btrbk-btrbk.serviceConfig = { # Wait for internet connectivity if we just booted up # network-online.target only waits for nm-online -s -q which doesn't necessarily mean the network is up ExecStartPre = "${pkgs.networkmanager}/bin/nm-online -q"; # Make /.snapshots/srv point to latest ExecStartPost = # + makes this run as root instead of the btrbk user "+" + pkgs.writers.writeFish "symlink-latest-srv" '' cd /.snapshots ln -snf (ls | grep srv | tail -n1) srv ''; }; systemd.user.services.switch-virtual-keyboard = { wantedBy = [ "default.target" ]; path = with pkgs; [ kdePackages.kconfig ]; serviceConfig.ExecStart = pkgs.writers.writeFish "switch-virtual-keyboard" ./switch-virtual-keyboard.fish; }; # Add SSH key to agent during desktop login systemd.user.services.ssh-add = { wantedBy = [ "graphical-session.target" ]; after = [ "plasma-kwallet-pam.service" ]; serviceConfig.ExecStart = "${pkgs.openssh}/bin/ssh-add"; }; }
-
-
-
@@ -0,0 +1,15 @@{ config, lib, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; networking.hostName = "ThinkPad-Yoga-14"; }
-
-
-
@@ -0,0 +1,48 @@# 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 = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/mapper/root"; fsType = "btrfs"; }; boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/7fc85a5d-d3ee-4e44-ae3d-f4e6f055b22d"; fileSystems."/boot" = { device = "/dev/disk/by-uuid/C2EA-940E"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }
-
-
-
@@ -45,7 +45,6 @@"/".mountpoint = "/"; "/home" = { }; "/nix" = { }; "/.snapshots" = { }; }; }; };
-
-
-
@@ -23,11 +23,11 @@}, "nixpkgs": { "locked": { "lastModified": 1772963539, "narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=", "lastModified": 1773821835, "narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=", "owner": "NixOS", "repo": "nixpkgs", "rev": "9dcb002ca1690658be4a04645215baea8b95f31d", "rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0", "type": "github" }, "original": {
-
-
-
@@ -19,14 +19,23 @@in { nixosConfigurations = { # Very creative name, I know # Very creative names, I know ThinkPad-X1-Yoga-Gen-6 = nixpkgs.lib.nixosSystem { specialArgs.pkgs-old = import inputs.nixpkgs-old { inherit system; }; modules = [ ./configuration.nix ./laptop.nix ./ThinkPad-X1-Yoga-Gen-6 ]; }; ThinkPad-Yoga-14 = nixpkgs.lib.nixosSystem { specialArgs.pkgs-old = import inputs.nixpkgs-old { inherit system; }; modules = [ ./configuration.nix ./laptop.nix ./ThinkPad-Yoga-14 ]; }; # I ran out of name ideas sorry Unnamed-Server = nixpkgs.lib.nixosSystem { modules = [
-
-
laptop.nix (new)
-
@@ -0,0 +1,220 @@{ config, lib, pkgs, pkgs-old, ... }: { hardware = { # Auto screen rotation in tablet mode sensor.iio.enable = true; # VA-API graphics.extraPackages = with pkgs; [ intel-media-driver ]; }; boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; # TODO: Make KDE Connect use Wi-Fi interface instead of Ethernet networking.networkmanager.enable = true; programs = { firefox = { enable = true; preferences = { # Screw you useless Firefox AI garbage "browser.ml.chat.menu" = false; # INFINITE HISTORY "places.history.expiration.max_pages" = 2147483647; "widget.use-xdg-desktop-portal.file-picker" = 1; }; }; # Disable Akonadi and other evil things # KMail can and will hurt you kde-pim.enable = false; kdeconnect.enable = true; # I'm lazy # gitui is kinda buggy so use lazygit instead lazygit.enable = true; # So I can use my computer like a normal person nix-ld.enable = true; ssh = { # Use KWallet to store SSH password enableAskPassword = true; startAgent = true; }; thunderbird = { enable = true; preferences."widget.use-xdg-desktop-portal.file-picker" = 1; }; }; # Enable Podman because I'm weak and need my Ubuntu help I need it I really need it virtualisation.podman.enable = true; environment = { systemPackages = with pkgs; [ # Math and programming # For installing Lean beta versions # Also, lean4 from nixpkgs is often outdated and doesn't work with the mathlib binary cache # TODO: Updating gcc breaks toolchains elan # For Lean FFI stuff gcc # Unfortunately python3 # WolframAlpha at home # Don't try to build sage-tests if missing from cache.nixos.org # A bit questionable since that means some Sage test is failing but whatever #(sage.override { # requireSageTests = false; #}) # 100x faster than pip! uv # Patch for XDG support # https://discourse.nixos.org/t/can-i-install-vscodium-and-tweak-its-product-json/54481/3 (vscodium.overrideAttrs (old: { postInstall = (old.postInstall or "") + '' substituteInPlace $out/lib/vscode/resources/app/product.json --replace-fail .vscode-oss .local/share/VSCodium ''; })) # Apps deja-dup kdePackages.neochat kdePackages.plasma-keyboard kdePackages.tokodon keepassxc kile # TODO: Wait for the Krita 6 PR to be merged # https://github.com/NixOS/nixpkgs/pull/487214 # krita (mpv.override { scripts = with pkgs.mpvScripts; [ mpris visualizer ]; }) # TODO: Rnote in nixos-unstable is broken due to gtk4 # I could replace only gtk4 in the buildInputs which would shrink the closure, but that requires compiling Rnote # https://github.com/flxzt/rnote/issues/1543 pkgs-old.rnote signal-desktop # Utilities and other random junk ffmpeg fusee-nano hugo hunspellDicts.en-us-large imagemagick ripgrep sqlite # Compared to texliveBasic, this includes some useful packages like setspace and subfigure texliveSmall tlrc typst typstyle ]; variables = { # Lean toolchains are huge so put them outside of ~ so they don't end up in backups or snapshots ELAN_HOME = "/opt/elan"; # Make Electron apps use Wayland # This seems necessary for VSCodium in particular NIXOS_OZONE_WL = "1"; # For LuaLaTeX TEXMFVAR = "$HOME/.cache/texmf-var"; # Make VSCodium use XDG VSCODE_CLI_DATA_DIR = "$HOME/.local/share/VSCodium"; }; }; fonts = { # The default CJK font (Unifont) looks atrocious packages = with pkgs; [ wqy_microhei ]; # Fix broken emojis in fcitx5 and other places # https://github.com/NixOS/nixpkgs/issues/336989 # https://discourse.nixos.org/t/firefox-doesnt-render-noto-color-emojis/51202 # Ugh why do I still have to deal with font problems in this day and age? fontconfig.useEmbeddedBitmaps = true; }; i18n.inputMethod = { enable = true; type = "fcitx5"; fcitx5 = { addons = with pkgs; [ qt6Packages.fcitx5-chinese-addons ]; waylandFrontend = true; }; }; # KDE! YAY! services.desktopManager.plasma6 = { enable = true; # Save some disk space enableQt5Integration = false; }; # PLM services.displayManager = { autoLogin.user = "a"; plasma-login-manager.enable = true; }; # Give PLM permission to read LUKS password for autologin systemd.services.plasmalogin.serviceConfig.KeyringMode = "inherit"; # PAM is evil dark magic # The default /etc/pam.d/plasmalogin-autologin doesn't invoke auth pam_kwallet5.so # Thus we need to manually do it with auth include sddm security.pam.services.plasmalogin-autologin.text = pkgs.lib.mkBefore '' auth optional ${pkgs.systemd}/lib/security/pam_systemd_loadkey.so auth include plasmalogin ''; # My hardware is pretty well supported wow what a surprise services.fwupd.enable = true; # Back up local /home and Unnamed-Server's /srv using btrfs snapshots and btrbk services.btrbk.instances.btrbk.settings.volume = { "/".subvolume = "/home"; "ssh://unnamed.website/" = { ssh_user = "btrbk"; subvolume = "srv"; snapshot_dir = "/.snapshots"; snapshot_preserve_min = "all"; snapshot_create = "no"; target = "/.snapshots"; target_preserve = "3d 3w 3m *y"; target_preserve_min = "latest"; send_compressed_data = "yes"; }; }; systemd.services.btrbk-btrbk.serviceConfig = { # Wait for internet connectivity if we just booted up # network-online.target only waits for nm-online -s -q which doesn't necessarily mean the network is up ExecStartPre = "${pkgs.networkmanager}/bin/nm-online -q"; # Make /.snapshots/srv point to latest ExecStartPost = # + makes this run as root instead of the btrbk user "+" + pkgs.writers.writeFish "symlink-latest-srv" '' cd /.snapshots ln -snf (ls | grep srv | tail -n1) srv ''; }; systemd.user.services.switch-virtual-keyboard = { wantedBy = [ "default.target" ]; path = with pkgs; [ kdePackages.kconfig ]; serviceConfig.ExecStart = pkgs.writers.writeFish "switch-virtual-keyboard" ./switch-virtual-keyboard.fish; }; # Add SSH key to agent during desktop login systemd.user.services.ssh-add = { wantedBy = [ "graphical-session.target" ]; after = [ "plasma-kwallet-pam.service" ]; serviceConfig.ExecStart = "${pkgs.openssh}/bin/ssh-add"; }; }
-
-