mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
packaging-nix: Add debug info to dependencies in devShells
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
parent
7117dc601f
commit
9c94b31057
1 changed files with 22 additions and 5 deletions
|
@ -47,6 +47,12 @@
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
|
# add separateDebugInfo to a derivation
|
||||||
|
addSeparateDebugInfo = d:
|
||||||
|
d.overrideAttrs {
|
||||||
|
separateDebugInfo = true;
|
||||||
|
};
|
||||||
|
|
||||||
# supported systems for native compilation
|
# supported systems for native compilation
|
||||||
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||||||
|
|
||||||
|
@ -63,21 +69,28 @@
|
||||||
pkgsFor = system:
|
pkgsFor = system:
|
||||||
import nixpkgs {
|
import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [self.overlays.default];
|
overlays = with self.overlays; [default];
|
||||||
};
|
};
|
||||||
|
|
||||||
# initialize nixpkgs for cross-compiling from `system` to `crossSystem`
|
# initialize nixpkgs for cross-compiling from `system` to `crossSystem`
|
||||||
crossPkgsFor = system: crossSystem:
|
crossPkgsFor = system: crossSystem:
|
||||||
(import nixpkgs {
|
(import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = with self.overlays; [
|
||||||
self.overlays.default
|
default
|
||||||
self.overlays.minimal
|
minimal
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
.pkgsCross
|
.pkgsCross
|
||||||
.${crossSystem};
|
.${crossSystem};
|
||||||
|
|
||||||
|
# initialize development nixpkgs for the specified `system`
|
||||||
|
devPkgsFor = system:
|
||||||
|
import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = with self.overlays; [default debug];
|
||||||
|
};
|
||||||
|
|
||||||
# build villas and its dependencies for the specified `pkgs`
|
# build villas and its dependencies for the specified `pkgs`
|
||||||
packagesWith = pkgs: rec {
|
packagesWith = pkgs: rec {
|
||||||
default = villas;
|
default = villas;
|
||||||
|
@ -128,6 +141,10 @@
|
||||||
# standard flake attribute allowing you to add the villas packages to your nixpkgs
|
# standard flake attribute allowing you to add the villas packages to your nixpkgs
|
||||||
overlays = {
|
overlays = {
|
||||||
default = final: prev: packagesWith final;
|
default = final: prev: packagesWith final;
|
||||||
|
debug = final: prev: {
|
||||||
|
jansson = addSeparateDebugInfo prev.jansson;
|
||||||
|
libmodbus = addSeparateDebugInfo prev.libmodbus;
|
||||||
|
};
|
||||||
minimal = final: prev: {
|
minimal = final: prev: {
|
||||||
mosquitto = prev.mosquitto.override {systemd = final.systemdMinimal;};
|
mosquitto = prev.mosquitto.override {systemd = final.systemdMinimal;};
|
||||||
rdma-core = prev.rdma-core.override {udev = final.systemdMinimal;};
|
rdma-core = prev.rdma-core.override {udev = final.systemdMinimal;};
|
||||||
|
@ -137,7 +154,7 @@
|
||||||
# standard flake attribute for defining developer environments
|
# standard flake attribute for defining developer environments
|
||||||
devShells = forSupportedSystems (
|
devShells = forSupportedSystems (
|
||||||
system: let
|
system: let
|
||||||
pkgs = pkgsFor system;
|
pkgs = devPkgsFor system;
|
||||||
shellHook = ''[ -z "$PS1" ] || exec "$SHELL"'';
|
shellHook = ''[ -z "$PS1" ] || exec "$SHELL"'';
|
||||||
hardeningDisable = ["all"];
|
hardeningDisable = ["all"];
|
||||||
packages = with pkgs; [bashInteractive bc boxfort criterion jq libffi libgit2 pcre];
|
packages = with pkgs; [bashInteractive bc boxfort criterion jq libffi libgit2 pcre];
|
||||||
|
|
Loading…
Add table
Reference in a new issue