From 9ddd59eac8eab6b233372117cb36c7d2618b905a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 14 Dec 2023 11:08:15 +0000 Subject: [PATCH] nixos: system: add polkit One nice thing is that it enables the prompts when using `systemctl`, instead of requiring `sudo`. --- modules/nixos/system/default.nix | 1 + modules/nixos/system/polkit/default.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 modules/nixos/system/polkit/default.nix diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index e7a4dd3..e6fb25b 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -10,6 +10,7 @@ ./nix ./packages ./podman + ./polkit ./printing ./users ]; diff --git a/modules/nixos/system/polkit/default.nix b/modules/nixos/system/polkit/default.nix new file mode 100644 index 0000000..1e5b573 --- /dev/null +++ b/modules/nixos/system/polkit/default.nix @@ -0,0 +1,16 @@ +# Polkit settings +{ config, lib, ... }: +let + cfg = config.my.system.polkit; +in +{ + options.my.system.polkit = with lib; { + enable = my.mkDisableOption "polkit configuration"; + }; + + config = lib.mkIf cfg.enable { + security.polkit = { + enable = true; + }; + }; +}