feat: add yottamaster
This commit is contained in:
parent
365196caf6
commit
92002fcf17
3 changed files with 68 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
|||
./mail-server.nix
|
||||
./website/root
|
||||
./navidrome.nix
|
||||
./yottamaster.nix
|
||||
inputs.home-manager.nixosModules.default
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
enable = true;
|
||||
settings = {
|
||||
MusicFolder = "/mnt/music/tagged";
|
||||
DataFolder = "/var/lib/navidrome";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -38,6 +39,7 @@
|
|||
];
|
||||
musicbrainz.genres = true;
|
||||
lyrics.synced = true;
|
||||
replaygain.backend = "ffmpeg";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -45,6 +47,7 @@
|
|||
music = {
|
||||
paths = [
|
||||
config.services.navidrome.settings.MusicFolder
|
||||
config.services.navidrome.settings.DataFolder
|
||||
config.home-manager.users.moritz.programs.beets.settings.library
|
||||
];
|
||||
repo = "u461386-sub1@u461386.your-storagebox.de:music";
|
||||
|
|
|
|||
64
machines/moritz-server/yottamaster.nix
Normal file
64
machines/moritz-server/yottamaster.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
clan-core,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
suffix = config.clan.core.vars.generators.disk-id.files.diskId.value;
|
||||
in {
|
||||
imports = [
|
||||
clan-core.clanModules.disk-id
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
disko.devices = {
|
||||
disk = let
|
||||
disks = ["/dev/disk/by-id/usb-JMicron_Generic_DISK00_0123456789ABCDEF-0:0" "/dev/disk/by-id/usb-JMicron_Generic_DISK01_0123456789ABCDEF-0:1"];
|
||||
mkDisk = name: device: {
|
||||
inherit device;
|
||||
# suffix is to prevent disk name collisions
|
||||
name = name + "-" + suffix;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
"zfs" = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "yottamaster";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
kv =
|
||||
lib.imap0 (i: v: rec {
|
||||
name = "yottamaster" + builtins.toString i;
|
||||
value = mkDisk name v;
|
||||
})
|
||||
disks;
|
||||
in
|
||||
builtins.listToAttrs kv;
|
||||
zpool = {
|
||||
yottamaster = {
|
||||
type = "zpool";
|
||||
mode = "mirror";
|
||||
# Workaround: cannot import 'zroot': I/O error in disko tests
|
||||
options.cachefile = "none";
|
||||
rootFsOptions = {
|
||||
compression = "zstd";
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
|
||||
datasets = {
|
||||
music = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/music";
|
||||
options."com.sun:auto-snapshot" = "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue