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.
This commit is contained in:
Gabriel Arazas 2022-07-13 19:11:33 +08:00
parent 4708d7acc2
commit a916d78f09
3 changed files with 6 additions and 16 deletions

View File

@ -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;
};
};
})
];

View File

@ -166,10 +166,6 @@ in {
SystemCallFilter = "@system-service";
SystemCallErrorNumber = "EPERM";
};
unitConfig = {
AssertPathIsReadWrite = cfg.archivePath;
AssertPathIsDirectory = cfg.archivePath;
};
}) cfg.jobs;
};
}

View File

@ -144,10 +144,6 @@ in {
SystemCallFilter = "@system-service";
SystemCallErrorNumber = "EPERM";
};
unitConfig = {
AssertPathIsReadWrite = cfg.archivePath;
AssertPathIsDirectory = cfg.archivePath;
};
}) cfg.jobs;
};
}