whatever
This commit is contained in:
parent
be9fb9278e
commit
b8af0e9761
165 changed files with 1815 additions and 1431 deletions
24
hosts/vessel/filesystems.nix
Normal file
24
hosts/vessel/filesystems.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
label = "white";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/srv/vault" = {
|
||||
label = "black";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/srv/void" = {
|
||||
label = "green";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
"/srv/sync" = {
|
||||
label = "red";
|
||||
fsType = "ext4";
|
||||
options = [ "noatime" ];
|
||||
};
|
||||
};
|
||||
}
|
30
hosts/vessel/hardware.nix
Normal file
30
hosts/vessel/hardware.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
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
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = "powersave";
|
||||
}
|
45
hosts/vessel/musicomp.nix
Normal file
45
hosts/vessel/musicomp.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
inputs,
|
||||
self,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
inputs.musicomp.nixosModules.default
|
||||
];
|
||||
|
||||
services.musicomp.jobs.main = {
|
||||
music = "/srv/music";
|
||||
comp = "/srv/compmusic";
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
inhibitsSleep = true;
|
||||
post =
|
||||
let
|
||||
remoteDir = self.nixosConfigurations.abacus.config.services.navidrome.settings.MusicFolder;
|
||||
package = pkgs.writeShellApplication {
|
||||
name = "sync";
|
||||
runtimeInputs = [
|
||||
pkgs.openssh
|
||||
pkgs.rsync
|
||||
];
|
||||
text = ''
|
||||
rsync \
|
||||
--archive \
|
||||
--recursive \
|
||||
--delete \
|
||||
--update \
|
||||
--mkpath \
|
||||
--verbose --verbose \
|
||||
--rsh 'ssh -i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \
|
||||
/srv/void/compmusic/ root@wrz.one:${lib.escapeShellArg remoteDir}
|
||||
'';
|
||||
};
|
||||
in
|
||||
lib.getExe package;
|
||||
};
|
||||
}
|
56
hosts/vessel/restic.nix
Normal file
56
hosts/vessel/restic.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
attrName,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
secretName = "restic-${attrName}";
|
||||
secret = config.age.secrets.${secretName};
|
||||
in
|
||||
{
|
||||
age.secrets = lib.mkSecrets { ${secretName} = { }; };
|
||||
|
||||
services.restic.backups = {
|
||||
local = {
|
||||
repository = "/srv/backup/void";
|
||||
initialize = true;
|
||||
paths = [
|
||||
"/srv/void"
|
||||
];
|
||||
passwordFile = secret.path;
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 03:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
remote = {
|
||||
repository = "sftp:u459482@u459482.your-storagebox.de:/${attrName}";
|
||||
initialize = true;
|
||||
paths = [
|
||||
config.services.syncthing.dataDir
|
||||
"/srv/vault"
|
||||
];
|
||||
passwordFile = secret.path;
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 03:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
extraOptions = [
|
||||
"sftp.args='-i /etc/ssh/ssh_host_ed25519_key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
7
hosts/vessel/rsync.nix
Normal file
7
hosts/vessel/rsync.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
services.rsync.jobs.vault = {
|
||||
sources = [ "/srv/vault/" ];
|
||||
destination = "/srv/sync/";
|
||||
inhibitsSleep = true;
|
||||
};
|
||||
}
|
16
hosts/vessel/storage.nix
Normal file
16
hosts/vessel/storage.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
systemd.tmpfiles.settings = {
|
||||
music = {
|
||||
"/srv/vault/music".d = {
|
||||
user = "root";
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
};
|
||||
"/srv/void/compmusic".d = {
|
||||
user = "root";
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
3
hosts/vessel/system.nix
Normal file
3
hosts/vessel/system.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
system.stateVersion = "24.11";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue