Skip to content

Commit

Permalink
nixos/services.peerflix: remove with lib;
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed Dec 30, 2024
1 parent 4db4628 commit 336a76b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions nixos/modules/services/torrent/peerflix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
pkgs,
...
}:

with lib;

let
cfg = config.services.peerflix;
opt = options.services.peerflix;
Expand All @@ -25,29 +22,29 @@ in
###### interface

options.services.peerflix = {
enable = mkOption {
enable = lib.mkOption {
description = "Whether to enable peerflix service.";
default = false;
type = types.bool;
type = lib.types.bool;
};

stateDir = mkOption {
stateDir = lib.mkOption {
description = "Peerflix state directory.";
default = "/var/lib/peerflix";
type = types.path;
type = lib.types.path;
};

downloadDir = mkOption {
downloadDir = lib.mkOption {
description = "Peerflix temporary download directory.";
default = "${cfg.stateDir}/torrents";
defaultText = literalExpression ''"''${config.${opt.stateDir}}/torrents"'';
type = types.path;
defaultText = lib.literalExpression ''"''${config.${opt.stateDir}}/torrents"'';
type = lib.types.path;
};
};

###### implementation

config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d '${cfg.stateDir}' - peerflix - - -"
];
Expand Down

0 comments on commit 336a76b

Please sign in to comment.