added initial impermanence module
This commit is contained in:
parent
4dc356752f
commit
52d9c5ca91
1 changed files with 41 additions and 0 deletions
41
modules/impermanence/default.nix
Normal file
41
modules/impermanence/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ lib, config, ... }: lib.mkIf config.withImpermanence {
|
||||||
|
environment.persistence."/persist" = {
|
||||||
|
enable = true;
|
||||||
|
directories = [
|
||||||
|
"/var/log"
|
||||||
|
"/var/lib/bluetooth"
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/iwd"
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
"/etc/machine-id"
|
||||||
|
"/etc/passwd"
|
||||||
|
"/etc/shadow"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.${config.username}= {
|
||||||
|
directories = [
|
||||||
|
"Documents"
|
||||||
|
"Pictures"
|
||||||
|
"Videos"
|
||||||
|
"Games"
|
||||||
|
"code"
|
||||||
|
{ directory = ".local/share/keyrings"; mode = "0700"; }
|
||||||
|
".local/share/direnv"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd = {
|
||||||
|
enable = true;
|
||||||
|
supportedFilesystems = [ "btrfs" ];
|
||||||
|
|
||||||
|
systemd.services.restore-boot = {
|
||||||
|
description = "Rollback btrfs rootfs";
|
||||||
|
WantedBy = [ "initrd.target" ];
|
||||||
|
requires = [
|
||||||
|
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue