1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

nix: Move flake to top-level path

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel 2024-02-27 22:34:57 +01:00
parent b573644133
commit 1f756ac49e
3 changed files with 11 additions and 41 deletions

34
.envrc
View file

@ -1,36 +1,4 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
export_or_unset() use flake
{
local var=$1
if [ -z "${!var+x}" ]; then
return
fi
if [ -n "$2" ]; then
export $var="$2"
else
unset $var
fi
}
if direnv_version "2.30.0" \
&& has nix \
&& nix show-config experimental-features 2>/dev/null | grep -wqF flakes
then
local oldtmp="$TMP"
local oldtemp="$TEMP"
local oldtmpdir="$TMPDIR"
local oldtempdir="$TEMPDIR"
watch_file ./packaging/nix/*.nix
use flake ./packaging/nix
export_or_unset TMP "$oldtmp"
export_or_unset TEMP "$oldtemp"
export_or_unset TMPDIR "$oldtmpdir"
export_or_unset TEMPDIR "$oldtempdir"
fi

View file

@ -49,6 +49,8 @@
} @ inputs: let } @ inputs: let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
nixDir = ./packaging/nix;
# Add separateDebugInfo to a derivation # Add separateDebugInfo to a derivation
addSeparateDebugInfo = d: addSeparateDebugInfo = d:
d.overrideAttrs { d.overrideAttrs {
@ -97,12 +99,12 @@
packagesWith = pkgs: rec { packagesWith = pkgs: rec {
default = villas; default = villas;
villas-python = pkgs.callPackage ./python.nix { villas-python = pkgs.callPackage (nixDir + "/python.nix") {
src = ../../python; src = ./python;
}; };
villas-minimal = pkgs.callPackage ./villas.nix { villas-minimal = pkgs.callPackage (nixDir + "/villas.nix") {
src = ../..; src = ./.;
version = "minimal"; version = "minimal";
inherit (inputs) fpga common; inherit (inputs) fpga common;
}; };
@ -115,19 +117,19 @@
withAllNodes = true; withAllNodes = true;
}; };
ethercat = pkgs.callPackage ./ethercat.nix { ethercat = pkgs.callPackage (nixDir + "/ethercat.nix") {
src = inputs.ethercat; src = inputs.ethercat;
}; };
lib60870 = pkgs.callPackage ./lib60870.nix { lib60870 = pkgs.callPackage (nixDir + "/lib60870.nix") {
src = inputs.lib60870; src = inputs.lib60870;
}; };
libdatachannel = pkgs.callPackage ./libdatachannel.nix { libdatachannel = pkgs.callPackage (nixDir + "/libdatachannel.nix") {
src = inputs.libdatachannel; src = inputs.libdatachannel;
}; };
libiec61850 = pkgs.callPackage ./libiec61850.nix { libiec61850 = pkgs.callPackage (nixDir + "/libiec61850.nix") {
src = inputs.libiec61850; src = inputs.libiec61850;
}; };
}; };