diff --git a/machines/storage01/_hardware-configuration.nix b/machines/storage01/_hardware-configuration.nix index 03e663e..7706a41 100644 --- a/machines/storage01/_hardware-configuration.nix +++ b/machines/storage01/_hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = @@ -14,7 +14,7 @@ boot.kernelModules = [ "kvm-intel" ]; boot.supportedFilesystems = [ "zfs" ]; boot.zfs.forceImportRoot = false; - boot.zfs.extraPools = [ "fast01" "medium01" "work01" "small01" ]; + boot.zfs.extraPools = [ "fast01" "work01" ]; boot.extraModulePackages = [ ]; fileSystems."/" = diff --git a/machines/storage01/garage.nix b/machines/storage01/garage.nix index 902c26d..85201de 100644 --- a/machines/storage01/garage.nix +++ b/machines/storage01/garage.nix @@ -3,11 +3,16 @@ _: let host = "s3.dgnum.eu"; webHost = "cdn.dgnum.eu"; + + data_dir = "/data/slow/garage/data"; + metadata_dir = "/data/fast/garage/meta"; in { services.garage = { enable = true; settings = { + inherit data_dir metadata_dir; + replication_mode = "none"; compression_level = 7; @@ -37,6 +42,17 @@ in { }; }; + systemd.services.garage.serviceConfig = { + User = "garage"; + ReadWriteDirectories = [ data_dir metadata_dir ]; + }; + + users.users.garage = { + isSystemUser = true; + group = "garage"; + }; + users.groups.garage = { }; + services.nginx.virtualHosts = { ${host} = { enableACME = true;