From 73dbfc934fa7791abc2d792dc68f36a4df16b878 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 30 Jul 2026 18:54:08 +0900 Subject: [PATCH] nix/package: add systemd units --- flake.nix | 2 +- nix/package.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index f59beb7..5eb3ee7 100644 --- a/flake.nix +++ b/flake.nix @@ -91,7 +91,7 @@ root = ./.; fileset = lib.fileset.unions [ (craneLib.fileset.commonCargoSources ./.) - # ./assets + ./assets/systemd ]; }; diff --git a/nix/package.nix b/nix/package.nix index 662a022..ce9ec44 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -83,7 +83,17 @@ buildFunction ({ shell = [ "bash" "zsh" "fish" ]; command = [ "rwho" "ruptime" "finger" "wall" "write" ]; }; - in lib.concatStringsSep "\n" installShellCompletions; + in '' + ${lib.concatStringsSep "\n" installShellCompletions} + + install -Dm444 assets/systemd/roowho2-audit.socket "$out/lib/systemd/system/roowho2-audit.socket" + install -Dm444 assets/systemd/roowho2-client.socket "$out/lib/systemd/system/roowho2-client.socket" + install -Dm444 assets/systemd/roowho2-rwhod.socket "$out/lib/systemd/system/roowho2-rwhod.socket" + + install -Dm444 assets/systemd/roowho2.service "$out/lib/systemd/system/roowho2.service" + substituteInPlace "$out/lib/systemd/system/roowho2.service" \ + --replace "/usr/bin/roowhod" "${placeholder "out"}/bin/${mainProgram}" + ''; meta = with lib; { license = licenses.bsdOriginalUC;