Skip to content

Commit

Permalink
profile: no extra user groups on server
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Minář <[email protected]>
  • Loading branch information
michojel committed Oct 20, 2024
1 parent 4be790d commit 52779fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
5 changes: 4 additions & 1 deletion common/docker.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ config, lib, pkgs, ... }:

let
cfg = config.profile;
in
{
virtualisation.docker = {
autoPrune.enable = true;
Expand All @@ -14,7 +17,7 @@
];

users.users."${config.local.username}" = {
extraGroups = pkgs.lib.mkAfter [ "docker" ];
extraGroups = pkgs.lib.optional (!cfg.server.enable) (pkgs.lib.mkAfter [ "docker" ]);
};

environment.etc."docker/daemon.json" = {
Expand Down
35 changes: 19 additions & 16 deletions common/profile.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,25 @@ in
"${cfgLocal.username}" = {
isNormalUser = true;
uid = 1000;
extraGroups = lib.mkAfter [
"audio"
"cdrom"
"docker"
"fuse"
"i2c"
"jackaudio"
"libvirtd"
"networkmanager"
"openrazer"
"plugdev"
"utmp"
"vboxusers"
"video"
"wheel"
];
extraGroups = lib.mkAfter
([
"fuse"
"wheel"
]
++ (lib.optional (!cfg.server.enable) [
"audio"
"cdrom"
"docker"
"i2c"
"jackaudio"
"libvirtd"
"networkmanager"
"openrazer"
"plugdev"
"utmp"
"vboxusers"
"video"
]));
shell = pkgs.bashInteractive;
};
};
Expand Down

0 comments on commit 52779fc

Please sign in to comment.