refactor: moved nixos modules to dendrite pattern
This commit is contained in:
parent
df8dd110ad
commit
0ea11e0236
219 changed files with 4802 additions and 4820 deletions
21
modules/nixos/programs/jackett/default.nix
Normal file
21
modules/nixos/programs/jackett/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{config, ...}: let
|
||||
mod = config.flake.nixosModules;
|
||||
in {
|
||||
flake.nixosModules.jackett = {
|
||||
imports = [
|
||||
mod.jackett-storage
|
||||
];
|
||||
|
||||
config = {
|
||||
nixpkgs.overlays = [
|
||||
# Disable jackett tests due to date-related test failures
|
||||
# (ParseDateTimeGoLangTest expects 2024-09-14 but gets 2025-09-14 due to year rollover logic)
|
||||
(final: prev: {
|
||||
jackett = prev.jackett.overrideAttrs (oldAttrs: {
|
||||
doCheck = false;
|
||||
});
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
23
modules/nixos/programs/jackett/storage.nix
Normal file
23
modules/nixos/programs/jackett/storage.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{...}: {
|
||||
flake.nixosModules.jackett-storage = {
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
jackett_data_directory = "/var/lib/jackett/.config/Jackett";
|
||||
in {
|
||||
options.services.jackett.impermanence.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.services.jackett.enable && config.storage.impermanence.enable;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.jackett.enable {
|
||||
storage.datasets.replicate."system/root" = {
|
||||
directories."${jackett_data_directory}" = lib.mkIf config.services.jackett.impermanence.enable {
|
||||
owner.name = "jackett";
|
||||
group.name = "jackett";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue