2023-10-03 16:55:14 +02:00
|
|
|
{ inputs', pkgs, ... }:
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
inputs'.self.overlays.show-files-to-be-deleted
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.show-files-to-be-deleted
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.persistence."/nix/persist" = {
|
|
|
|
hideMounts = true;
|
|
|
|
directories = [
|
|
|
|
"/var/log"
|
|
|
|
"/var/lib/bluetooth"
|
|
|
|
"/var/lib/nixos"
|
|
|
|
"/var/lib/systemd/coredump"
|
|
|
|
"/var/lib/iwd"
|
|
|
|
"/var/lib/syncthing"
|
|
|
|
];
|
|
|
|
files = [
|
|
|
|
"/etc/machine-id"
|
|
|
|
"/etc/ssh/ssh_host_rsa_key"
|
|
|
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key"
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
|
|
];
|
|
|
|
users.main = {
|
|
|
|
directories = [
|
|
|
|
"sync"
|
|
|
|
".steam"
|
|
|
|
".local/share/Steam"
|
|
|
|
".emacs.d"
|
|
|
|
"roam"
|
|
|
|
"dotfiles"
|
|
|
|
"Documents"
|
|
|
|
{ directory = ".gnupg"; mode = "0700"; }
|
|
|
|
{ directory = ".ssh"; mode = "0700"; }
|
|
|
|
".local/share/direnv"
|
|
|
|
"repos"
|
2023-10-03 23:49:15 +02:00
|
|
|
".config/SchildiChat"
|
2023-10-03 23:49:04 +02:00
|
|
|
".config/matlab"
|
|
|
|
".matlab"
|
|
|
|
"MATLAB"
|
2023-10-04 00:08:03 +02:00
|
|
|
".stack"
|
|
|
|
".cache/nix"
|
|
|
|
".cache/fontconfig"
|
|
|
|
".cache/mesa_shader_cache"
|
|
|
|
".cache/ghcide"
|
2023-10-06 15:07:13 +02:00
|
|
|
".local/share/pantalaimon"
|
|
|
|
"Mail"
|
|
|
|
".cache/mu"
|
|
|
|
".gradle"
|
2023-10-07 20:59:19 +02:00
|
|
|
".password-store"
|
2023-10-03 16:55:14 +02:00
|
|
|
];
|
|
|
|
files = [
|
|
|
|
{ file = ".config/wallpaper"; method = "symlink"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.initrd.systemd.storePaths = with pkgs; [
|
|
|
|
zfs
|
|
|
|
busybox
|
|
|
|
];
|
|
|
|
boot.initrd.systemd.services.rollback = {
|
|
|
|
description = "Rollback ZFS datasets to a pristine state";
|
|
|
|
wantedBy = [
|
|
|
|
"initrd.target"
|
|
|
|
];
|
|
|
|
after = [
|
|
|
|
"zfs-import-omen-ssd.service"
|
|
|
|
];
|
|
|
|
before = [
|
|
|
|
"sysroot.mount"
|
|
|
|
];
|
|
|
|
path = with pkgs; [
|
|
|
|
zfs
|
|
|
|
busybox
|
|
|
|
];
|
|
|
|
unitConfig.DefaultDependencies = "no";
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
script = ''
|
2023-10-07 22:43:51 +02:00
|
|
|
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/home" "10"
|
2023-10-03 16:55:14 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-10-18 14:30:17 +02:00
|
|
|
systemd.services."mount-old-homes" = {
|
|
|
|
description = "Mount old versions of home dataset";
|
|
|
|
|
|
|
|
wantedBy = [ "local-fs.target" ];
|
|
|
|
after = [ "local-fs.target" ];
|
|
|
|
|
|
|
|
script = ''
|
|
|
|
${pkgs.rolling_datasets}/bin/mount_datasets "omen-ssd/ephemeral/home" "/home/.old"
|
|
|
|
'';
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = "yes";
|
|
|
|
TimeoutStartSec = "5m";
|
|
|
|
};
|
|
|
|
};
|
2023-10-03 16:55:14 +02:00
|
|
|
|
|
|
|
systemd.services."home-manager-main-pre.service" = {
|
|
|
|
description = "Home Manager environment prestart for main";
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
before = [ "home-manager-main.service" ];
|
|
|
|
|
|
|
|
script = ''
|
|
|
|
set -e
|
|
|
|
mkdir -p /home/main
|
|
|
|
chown 1000:1000 /home/main
|
|
|
|
'';
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = "yes";
|
|
|
|
TimeoutStartSec = "5m";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|