Add custom impermanence module
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.persistence."/persist".users.${username}.directories = with hmConfig.xdg.userDirs; [
|
||||
relativeDesktop
|
||||
relativeDocuments
|
||||
relativeDownload
|
||||
relativeMusic
|
||||
relativePictures
|
||||
relativeTemplates
|
||||
relativeVideos
|
||||
"VMs"
|
||||
"git"
|
||||
];
|
||||
environment.persistence."/persist" = {
|
||||
"${home}/Desktop" = { };
|
||||
"${home}/Documents" = { };
|
||||
"${home}/Downloads" = { };
|
||||
"${home}/Music" = { };
|
||||
"${home}/Pictures" = { };
|
||||
"${home}/Templates" = { };
|
||||
"${home}/Videos" = { };
|
||||
"${home}/VMs" = { };
|
||||
"${home}/git" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
imports = [ ./options.nix ];
|
||||
home-manager.users.${user} = {
|
||||
imports = [ (import ./options.nix { inherit home; }) ];
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
@@ -34,8 +31,8 @@ in
|
||||
userDirs = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
XDG_VM_DIR = "${userConfig.home}/VMs";
|
||||
XDG_GIT_DIR = "${userConfig.home}/git";
|
||||
XDG_VM_DIR = "${home}/VMs";
|
||||
XDG_GIT_DIR = "${home}/git";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user