From a916d78f09c770d3b7a566beb5fe4f42fa2d2b4e Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 13 Jul 2022 19:11:33 +0800 Subject: [PATCH] profiles/services: remove path assertions It was supposed to create the directory if it wasn't found which is self-defeating. In any case, it will still fail if the directory is in the way of an unmounted device. --- modules/nixos/services/archivebox.nix | 14 ++++++-------- modules/nixos/services/gallery-dl.nix | 4 ---- modules/nixos/services/yt-dlp.nix | 4 ---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/modules/nixos/services/archivebox.nix b/modules/nixos/services/archivebox.nix index a6a27e63..048a619a 100644 --- a/modules/nixos/services/archivebox.nix +++ b/modules/nixos/services/archivebox.nix @@ -104,6 +104,9 @@ in { documentation = [ "https://docs.archivebox.io/" ]; path = with pkgs; [ ripgrep coreutils ] ++ pkgSet ++ [ config.programs.git.package ]; + preStart = '' + mkdir -p ${lib.escapeShellArg cfg.archivePath} + ''; script = '' echo "${lib.concatStringsSep "\n" value.links}" \ | archivebox add ${lib.concatStringsSep " " value.extraArgs} @@ -123,10 +126,6 @@ in { SystemCallErrorNumber = "EPERM"; WorkingDirectory = cfg.archivePath; }; - unitConfig = { - AssertPathIsReadWrite = cfg.archivePath; - AssertPathIsDirectory = cfg.archivePath; - }; }) cfg.jobs) (lib.mkIf cfg.webserver.enable { @@ -135,6 +134,9 @@ in { after = [ "network.target" ]; documentation = [ "https://docs.archivebox.io/" ]; wantedBy = [ "graphical-session.target" ]; + preStart = '' + mkdir -p ${lib.escapeShellArg cfg.archivePath} + ''; serviceConfig = { ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${ toString cfg.webserver.port @@ -154,10 +156,6 @@ in { SystemCallErrorNumber = "EPERM"; WorkingDirectory = cfg.archivePath; }; - unitConfig = { - AssertPathIsReadWrite = cfg.archivePath; - AssertPathIsDirectory = cfg.archivePath; - }; }; }) ]; diff --git a/modules/nixos/services/gallery-dl.nix b/modules/nixos/services/gallery-dl.nix index 80b44757..c236d7d3 100644 --- a/modules/nixos/services/gallery-dl.nix +++ b/modules/nixos/services/gallery-dl.nix @@ -166,10 +166,6 @@ in { SystemCallFilter = "@system-service"; SystemCallErrorNumber = "EPERM"; }; - unitConfig = { - AssertPathIsReadWrite = cfg.archivePath; - AssertPathIsDirectory = cfg.archivePath; - }; }) cfg.jobs; }; } diff --git a/modules/nixos/services/yt-dlp.nix b/modules/nixos/services/yt-dlp.nix index a95fcaa0..ab972aae 100644 --- a/modules/nixos/services/yt-dlp.nix +++ b/modules/nixos/services/yt-dlp.nix @@ -144,10 +144,6 @@ in { SystemCallFilter = "@system-service"; SystemCallErrorNumber = "EPERM"; }; - unitConfig = { - AssertPathIsReadWrite = cfg.archivePath; - AssertPathIsDirectory = cfg.archivePath; - }; }) cfg.jobs; }; }