From 532b380a6da7579443f07722b6770d8b44fb8086 Mon Sep 17 00:00:00 2001 From: Frank LoTurco Date: Thu, 22 Oct 2026 11:30:00 -0400 Subject: [PATCH] refactor: break out user definitions and disable mutability. Also fix a couple evaluation warnings --- features/users.nix | 16 ++++++++++++++++ flake.nix | 1 - hosts/shared/nixos-pc.nix | 15 +-------------- hosts/shared/nixos-server.nix | 12 +----------- 4 files changed, 18 insertions(+), 26 deletions(-) create mode 100644 features/users.nix diff --git a/features/users.nix b/features/users.nix new file mode 100644 index 0000000..031cdb7 --- /dev/null +++ b/features/users.nix @@ -0,0 +1,16 @@ +{ config, ... }: +{ + users = { + mutableUsers = false; + + users.frank = { + isNormalUser = true; + description = "Frank LoTurco"; + hashedPasswordFile = config.sops.secrets.password_hash.path; + + extraGroups = [ + "wheel" + ]; + }; + }; +} diff --git a/flake.nix b/flake.nix index d89d18e..978c72c 100644 --- a/flake.nix +++ b/flake.nix @@ -48,7 +48,6 @@ nix-flatpak = { url = "github:gmodena/nix-flatpak/?ref=latest"; - inputs.nixpkgs.follows = "nixpkgs"; }; appimage-manager = { diff --git a/hosts/shared/nixos-pc.nix b/hosts/shared/nixos-pc.nix index 2925bbe..5b63f88 100644 --- a/hosts/shared/nixos-pc.nix +++ b/hosts/shared/nixos-pc.nix @@ -16,6 +16,7 @@ ../../features/i18n.nix ../../features/sudo.nix ../../features/sops.nix + ../../features/users.nix ./nix-package-manager.nix ]; @@ -169,20 +170,6 @@ }; }; - users.users.frank = { - isNormalUser = true; - description = "Frank LoTurco"; - hashedPassword = config.sops.secrets.password_hash.path; - - extraGroups = [ - "networkmanager" - "wheel" - "input" - "video" - "uinput" - ]; - }; - nixpkgs = { # Fix msitools compiling and failing it's test-suite. overlays = [ diff --git a/hosts/shared/nixos-server.nix b/hosts/shared/nixos-server.nix index d1de3cf..5ae4f29 100644 --- a/hosts/shared/nixos-server.nix +++ b/hosts/shared/nixos-server.nix @@ -14,6 +14,7 @@ ../../features/i18n.nix ../../features/sudo.nix ../../features/sops.nix + ../../features/users.nix ./nix-package-manager.nix ]; @@ -73,17 +74,6 @@ }; }; - users.users.frank = { - isNormalUser = true; - description = "Frank LoTurco"; - hashedPassword = config.sops.secrets.password_hash.path; - - extraGroups = [ - "wheel" - "libvirtd" - ]; - }; - environment = { systemPackages = import ../../features/common-pkgs.nix { inherit pkgs; }