mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
packaging-nix: fixes + format + format check
- format all `.nix` files using `alejandra` - check format on `nix flake check` - only `exec $SHELL` when bash is interactive Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
This commit is contained in:
parent
c194b621cb
commit
6a07f6f2da
4 changed files with 51 additions and 35 deletions
|
@ -37,8 +37,9 @@
|
|||
);
|
||||
in {
|
||||
formatter = forSupportedSystems (system: legacyPackages.${system}.alejandra);
|
||||
packages = forSupportedSystems (system:
|
||||
let pkgs = legacyPackages.${system};
|
||||
packages = forSupportedSystems (
|
||||
system: let
|
||||
pkgs = legacyPackages.${system};
|
||||
in rec {
|
||||
default = villas;
|
||||
|
||||
|
@ -62,23 +63,37 @@
|
|||
};
|
||||
}
|
||||
);
|
||||
devShells = forSupportedSystems (system:
|
||||
let pkgs = legacyPackages.${system};
|
||||
devShells = forSupportedSystems (
|
||||
system: let
|
||||
pkgs = legacyPackages.${system};
|
||||
shellHook = ''
|
||||
[ -z "$PS1" ] || exec $SHELL
|
||||
'';
|
||||
in rec {
|
||||
default = full;
|
||||
|
||||
minimal = pkgs.mkShell {
|
||||
inherit shellHook;
|
||||
name = "minimal";
|
||||
shellHook = "exec $SHELL";
|
||||
inputsFrom = [ pkgs.villas-minimal ];
|
||||
inputsFrom = [pkgs.villas-minimal];
|
||||
};
|
||||
|
||||
full = pkgs.mkShell {
|
||||
inherit shellHook;
|
||||
name = "full";
|
||||
shellHook = "exec $SHELL";
|
||||
inputsFrom = [ pkgs.villas ];
|
||||
inputsFrom = [pkgs.villas];
|
||||
};
|
||||
}
|
||||
);
|
||||
checks = forSupportedSystems (
|
||||
system: let
|
||||
pkgs = legacyPackages.${system};
|
||||
in {
|
||||
fmt = pkgs.runCommand "check-fmt" {} ''
|
||||
cd ${self}
|
||||
${pkgs.alejandra}/bin/alejandra --check . 2> $out
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
cmake,
|
||||
lib,
|
||||
stdenv,
|
||||
src
|
||||
src,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "lib60870";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
cmake,
|
||||
lib,
|
||||
stdenv,
|
||||
src
|
||||
src,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "libiec61850";
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
withNodeSocket ? withAllNodes,
|
||||
# dependencies
|
||||
comedilib,
|
||||
coreutils,
|
||||
curl,
|
||||
czmq,
|
||||
gnugrep,
|
||||
|
@ -48,7 +49,7 @@
|
|||
protobufc,
|
||||
rdkafka,
|
||||
rdma-core,
|
||||
spdlog
|
||||
spdlog,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "villas";
|
||||
|
@ -67,36 +68,36 @@ stdenv.mkDerivation {
|
|||
'';
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/villas \
|
||||
--set PATH ${lib.makeBinPath [(placeholder "out") gnugrep]}
|
||||
--set PATH ${lib.makeBinPath [(placeholder "out") gnugrep coreutils]}
|
||||
'';
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
makeWrapper
|
||||
pkg-config
|
||||
];
|
||||
buildInputs = [
|
||||
jansson
|
||||
libwebsockets
|
||||
libuuid
|
||||
openssl
|
||||
curl
|
||||
spdlog
|
||||
]
|
||||
++ lib.optionals withConfig [libconfig]
|
||||
++ lib.optionals withProtobuf [protobuf protobufc]
|
||||
++ lib.optionals withNodeComedi [comedilib]
|
||||
++ lib.optionals withNodeZeromq [czmq libsodium]
|
||||
++ lib.optionals withNodeIec60870 [lib60870]
|
||||
++ lib.optionals withNodeIec61850 [libiec61850]
|
||||
++ lib.optionals withNodeSocket [libnl]
|
||||
++ lib.optionals withNodeRtp [libre]
|
||||
++ lib.optionals withNodeUldaq [libuldaq]
|
||||
++ lib.optionals withNodeTemper [libusb]
|
||||
++ lib.optionals withNodeMqtt [mosquitto]
|
||||
++ lib.optionals withNodeNanomsg [nanomsg]
|
||||
++ lib.optionals withNodeKafka [rdkafka]
|
||||
++ lib.optionals withNodeInfiniband [rdma-core]
|
||||
;
|
||||
buildInputs =
|
||||
[
|
||||
jansson
|
||||
libwebsockets
|
||||
libuuid
|
||||
openssl
|
||||
curl
|
||||
spdlog
|
||||
]
|
||||
++ lib.optionals withConfig [libconfig]
|
||||
++ lib.optionals withProtobuf [protobuf protobufc]
|
||||
++ lib.optionals withNodeComedi [comedilib]
|
||||
++ lib.optionals withNodeZeromq [czmq libsodium]
|
||||
++ lib.optionals withNodeIec60870 [lib60870]
|
||||
++ lib.optionals withNodeIec61850 [libiec61850]
|
||||
++ lib.optionals withNodeSocket [libnl]
|
||||
++ lib.optionals withNodeRtp [libre]
|
||||
++ lib.optionals withNodeUldaq [libuldaq]
|
||||
++ lib.optionals withNodeTemper [libusb]
|
||||
++ lib.optionals withNodeMqtt [mosquitto]
|
||||
++ lib.optionals withNodeNanomsg [nanomsg]
|
||||
++ lib.optionals withNodeKafka [rdkafka]
|
||||
++ lib.optionals withNodeInfiniband [rdma-core];
|
||||
meta = with lib; {
|
||||
description = "a tool connecting real-time power grid simulation equipment";
|
||||
homepage = "https://villas.fein-aachen.org/";
|
||||
|
|
Loading…
Add table
Reference in a new issue