diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-04-11 23:27:56 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-04-11 23:28:18 +0900 |
| commit | 28ebf973d6af4e28c706e90889957a8553125fac (patch) | |
| tree | 8dab91880e2060e34b987b4db01d897f0053b0c5 /nixos.nix | |
| parent | 41aeb404ec303ab7462ab4cf88511ff724b4cf9a (diff) | |
nix: add sharefs supplementary group
This works around vfs inode file attribute race.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'nixos.nix')
| -rw-r--r-- | nixos.nix | 63 |
1 files changed, 29 insertions, 34 deletions
@@ -136,11 +136,12 @@ in conf = { inherit id; - inherit (app) identity groups enablements; + inherit (app) identity enablements; inherit (dbusConfig) session_bus system_bus; direct_wayland = app.insecureWayland; sched_policy = app.schedPolicy; sched_priority = app.schedPriority; + groups = app.groups ++ optional (cfg.sharefs.source != null) cfg.sharefs.group; container = { inherit (app) @@ -357,29 +358,30 @@ in users = mkMerge ( foldlAttrs ( - acc: _: fid: + acc: username: fid: acc - ++ foldlAttrs ( - acc': _: app: - acc' ++ [ { ${getsubname fid app.identity} = getuser fid app.identity; } ] - ) [ { ${getsubname fid 0} = getuser fid 0; } ] cfg.apps - ) - ( - if (cfg.sharefs.source != null) then - [ - { - ${cfg.sharefs.user} = { - uid = lib.mkDefault 1023; - inherit (cfg.sharefs) group; - isSystemUser = true; - home = cfg.sharefs.source; - }; - - } - ] - else - [ ] + ++ + foldlAttrs + ( + acc': _: app: + acc' ++ [ { ${getsubname fid app.identity} = getuser fid app.identity; } ] + ) + [ + { + ${getsubname fid 0} = getuser fid 0; + ${username}.extraGroups = [ cfg.sharefs.group ]; + } + ] + cfg.apps ) + (optional (cfg.sharefs.source != null) { + ${cfg.sharefs.user} = { + uid = lib.mkDefault 1023; + inherit (cfg.sharefs) group; + isSystemUser = true; + home = cfg.sharefs.source; + }; + }) cfg.users ); @@ -393,18 +395,11 @@ in acc' ++ [ { ${getsubname fid app.identity} = getgroup fid app.identity; } ] ) [ { ${getsubname fid 0} = getgroup fid 0; } ] cfg.apps ) - ( - if (cfg.sharefs.source != null) then - [ - { - ${cfg.sharefs.group} = { - gid = lib.mkDefault 1023; - }; - } - ] - else - [ ] - ) + (optional (cfg.sharefs.source != null) { + ${cfg.sharefs.group} = { + gid = lib.mkDefault 1023; + }; + }) cfg.users ); }; |
