From 9b3d9993f41da6afcdf11e19311d1222372ad254 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 14 Dec 2025 13:13:54 +0100 Subject: [PATCH] profiles/desktop: Give desktop users special permisions for networkmanager --- hosts/krypton/configuration.nix | 4 ++++ profiles/desktop/default.nix | 5 +++++ profiles/desktop/networking.nix | 10 ++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hosts/krypton/configuration.nix b/hosts/krypton/configuration.nix index 7e56bbd..fd3341e 100644 --- a/hosts/krypton/configuration.nix +++ b/hosts/krypton/configuration.nix @@ -13,6 +13,10 @@ ]; profiles.clerie.desktop.enable = true; + profiles.clerie.desktop.users = [ + "clerie" + ]; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; diff --git a/profiles/desktop/default.nix b/profiles/desktop/default.nix index d5a99c6..4420212 100644 --- a/profiles/desktop/default.nix +++ b/profiles/desktop/default.nix @@ -6,6 +6,11 @@ with lib; options.profiles.clerie.desktop = { enable = mkEnableOption "clerie Desktop Config"; + users = mkOption { + type = with types; listOf str; + default = []; + description = "Names of users that are considered desktop users and therefore get special permissions"; + }; }; imports = [ diff --git a/profiles/desktop/networking.nix b/profiles/desktop/networking.nix index 2af95f5..540dff8 100644 --- a/profiles/desktop/networking.nix +++ b/profiles/desktop/networking.nix @@ -2,9 +2,13 @@ with lib; -{ +let - config = mkIf config.profiles.clerie.desktop.enable { + cfg = config.profiles.clerie.desktop; + +in { + + config = mkIf cfg.enable { networking.networkmanager.settings = { connectivity = { @@ -15,6 +19,8 @@ with lib; }; }; + users.groups.networkmanager.members = cfg.users; + }; }