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;