Fix overwritting OPEN_HAB env
This commit is contained in:
14
openhab.nix
14
openhab.nix
@@ -10,19 +10,19 @@
|
||||
zip,
|
||||
unzip,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
let
|
||||
gnused,
|
||||
}: let
|
||||
version = builtins.readFile ./version;
|
||||
sha256 = builtins.readFile ./openhab.sha256;
|
||||
in stdenv.mkDerivation rec {
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
pname = "openhab";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
nativeBuildInputs = [makeWrapper gnused];
|
||||
buildInputs = [bash];
|
||||
outputs = ["out"];
|
||||
extraPath = lib.makeBinPath [jdk-openhab gawk coreutils procps zip unzip];
|
||||
@@ -66,6 +66,10 @@ in stdenv.mkDerivation rec {
|
||||
mv "$out/$exe".new "$out/$exe"
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user