Skip to content

Commit

Permalink
fix packages outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
hansfbaier committed Jun 6, 2024
1 parent bf175bb commit 44b1fc8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@
let
pkgs = nixpkgsFor.${system};
inherit (pkgs) callPackage;
outPathOf = x: if (builtins.hasAttr "lib" x)
then x.lib.outPath
else x.out.outPath;
libAppend = x: ''
export LD_LIBRARY_PATH="${outPathOf x}/lib:$LD_LIBRARY_PATH"
'';
in rec {
ffts = callPackage ./nix/ffts.nix { };
scopehal-apps = callPackage ./nix/scopehal-apps.nix { inherit ffts; };
default = scopehal-apps;
libraryPaths = builtins.concatStringsSep "" (map libAppend scopehal-apps.buildInputs);
});

devShell = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
scopeHal = packages.${system}.scopehal-apps;
outPathOf = x: if (builtins.hasAttr "lib" x)
then x.lib.outPath
else x.out.outPath;
libAppend = x: ''
export LD_LIBRARY_PATH="${outPathOf x}/lib:$LD_LIBRARY_PATH"
'';
libraryPaths = builtins.concatStringsSep "" (map libAppend packages.${system}.scopehal-apps.buildInputs);
in pkgs.mkShell {
nativeBuildInputs = scopeHal.nativeBuildInputs;
buildInputs = scopeHal.buildInputs;
hardeningDisable = [ "all" ];
shellHook = "echo Welcome to the ngscopeclient devShell!\n" +
packages.${system}.libraryPaths;
libraryPaths;
}
);
};
Expand Down

0 comments on commit 44b1fc8

Please sign in to comment.