From 00f23f4b9cb384a27c1fbb4e0a7c5495c17798d7 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:58:18 +0000 Subject: [PATCH] create shared group for all server services to manage all files --- modules/nixos/system/default.nix | 1 + modules/nixos/system/shared.nix | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 modules/nixos/system/shared.nix diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index c35f4a9..8cd5773 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -10,6 +10,7 @@ ./auto-upgrade.nix ./doas.nix ./journald.nix + ./shared.nix ./user.nix ./timezone.nix ]; diff --git a/modules/nixos/system/shared.nix b/modules/nixos/system/shared.nix new file mode 100644 index 0000000..89e9c00 --- /dev/null +++ b/modules/nixos/system/shared.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: +{ + + config = lib.mkIf config.server { + + # Create a shared group for many services + users.groups.shared = { }; + + # Give the human user access to the shared group + users.users.${config.user}.extraGroups = [ config.users.groups.shared.name ]; + + }; + +}