home(app): isolate app user configuration
This commit is contained in:
parent
80394aa2e1
commit
964bfef6bc
3 changed files with 38 additions and 21 deletions
27
home/app/nixos.nix
Normal file
27
home/app/nixos.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }: with lib; let
|
||||
cfg = config.users;
|
||||
in {
|
||||
options.users.home.persistApp = {
|
||||
files = mkOption {
|
||||
type = with types; listOf (oneOf [ str (attrsOf str) ]);
|
||||
default = [ ];
|
||||
};
|
||||
directories = mkOption {
|
||||
type = with types; listOf (oneOf [ str (attrsOf str) ]);
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.profiles.app = {
|
||||
uid = 5800;
|
||||
description = "Insecure Applications";
|
||||
};
|
||||
|
||||
# extra persistence specific to the app user
|
||||
environment.persistence."/nix/persist".users.app = cfg.home.persistApp;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue