mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
changed zfs mountpoints more, setup self cleaning fs root
This commit is contained in:
parent
2cf332631b
commit
01851cab86
4 changed files with 28 additions and 15 deletions
|
|
@ -12,6 +12,7 @@ inputs: {
|
|||
(import ./spicetify.nix inputs)
|
||||
(import ./zfs.nix inputs)
|
||||
(import ./containers inputs)
|
||||
(import ./erase-your-darlings.nix inputs)
|
||||
];
|
||||
|
||||
disko.devices = import ./disko.nix;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ _: {
|
|||
normalization = "formD";
|
||||
relatime = "on";
|
||||
xattr = "sa";
|
||||
canmount = "off";
|
||||
encryption = "on";
|
||||
keyformat = "passphrase";
|
||||
keylocation = "prompt";
|
||||
|
|
@ -141,32 +140,30 @@ _: {
|
|||
ashift = "12";
|
||||
autotrim = "on";
|
||||
};
|
||||
|
||||
datasets = {
|
||||
"root" = {
|
||||
zfs_type = "filesystem";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/";
|
||||
};
|
||||
"root/nix" = {
|
||||
"nix" = {
|
||||
zfs_type = "filesystem";
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
"root/var" = {
|
||||
"var" = {
|
||||
zfs_type = "filesystem";
|
||||
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/var";
|
||||
};
|
||||
"root/persist" = {
|
||||
"persist" = {
|
||||
zfs_type = "filesystem";
|
||||
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
"root/home" = {
|
||||
"home" = {
|
||||
zfs_type = "filesystem";
|
||||
|
||||
options.mountpoint = "legacy";
|
||||
mountpoint = "/home";
|
||||
};
|
||||
|
|
|
|||
18
systems/gerg-desktop/erase-your-darlings.nix
Normal file
18
systems/gerg-desktop/erase-your-darlings.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
_: {lib, ...}: {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /mnt - - - - -"
|
||||
"L+ /etc/ssh/ssh_host_ed25519_key - - - - /persist/ssh/ssh_host_ed25519_key"
|
||||
"L+ /etc/ssh/ssh_host_ed25519_key.pub - - - - /persist/ssh/ssh_host_ed25519_key.pub"
|
||||
"L+ /etc/nixos - - - - /persist/nixos"
|
||||
];
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
zfs snapshot destroy rpool/root@prev
|
||||
zfs snapshot destroy rpool/var@prev
|
||||
|
||||
zfs snapshot create rpool/root@prev
|
||||
zfs snapshot create rpool/var@prev
|
||||
|
||||
zfs rollback -r rpool/root@empty
|
||||
zfs rollback -r rpool/var@empty
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue