1
0
Fork 0

refactor systemd-unit derivation

This commit is contained in:
ibizaman 2022-05-19 20:00:12 -07:00
parent a35170e3bb
commit 776265ddac
2 changed files with 5 additions and 8 deletions

View file

@ -1,6 +1,7 @@
{ stdenv
, pkgs
, lib
, utils
}:
{ readOnlyPaths ? []
, readWritePaths ? []
@ -22,9 +23,9 @@ let
fullPath = "${TtrssService.documentRoot}/${TtrssService.documentName}";
roPaths = [fullPath] ++ readOnlyPaths;
in
stdenv.mkDerivation rec {
utils.systemd-service-derivation rec {
name = "ttrss-update";
src = pkgs.writeTextDir "${name}.service" ''
content = ''
[Unit]
Description=${name}
After=network.target ${TtrssPostgresDB.postgresServiceName}
@ -60,9 +61,4 @@ stdenv.mkDerivation rec {
[Install]
WantedBy=multi-user.target
'';
installPhase = ''
mkdir -p $out/etc/systemd/system
cp $src/*.service $out/etc/systemd/system
'';
}

View file

@ -2,6 +2,7 @@
, services ? null
, system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { inherit system; }
, utils ? null
}:
let
@ -11,7 +12,7 @@ let
PostgresDB = callPackage ./PostgresDB {};
TtrssService = callPackage ./Ttrss {};
TtrssUpdateService = callPackage ./Ttrss/update.nix {};
TtrssUpdateService = callPackage ./Ttrss/update.nix {inherit utils;};
TtrssUpgradeDBService = callPackage ./Ttrss/dbupgrade.nix {};
};
in