Wtf why did it remove everything.
This commit is contained in:
parent
d58b606d90
commit
2144d9ef61
73 changed files with 1077 additions and 0 deletions
9
modules/system/devices/disks/default.nix
Normal file
9
modules/system/devices/disks/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./filesystems
|
||||
./immutable
|
||||
./impermanence
|
||||
./snapper
|
||||
];
|
||||
}
|
13
modules/system/devices/disks/filesystems/default.nix
Normal file
13
modules/system/devices/disks/filesystems/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
boot.supportedFilesystems = {
|
||||
btrfs = true;
|
||||
ntfs = true;
|
||||
zfs = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
btrfs.autoScrub.enable = true;
|
||||
fstrim.enable = true;
|
||||
};
|
||||
}
|
5
modules/system/devices/disks/immutable/default.nix
Normal file
5
modules/system/devices/disks/immutable/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
{
|
||||
system.etc.overlay.mutable = false;
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
}
|
8
modules/system/devices/disks/impermanence/default.nix
Normal file
8
modules/system/devices/disks/impermanence/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ impermanence, ... }:
|
||||
{
|
||||
imports = [
|
||||
./main
|
||||
./root
|
||||
impermanence.nixosModules.impermanence
|
||||
];
|
||||
}
|
46
modules/system/devices/disks/impermanence/main/default.nix
Normal file
46
modules/system/devices/disks/impermanence/main/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
environment.persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
users.${config.sysusers.main} = {
|
||||
directories = [
|
||||
"Keepers"
|
||||
"Documents"
|
||||
"Pictures"
|
||||
"Videos"
|
||||
"Games"
|
||||
"VMs"
|
||||
|
||||
".snapshots"
|
||||
".mozilla"
|
||||
".thunderbird"
|
||||
|
||||
".config/blender"
|
||||
".config/dconf"
|
||||
".config/vesktop"
|
||||
".config/sunshine"
|
||||
".config/heroic"
|
||||
".config/obs-studio"
|
||||
|
||||
".local/share/mpd"
|
||||
".local/share/nvim/undo"
|
||||
".local/share/PrismLauncher"
|
||||
".local/share/Steam"
|
||||
".local/share/TelegramDesktop"
|
||||
|
||||
".local/state/wireplumber"
|
||||
|
||||
".cache/nix-index"
|
||||
|
||||
{ directory = ".ssh"; mode = "0700"; }
|
||||
{ directory = ".gnupg"; mode = "0700"; }
|
||||
{ directory = ".local/share/keyrings"; mode = "0700"; }
|
||||
];
|
||||
files = [
|
||||
".zsh_history"
|
||||
".local/state/lazygit/state.yml"
|
||||
".local/share/applications" # Create directory so nothing generates inside of it
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
15
modules/system/devices/disks/impermanence/root/default.nix
Normal file
15
modules/system/devices/disks/impermanence/root/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ ... }:
|
||||
{
|
||||
environment.persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/etc/nixos"
|
||||
"/etc/secureboot"
|
||||
"/var/lib/nixos"
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
"/root/.gitconfig"
|
||||
];
|
||||
};
|
||||
}
|
12
modules/system/devices/disks/snapper/default.nix
Normal file
12
modules/system/devices/disks/snapper/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./main
|
||||
./root
|
||||
];
|
||||
|
||||
services.snapper = {
|
||||
snapshotInterval = "0/6:00:00";
|
||||
persistentTimer = true;
|
||||
};
|
||||
}
|
12
modules/system/devices/disks/snapper/main/default.nix
Normal file
12
modules/system/devices/disks/snapper/main/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.snapper.configs.${config.sysusers.main} = lib.mkIf config.environment.persistence."/persist".enable {
|
||||
SUBVOLUME = "/persist/home/${config.sysusers.main}";
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_LIMIT_DAILY = 1;
|
||||
TIMELINE_LIMIT_WEEKLY = 1;
|
||||
TIMELINE_LIMIT_MONTHLY = 0;
|
||||
TIMELINE_LIMIT_YEARLY = 0;
|
||||
};
|
||||
}
|
12
modules/system/devices/disks/snapper/root/default.nix
Normal file
12
modules/system/devices/disks/snapper/root/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.snapper.configs.root = lib.mkIf config.environment.persistence."/persist".enable {
|
||||
SUBVOLUME = "/persist";
|
||||
TIMELINE_CREATE = true;
|
||||
TIMELINE_CLEANUP = true;
|
||||
TIMELINE_LIMIT_DAILY = 1;
|
||||
TIMELINE_LIMIT_WEEKLY = 0;
|
||||
TIMELINE_LIMIT_MONTHLY = 0;
|
||||
TIMELINE_LIMIT_YEARLY = 0;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue