1
Fork 0

More zfs setup

This commit is contained in:
Matei Adriel 2023-07-17 18:40:39 +02:00
parent 2ef4253adc
commit 1a76be6710
No known key found for this signature in database
4 changed files with 37 additions and 13 deletions

View file

@ -162,6 +162,12 @@
hostname = "euporie"; hostname = "euporie";
user = "guest"; user = "guest";
}; };
lapetus = nixos {
system = "x86_64-linux";
hostname = "lapetus";
user = "adrielus";
};
}; };
# }}} # }}}
# {{{ Home manager # {{{ Home manager
@ -187,6 +193,10 @@
system = "x86_64-linux"; system = "x86_64-linux";
hostname = "euporie"; hostname = "euporie";
}; };
"adrielus@lapetus" = mkHomeConfig {
system = "x86_64-linux";
hostname = "lapetus";
};
}; };
# }}} # }}}
}; };

View file

@ -7,20 +7,18 @@
inputs.agenix.packages.${pkgs.system}.agenix # Secret encryption inputs.agenix.packages.${pkgs.system}.agenix # Secret encryption
]; ];
satellite = { # Set up my custom imperanence wrapper
# Set up my custom imperanence wrapper satellite.persistence = {
persistence = { enable = true;
enable = true;
# Actual data/media (eg: projects, images, videos, etc) # Actual data/media (eg: projects, images, videos, etc)
at.data.path = "/persist/data"; at.data.path = "/persist/data";
at.data.prefixDirectories = false; at.data.prefixDirectories = false;
# App state I want to keep # App state I want to keep
at.state.path = "/persist/state"; at.state.path = "/persist/state";
# App state which I should be able to delete at any point # App state which I should be able to delete at any point
at.cache.path = "/persist/local/cache"; at.cache.path = "/persist/local/cache";
};
}; };
} }

View file

@ -1,4 +1,4 @@
{ { config, ... }: {
imports = [ imports = [
../common/global ../common/global
../common/users/adrielus.nix ../common/users/adrielus.nix
@ -14,6 +14,20 @@
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11"; system.stateVersion = "22.11";
# Configure ZFS
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.extraPools = [ "zroot" ];
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
# We use non-legacy mountpoints
# See [this wiki link](https://nixos.wiki/wiki/ZFS)
# systemd.services.zfs-mount.enable = false;
# Roll back to blank snapshot on boot
# boot.initrd.postDeviceCommands = lib.mkAfter ''
# zfs rollback -r zroot@blank
# '';
# Boot # Boot
boot.loader.grub = { boot.loader.grub = {
enable = true; enable = true;

View file

@ -39,10 +39,12 @@
zpool = { zpool = {
zroot = { zroot = {
type = "zpool"; type = "zpool";
postCreateHook = '' postCreateHook = ''
zfs snapshot zroot@blank zfs snapshot zroot@blank
zfs set keylocation="prompt" "zroot"; zfs set keylocation="prompt" "zroot";
''; '';
rootFsOptions = { rootFsOptions = {
compression = "lz4"; compression = "lz4";
"com.sun:auto-snapshot" = "false"; "com.sun:auto-snapshot" = "false";