Compare commits
3 Commits
fd9667265e
...
888fbc3649
| Author | SHA1 | Date | |
|---|---|---|---|
|
888fbc3649
|
|||
|
265d5ff5fb
|
|||
|
255a9e3781
|
@@ -22,7 +22,7 @@
|
|||||||
./services/minecraft.nix
|
./services/minecraft.nix
|
||||||
|
|
||||||
./services/wg.nix
|
./services/wg.nix
|
||||||
./services/qbittorrent.nix
|
# ./services/qbittorrent.nix
|
||||||
./services/bitmagnet.nix
|
./services/bitmagnet.nix
|
||||||
|
|
||||||
# ./services/matrix.nix
|
# ./services/matrix.nix
|
||||||
|
|||||||
18
flake.lock
generated
18
flake.lock
generated
@@ -238,11 +238,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751797776,
|
"lastModified": 1752095368,
|
||||||
"narHash": "sha256-ZAiy7aGC4Q1nstnzEDDfBlAb1AiEHmpKClHuVQUB9II=",
|
"narHash": "sha256-U2YJO3uAUkXlOxXPum/3I1XM68/ISozGxAoLvk8YIf8=",
|
||||||
"owner": "ggml-org",
|
"owner": "ggml-org",
|
||||||
"repo": "llama.cpp",
|
"repo": "llama.cpp",
|
||||||
"rev": "6491d6e4f1caf0ad2221865b4249ae6938a6308c",
|
"rev": "cb9178f885d1986cc0b12feb26ff426bc8a3556c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -275,11 +275,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751432711,
|
"lastModified": 1752048960,
|
||||||
"narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=",
|
"narHash": "sha256-gATnkOe37eeVwKKYCsL+OnS2gU4MmLuZFzzWCtaKLI8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f",
|
"rev": "7ced9122cff2163c6a0212b8d1ec8c33a1660806",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -291,11 +291,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751741127,
|
"lastModified": 1751943650,
|
||||||
"narHash": "sha256-t75Shs76NgxjZSgvvZZ9qOmz5zuBE8buUaYD28BMTxg=",
|
"narHash": "sha256-7orTnNqkGGru8Je6Un6mq1T8YVVU/O5kyW4+f9C1mZQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "29e290002bfff26af1db6f64d070698019460302",
|
"rev": "88983d4b665fb491861005137ce2b11a9f89f203",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
17
flake.nix
17
flake.nix
@@ -135,9 +135,22 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceMountDeps = serviceName: dirs: {
|
serviceMountDeps = serviceName: dirs: pkgs: {
|
||||||
|
systemd.services."${serviceName}_mounts" = {
|
||||||
|
unitConfig.Wants = "zfs.target";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = true;
|
||||||
|
ExecStart =
|
||||||
|
let
|
||||||
|
lib = nixpkgs.lib;
|
||||||
|
in
|
||||||
|
"${lib.getExe pkgs.bash} -c \"${lib.getExe pkgs.zfs} get mounted | ${lib.getExe pkgs.gnugrep} yes | ${lib.getExe pkgs.gawk} '{print $1}' | while read i; do ${lib.getExe pkgs.zfs} get mountpoint \$i | ${lib.getExe pkgs.gawk} 'FNR==2 {print \$3}'; done | ${lib.getExe pkgs.gnugrep} '${lib.strings.concatStringsSep "\|" dirs}' | ${pkgs.coreutils}/bin/wc -l | ${lib.getExe pkgs.gnugrep} -q ${toString (lib.length dirs)}\"";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.${serviceName} = {
|
systemd.services.${serviceName} = {
|
||||||
unitConfig.RequiresMountsFor = dirs;
|
wants = [ "${serviceName}_mounts.service" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
config,
|
config,
|
||||||
service_configs,
|
service_configs,
|
||||||
username,
|
username,
|
||||||
@@ -7,7 +8,7 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(serviceMountDeps "gitea" [ config.services.gitea.stateDir ])
|
(serviceMountDeps "gitea" [ config.services.gitea.stateDir ] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(serviceMountDeps "immich-server" [ config.services.immich.mediaLocation ])
|
(serviceMountDeps "immich-server" [ config.services.immich.mediaLocation ] pkgs)
|
||||||
(serviceMountDeps "immich-machine-learning" [ config.services.immich.mediaLocation ])
|
(serviceMountDeps "immich-machine-learning" [ config.services.immich.mediaLocation ] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.immich = {
|
services.immich = {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
(serviceMountDeps "jellyfin" [
|
(serviceMountDeps "jellyfin" [
|
||||||
config.services.jellyfin.dataDir
|
config.services.jellyfin.dataDir
|
||||||
config.services.jellyfin.cacheDir
|
config.services.jellyfin.cacheDir
|
||||||
])
|
] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
(serviceMountDeps "minecraft-server-${service_configs.minecraft.server_name}" [
|
(serviceMountDeps "minecraft-server-${service_configs.minecraft.server_name}" [
|
||||||
"${service_configs.minecraft.parent_dir}/${service_configs.minecraft.server_name}"
|
"${service_configs.minecraft.parent_dir}/${service_configs.minecraft.server_name}"
|
||||||
])
|
] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(serviceMountDeps "postgresql" [ config.services.postgresql.dataDir ])
|
(serviceMountDeps "postgresql" [ config.services.postgresql.dataDir ] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
service_configs.torrents_path
|
service_configs.torrents_path
|
||||||
config.services.qbittorrent.serverConfig.Preferences.Downloads.TempPath
|
config.services.qbittorrent.serverConfig.Preferences.Downloads.TempPath
|
||||||
"/var/lib/qBittorrent/qBittorrent"
|
"/var/lib/qBittorrent/qBittorrent"
|
||||||
])
|
] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
# network namespace that is proxied through mullvad
|
# network namespace that is proxied through mullvad
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
(serviceMountDeps "slskd" [
|
(serviceMountDeps "slskd" [
|
||||||
service_configs.slskd.base
|
service_configs.slskd.base
|
||||||
service_configs.slskd.downloads
|
# service_configs.slskd.downloads
|
||||||
service_configs.slskd.incomplete
|
# service_configs.slskd.incomplete
|
||||||
])
|
] pkgs)
|
||||||
];
|
];
|
||||||
|
|
||||||
users.groups."music" = { };
|
users.groups."music" = { };
|
||||||
|
|||||||
20
zfs.nix
20
zfs.nix
@@ -31,7 +31,7 @@ in
|
|||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
boot.zfs.extraPools = [
|
boot.zfs.extraPools = [
|
||||||
service_configs.zpool_ssds
|
service_configs.zpool_ssds
|
||||||
service_configs.zpool_hdds
|
# service_configs.zpool_hdds
|
||||||
];
|
];
|
||||||
|
|
||||||
services.sanoid = {
|
services.sanoid = {
|
||||||
@@ -66,15 +66,15 @@ in
|
|||||||
yearly = 0;
|
yearly = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
datasets."${service_configs.zpool_hdds}" = {
|
# datasets."${service_configs.zpool_hdds}" = {
|
||||||
recursive = true;
|
# recursive = true;
|
||||||
autoprune = true;
|
# autoprune = true;
|
||||||
autosnap = true;
|
# autosnap = true;
|
||||||
hourly = 0;
|
# hourly = 0;
|
||||||
daily = 0;
|
# daily = 0;
|
||||||
monthly = 0;
|
# monthly = 0;
|
||||||
yearly = 0;
|
# yearly = 0;
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
services.zfs = {
|
services.zfs = {
|
||||||
|
|||||||
Reference in New Issue
Block a user