I tried going all in on dendritic, but I think I'm gonna go for a lighter approach
This commit is contained in:
parent
a4698d2a62
commit
1a586c2d90
97 changed files with 240 additions and 3899 deletions
54
modules/nix/impermanence.nix
Normal file
54
modules/nix/impermanence.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
flake-file.inputs = {
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
};
|
||||
|
||||
# convenience function to set persistence settings only, if impermanence module was imported
|
||||
flake.lib = {
|
||||
mkIfPersistence =
|
||||
config: settings:
|
||||
if config ? home then
|
||||
(if config.home ? persistence then settings else { })
|
||||
else
|
||||
(if config.environment ? persistence then settings else { });
|
||||
};
|
||||
|
||||
flake.modules.nixos.impermanence =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
];
|
||||
|
||||
environment.persistence."/persistent" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/var/log"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
];
|
||||
};
|
||||
|
||||
# home-manager.sharedModules = [
|
||||
# {
|
||||
# home.persistence."/persistent" = {
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
|
||||
fileSystems."/persistent".neededForBoot = true;
|
||||
|
||||
programs.fuse.userAllowOther = true;
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue