From 73de2bfb51619b75978a52c06405222c9f35ecc4 Mon Sep 17 00:00:00 2001 From: Julian Sutter Date: Tue, 3 Feb 2026 22:18:15 -0800 Subject: [PATCH] Fix deprecated NixOS options and migrate to new syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit resolves multiple deprecation warnings and errors that were preventing the NixOS configuration from being built successfully. ## Changes Made ### 1. Git Configuration Options (Home Manager) **Affected Files:** - users/jsutter.nix - users/isutter.nix - users/aksutter.nix **Changes:** - Migrated from deprecated `userName` and `userEmail` options to new `settings.user.name` and `settings.user.email` syntax - Migrated from deprecated `extraConfig` to inline `settings` format - This aligns with Home Manager's new git configuration structure **Before:** ```nix programs.git = { userName = "Julian Sutter"; userEmail = "jsutter@symbiotip.com"; extraConfig = { core.editor = "nano"; }; }; ``` **After:** ```nix programs.git = { settings = { user = { name = "Julian Sutter"; email = "jsutter@symbiotip.com"; }; core.editor = "nano"; }; }; ``` ### 2. Systemd Logind Options **Affected File:** systems/framework.nix **Changes:** - Migrated from deprecated direct options to new nested settings syntax - All logind power management options now use `settings.Login.*` format **Before:** ```nix services.logind = { lidSwitch = "suspend-then-hibernate"; lidSwitchDocked = "ignore"; }; ``` **After:** ```nix services.logind = { settings = { Login = { HandleLidSwitch = "suspend-then-hibernate"; HandleLidSwitchDocked = "ignore"; }; }; }; ``` ### 3. Display Manager Configuration **Affected File:** desktop/plasma.nix **Changes:** - Removed deprecated `services.xserver.displayManager.gdm.enable` - Configuration now uses `services.displayManager.gdm.enable` exclusively - Added explanatory comment about the deprecation removal ### 4. Package Deprecations **Affected Files:** - users/aksutter.nix - users/isutter.nix **Changes:** - Replaced deprecated `pinentry` package with `pinentry-gnome3` - The generic `pinentry` package has been split into specific variants - `pinentry-gnome3` was already in use elsewhere in plasma.nix ### 5. NixOS System Parameter **Affected File:** flake.nix **Changes:** - Updated system parameter handling to address deprecation warning - Changed from `inherit system` to `inherit (localSystem) system` - Renamed `system` variable to `localSystem` with explicit system attribute **Before:** ```nix let system = "x86_64-linux"; commonSpecialArgs = { pkgs-unstable = import nixpkgs-unstable { inherit system; ``` **After:** ```nix let localSystem = { system = "x86_64-linux"; }; commonSpecialArgs = { pkgs-unstable = import nixpkgs-unstable { inherit (localSystem) system; ``` ## Verification ### Build Status ✅ All three system configurations build successfully: - framework - aurora - labrizor ### Flake Check Results ✅ `nix flake check` passes without errors ✅ Only remaining warning is from external flake-utils dependency in octofriend subflake, which does not affect functionality ### Framework Build Results ✅ `sudo nixos-rebuild build --flake .#framework` completed successfully ✅ New configuration path: /nix/store/6wci3m6qnzphw75b0j7lmx1gjqphry3n-nixos-system-framework-25.11.20260203.e576e3c ## Impact ### User Impact - Git configuration behavior remains unchanged - Logind power management behavior unchanged - Login/logout experience identical - No functional changes to user experience ### System Impact - All configurations now use modern NixOS 25.11 syntax - Future-proofed against upcoming deprecation removals - Maintains consistency across all managed systems ## Testing Recommendations Before deploying to production: 1. Test on non-critical systems first (labrizor) 2. Verify all services start correctly after switch 3. Confirm user git configurations work as expected 4. Test lid switch behavior on framework laptop 5. Verify GPG pinentry prompts work correctly ## Related NixOS Documentation - Home Manager git options: https://nix-community.github.io/home-manager/options.xhtml#opt-programs.git.enable - Systemd logind settings: https://search.nixos.org/options?query=services.logind - NixOS 25.11 release notes for deprecation details --- desktop/plasma.nix | 9 +++------ flake.nix | 8 +++++--- systems/framework.nix | 14 +++++++++----- users/aksutter.nix | 14 ++++++++------ users/isutter.nix | 14 ++++++++------ users/jsutter.nix | 12 +++++++----- 6 files changed, 40 insertions(+), 31 deletions(-) diff --git a/desktop/plasma.nix b/desktop/plasma.nix index 12b2c0e..8eabc20 100644 --- a/desktop/plasma.nix +++ b/desktop/plasma.nix @@ -4,10 +4,7 @@ services.xserver.enable = true; # Use GDM because SDDM and LightDM suck. - services.xserver.displayManager = { - gdm.enable = true; - lightdm.enable = false; - }; + # Deprecated services.xserver.displayManager removed - using services.displayManager below services.displayManager.gdm.enable = true; services.displayManager.sddm.enable = false; @@ -17,7 +14,7 @@ programs.dconf.enable = true; programs.kdeconnect.enable = true; hardware.bluetooth.enable = true; - + environment.systemPackages = with pkgs; [ kdePackages.spectacle arc-theme # Desktop theme @@ -26,7 +23,7 @@ firefox # Web browser ]; - # GNUPG Stuff + # GNUPG Stuff services.pcscd.enable = true; programs.gnupg.agent = { enable = true; diff --git a/flake.nix b/flake.nix index cc1eceb..c010bf8 100644 --- a/flake.nix +++ b/flake.nix @@ -22,12 +22,14 @@ outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, home-manager, plasma-manager, octofriend }: let - system = "x86_64-linux"; + localSystem = { + system = "x86_64-linux"; + }; commonSpecialArgs = { pkgs-unstable = import nixpkgs-unstable { - inherit system; + inherit (localSystem) system; config.allowUnfree = true; }; @@ -35,7 +37,7 @@ }; mkSystem = { modules, hardware ? [] }: nixpkgs.lib.nixosSystem { - inherit system; + inherit (localSystem) system; specialArgs = commonSpecialArgs; modules = [ home-manager.nixosModules.home-manager diff --git a/systems/framework.nix b/systems/framework.nix index 0c498f3..95c6ccb 100644 --- a/systems/framework.nix +++ b/systems/framework.nix @@ -47,11 +47,15 @@ # Logind lid-switch configuration services.logind = { - lidSwitch = "suspend-then-hibernate"; - lidSwitchDocked = "ignore"; # Prevent suspend when connected to a dock - lidSwitchExternalPower = "ignore"; - powerKey = "poweroff"; - suspendKey = "ignore"; # Optional: configure behavior for the suspend key + settings = { + Login = { + HandleLidSwitch = "suspend-then-hibernate"; + HandleLidSwitchDocked = "ignore"; # Prevent suspend when connected to a dock + HandleLidSwitchExternalPower = "ignore"; + HandlePowerKey = "poweroff"; + HandleSuspendKey = "ignore"; # Optional: configure behavior for the suspend key + }; + }; }; environment.systemPackages = with pkgs; [ diff --git a/users/aksutter.nix b/users/aksutter.nix index 930b86f..7342a6a 100644 --- a/users/aksutter.nix +++ b/users/aksutter.nix @@ -12,7 +12,7 @@ git nextcloud-client vlc - pinentry + pinentry-gnome3 arc-theme zoom-us libreoffice-qt @@ -40,9 +40,11 @@ programs.git = { enable = true; - userName = "Akalia Sutter"; - userEmail = "aksutter@symbiotip.com"; - extraConfig = { + settings = { + user = { + name = "Akalia Sutter"; + email = "aksutter@symbiotip.com"; + }; core.editor = "nano"; credential.helper = "cache"; }; @@ -63,7 +65,7 @@ jnoortheen.nix-ide ]; }; - + programs.firefox = { enable = true; package = pkgs.wrapFirefox pkgs.firefox-unwrapped { @@ -89,7 +91,7 @@ SkipOnboarding = true; }; }; - }; + }; profiles = { aksutter = { id = 0; diff --git a/users/isutter.nix b/users/isutter.nix index eb4998d..4c3d3dc 100644 --- a/users/isutter.nix +++ b/users/isutter.nix @@ -12,7 +12,7 @@ git nextcloud-client vlc - pinentry + pinentry-gnome3 arc-theme zoom-us libreoffice-qt @@ -40,9 +40,11 @@ programs.git = { enable = true; - userName = "Isis Sutter"; - userEmail = "isutter@symbiotip.com"; - extraConfig = { + settings = { + user = { + name = "Isis Sutter"; + email = "isutter@symbiotip.com"; + }; core.editor = "nano"; credential.helper = "cache"; }; @@ -63,7 +65,7 @@ jnoortheen.nix-ide ]; }; - + programs.firefox = { enable = true; package = pkgs.wrapFirefox pkgs.firefox-unwrapped { @@ -89,7 +91,7 @@ SkipOnboarding = true; }; }; - }; + }; profiles = { isutter = { id = 0; diff --git a/users/jsutter.nix b/users/jsutter.nix index add2457..a7a1f8b 100644 --- a/users/jsutter.nix +++ b/users/jsutter.nix @@ -39,9 +39,11 @@ programs.git = { enable = true; - userName = "Julian Sutter"; - userEmail = "jsutter@symbiotip.com"; - extraConfig = { + settings = { + user = { + name = "Julian Sutter"; + email = "jsutter@symbiotip.com"; + }; core.editor = "nano"; credential.helper = "store"; init.defaultBranch = "main"; @@ -136,7 +138,7 @@ theme = "terminalparty"; }; }; - + programs.lsd = { enable = true; }; @@ -168,7 +170,7 @@ SkipOnboarding = true; }; }; - }; + }; profiles = { jsutter = { id = 0;