Skip to content

Commit

Permalink
Merge pull request #11 from tomeon/nix-flake-darwin-fix
Browse files Browse the repository at this point in the history
fix(nix): ignore unsupported package `psmisc` on Darwin
  • Loading branch information
tomeon authored Mar 17, 2024
2 parents 8619404 + d7b4e7b commit 5759bad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ This file lists all notable changes to this project.
- Unpack "complex" group specifications (dictionaries) when constructing the
`groups` attribute of the Ansible `user` task that creates `kodi_user`; this
task expects a list of strings specifying group names (#10).
- Omit `psmisc` from `vagrant-libvirt-create-box`'s dependency list when
running on Darwin, where `psmisc` is not available (#11).
14 changes: 12 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,17 @@

# From the `vagrant-libvirt` project. Patched to permit injecting
# additional files into the generated Vagrant box archive.
vagrant-libvirt-create-box =
vagrant-libvirt-create-box = let
deps = with pkgs;
[
coreutils
gawk
gnutar
pigz
qemu
]
++ (lib.optional (!stdenv.isDarwin) psmisc);
in
pkgs.runCommand "vagrant-libvirt-create-box" {
src = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/vagrant-libvirt/vagrant-libvirt/main/tools/create_box.sh";
Expand All @@ -126,7 +136,7 @@
s/\([[:space:]]\+\)|\([[:space:]]\+\)/\1"$@" |\2/
s/^/argc="$#"; if [ "$argc" -ge 3 ]; then shift 3; elif [ "$argc" -eq 2 ]; then shift 2; else shift 1; fi; /
}' "$script"
wrapProgram "$script" --prefix PATH : ${lib.makeBinPath (with pkgs; [coreutils gawk gnutar pigz psmisc qemu])}
wrapProgram "$script" --prefix PATH : ${lib.makeBinPath deps}
'';
};

Expand Down

0 comments on commit 5759bad

Please sign in to comment.