Skip to content

Commit

Permalink
Merge pull request #643 from PJungkamp/packaging-nix
Browse files Browse the repository at this point in the history
packaging-nix: fix broken `git+file:.` input
  • Loading branch information
stv0g authored May 25, 2023
2 parents e47775e + 58dbd91 commit 7506e2c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packaging/nix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Here is a more complete `flake.nix` containing `devShells` available to
jq
bat
];
}
};
};
}
```
Expand Down
41 changes: 21 additions & 20 deletions packaging/nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packaging/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";

src = {
url = "git+file:.?submodules=1";
common = {
url = "github:VILLASframework/common?submodules=1";
flake = false;
};

Expand Down Expand Up @@ -43,7 +43,8 @@
default = villas;

villas-minimal = pkgs.callPackage ./villas.nix {
inherit (inputs) src;
src = ../..;
common = inputs.common;
};

villas = villas-minimal.override {
Expand Down
4 changes: 4 additions & 0 deletions packaging/nix/villas.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
# build dependencies
cmake,
common,
lib,
makeWrapper,
pkg-config,
Expand Down Expand Up @@ -61,6 +62,9 @@ stdenv.mkDerivation {
# 'array-bounds' and 'stringop-overflow' for villas-relay
"-DCMAKE_CXX_FLAGS_RELEASE=-Wno-error"
];
preConfigure = ''
rm -d common && ln -sf ${common} common
'';
postInstall = ''
wrapProgram $out/bin/villas \
--set PATH ${lib.makeBinPath [(placeholder "out") gnugrep]}
Expand Down

0 comments on commit 7506e2c

Please sign in to comment.