feat(persist): conditionally persist home on linux only
This commit is contained in:
parent
331ab6a448
commit
26e21a4edd
1 changed files with 8 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (config.flake.lib.options) mkStrOption;
|
inherit (config.flake.lib.options) mkStrOption;
|
||||||
inherit (lib.types)
|
inherit (lib.types)
|
||||||
|
@ -49,15 +50,17 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
flake.modules.homeManager.default =
|
flake.modules.homeManager.default =
|
||||||
{ config, ... }:
|
{ config, osConfig, ... }:
|
||||||
{
|
{
|
||||||
imports = [ inputs.impermanence.homeManagerModules.impermanence ];
|
imports = [ inputs.impermanence.homeManagerModules.impermanence ];
|
||||||
options.persistDirs = mkOpts "directory" { };
|
options.persistDirs = mkOpts "directory" { };
|
||||||
options.persistFiles = mkOpts "file" { };
|
options.persistFiles = mkOpts "file" { };
|
||||||
config.home.persistence."/persist${config.home.homeDirectory}" = {
|
config = mkIf (osConfig.nixpkgs.hostPlatform == "x86_64-linux") {
|
||||||
|
home.persistence."/persist${config.home.homeDirectory}" = {
|
||||||
allowOther = true;
|
allowOther = true;
|
||||||
directories = config.persistDirs;
|
directories = config.persistDirs;
|
||||||
files = config.persistFiles;
|
files = config.persistFiles;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue