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";
user = "guest";
};
lapetus = nixos {
system = "x86_64-linux";
hostname = "lapetus";
user = "adrielus";
};
};
# }}}
# {{{ Home manager
@ -187,6 +193,10 @@
system = "x86_64-linux";
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
];
satellite = {
# Set up my custom imperanence wrapper
persistence = {
enable = true;
# Set up my custom imperanence wrapper
satellite.persistence = {
enable = true;
# Actual data/media (eg: projects, images, videos, etc)
at.data.path = "/persist/data";
at.data.prefixDirectories = false;
# Actual data/media (eg: projects, images, videos, etc)
at.data.path = "/persist/data";
at.data.prefixDirectories = false;
# App state I want to keep
at.state.path = "/persist/state";
# App state I want to keep
at.state.path = "/persist/state";
# App state which I should be able to delete at any point
at.cache.path = "/persist/local/cache";
};
# App state which I should be able to delete at any point
at.cache.path = "/persist/local/cache";
};
}

View file

@ -1,4 +1,4 @@
{
{ config, ... }: {
imports = [
../common/global
../common/users/adrielus.nix
@ -14,6 +14,20 @@
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
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.loader.grub = {
enable = true;

View file

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