Fix overwritting OPEN_HAB env
This commit is contained in:
14
openhab.nix
14
openhab.nix
@@ -10,19 +10,19 @@
|
|||||||
zip,
|
zip,
|
||||||
unzip,
|
unzip,
|
||||||
stdenv,
|
stdenv,
|
||||||
}:
|
gnused,
|
||||||
|
}: let
|
||||||
let
|
|
||||||
version = builtins.readFile ./version;
|
version = builtins.readFile ./version;
|
||||||
sha256 = builtins.readFile ./openhab.sha256;
|
sha256 = builtins.readFile ./openhab.sha256;
|
||||||
in stdenv.mkDerivation rec {
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
inherit version;
|
inherit version;
|
||||||
pname = "openhab";
|
pname = "openhab";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [makeWrapper gnused];
|
||||||
buildInputs = [bash];
|
buildInputs = [bash];
|
||||||
outputs = ["out"];
|
outputs = ["out"];
|
||||||
extraPath = lib.makeBinPath [jdk-openhab gawk coreutils procps zip unzip];
|
extraPath = lib.makeBinPath [jdk-openhab gawk coreutils procps zip unzip];
|
||||||
@@ -66,6 +66,10 @@ in stdenv.mkDerivation rec {
|
|||||||
mv "$out/$exe".new "$out/$exe"
|
mv "$out/$exe".new "$out/$exe"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Fix OPENHAB_HOME overwritting
|
||||||
|
sed '6d' "$out/runtime/bin/oh_dir_layout" | sed '6i if [ -z ''${OPENHAB_HOME} ]; then\n\texport OPENHAB_HOME=`cd "$DIRNAME/../.."; pwd`\nfi' > "$out/runtime/bin/oh_dir_layout.new"
|
||||||
|
mv "$out/runtime/bin/oh_dir_layout.new" "$out/runtime/bin/oh_dir_layout"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user