Skip to content

Commit

Permalink
fix: path dependencies during runtime (#181)
Browse files Browse the repository at this point in the history
We weren't ensuring `systemd-detect-virt` was available at runtime. Just by chance it has been, but when implementing an activation script to detect report changes for `nixos-facter-modules` I noticed this issue.

Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee authored Feb 5, 2025
1 parent f08e0d8 commit 906098c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions nix/packages/nixos-facter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ in

nativeBuildInputs = with pkgs; [
gcc
makeWrapper
pkg-config
];

runtimeInputs = with pkgs; [
util-linux
];

ldflags = [
"-s"
"-w"
Expand All @@ -59,6 +56,15 @@ in
"-X github.com/numtide/nixos-facter/pkg/build.System=${pkgs.stdenv.hostPlatform.system}"
];

postInstall = let
binPath = lib.makeBinPath (with pkgs; [
systemdMinimal
]);
in ''
wrapProgram "$out/bin/nixos-facter" \
--prefix PATH : "${binPath}"
'';

passthru.tests = (import ./tests) args;

meta = with lib; {
Expand Down

0 comments on commit 906098c

Please sign in to comment.