hp: move persistence

This commit is contained in:
Sean Buckley 2023-08-27 23:15:50 -04:00
parent 61a3231294
commit f6be47670d

View file

@ -1,4 +1,7 @@
{ config, lib, pkgs, ... }:
let
persist = "/nix/persist";
in
{
sconfig = {
gnome = true;
@ -7,18 +10,23 @@
wg-home.enable = true;
};
environment.etc.machine-id.source = "/var/lib/nixos/machine-id";
environment.etc.machine-id.source = "${persist}/machine-id";
environment.etc."NetworkManager/system-connections".source =
"/var/lib/nixos/nm-connections";
environment.persistence."${persist}/system".directories = [
"/etc/NetworkManager/system-connections"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/log/journal"
];
services.openssh.hostKeys = [
{ type = "ed25519"; path = "/var/lib/nixos/ssh_host_ed25519_key"; }
{ type = "ed25519"; path = "${persist}/ssh_host_ed25519_key"; }
];
users.mutableUsers = false;
users.users.sean.passwordFile = "/var/lib/nixos/shadow_sean";
users.users.root.passwordFile = "/var/lib/nixos/shadow_sean";
users.users.sean.passwordFile = "${persist}/shadow_sean";
users.users.root.passwordFile = "${persist}/shadow_sean";
boot = {
loader.systemd-boot.enable = true;
@ -33,7 +41,6 @@
"/boot" = { device = "/dev/disk/by-partlabel/EFI\\x20system\\x20partition"; fsType = "vfat"; };
"/home" = { device = "zroot/locker/home"; fsType = "zfs"; };
"/nix" = { device = "zroot/locker/nix"; fsType = "zfs"; };
"/var/lib" = { device = "zroot/locker/lib"; fsType = "zfs"; };
"/var/log" = { device = "zroot/locker/log"; fsType = "zfs"; };
};