From 03963af59e25b8e661e3d5844ff6d52e87e15082 Mon Sep 17 00:00:00 2001 From: Reinout Meliesie Date: Tue, 4 Mar 2025 12:19:47 +0100 Subject: [PATCH] Move Bookwyrm systemd unit from package to NixOS module --- bookwyrm.nix | 11 ----------- nixos-module.nix | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) 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 + '' ; + } ; + } ; + } ; }