diff --git a/bookwyrm.nix b/bookwyrm.nix index 66e03ec..dfec431 100644 --- a/bookwyrm.nix +++ b/bookwyrm.nix @@ -116,17 +116,6 @@ mkDerivation { chmod +x $out/bin/bookwyrm - # Systemd units - - cat <<- EOF > $out/lib/systemd/system/bookwyrm.service - [Unit] - After=network.target - - [Service] - ExecStart=$out/bin/bookwyrm - WorkingDirectory=/var/lib/bookwyrm - EOF - runHook postInstall '' ; } diff --git a/nixos-module.nix b/nixos-module.nix index 5a527a3..b90ef12 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -51,4 +51,19 @@ ) ] ; } ; + + systemd = { + units = { + bookwyrm = { + text = '' + [Unit] + After=network.target + + [Service] + ExecStart=$out/bin/bookwyrm + WorkingDirectory=/var/lib/bookwyrm + '' ; + } ; + } ; + } ; }