init
This commit is contained in:
commit
3ab713a5b3
64 changed files with 2043 additions and 0 deletions
31
hosts/vessel/backup.nix
Normal file
31
hosts/vessel/backup.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
systemd.timers.local-backup = {
|
||||
description = "Local rsync Backup";
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 00:00:00";
|
||||
Persistent = true;
|
||||
Unit = "local-backup.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.local-backup = {
|
||||
description = "Local rsync Backup";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = ''${lib.getExe pkgs.rsync} --verbose --verbose --archive --update --delete /srv/storage/ /srv/backup/'';
|
||||
User = "root";
|
||||
Group = "root";
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/srv/backup" = {
|
||||
device = "/dev/disk/by-label/backup";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=main" "compress=zstd" "noatime"];
|
||||
};
|
||||
}
|
32
hosts/vessel/default.nix
Normal file
32
hosts/vessel/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
inputs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
|
||||
inputs.hardware.nixosModules.common-cpu-intel
|
||||
inputs.hardware.nixosModules.common-gpu-intel
|
||||
inputs.hardware.nixosModules.common-pc-ssd
|
||||
|
||||
./backup.nix
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod"];
|
||||
kernelModules = ["kvm-intel"];
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
fileSystems."/srv/storage" = {
|
||||
device = "/dev/disk/by-label/storage";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=main" "compress=zstd" "noatime"];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue