From 2e5167de1560ad0d7b8e294c72e1913f694160c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 7 Sep 2023 12:26:31 +0200 Subject: lass: migrate away --- lass/2configs/hass/pyscript/shell.nix | 51 ----------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 lass/2configs/hass/pyscript/shell.nix (limited to 'lass/2configs/hass/pyscript/shell.nix') diff --git a/lass/2configs/hass/pyscript/shell.nix b/lass/2configs/hass/pyscript/shell.nix deleted file mode 100644 index 3cfac027..00000000 --- a/lass/2configs/hass/pyscript/shell.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs ? import {} }: let - - hass_host = "styx.r"; - hass_token = builtins.readFile ./hass_token; - - mach-nix = import (builtins.fetchGit { - url = "https://github.com/DavHau/mach-nix/"; - ref = "refs/tags/3.4.0"; - }) { - pkgs = pkgs; - }; - pyenv = mach-nix.mkPython { - requirements = '' - hass_pyscript_kernel - ''; - }; - jupyter = import (builtins.fetchGit { - url = https://github.com/tweag/jupyterWith; - ref = "master"; - }) {}; - - pyscriptKernel = { - spec = pkgs.runCommand "pyscript" {} '' - mkdir -p $out/kernels/pyscript - cp ${kernel_json} $out/kernels/pyscript/kernel.json - cp ${pyscript_conf} $out/kernels/pyscript/pyscript.conf - ''; - runtimePackages = [ pyenv ]; - }; - - kernel_json = pkgs.writeText "kernel.json" (builtins.toJSON { - argv = [ - "${pyenv}/bin/python3" "-m" "hass_pyscript_kernel" - "-f" "{connection_file}" - ]; - display_name = "hass_pyscript"; - language = "python"; - }); - - pyscript_conf = pkgs.writeText "pyscript.conf" '' - [homeassistant] - hass_host = ${hass_host} - hass_url = http://''${hass_host}:8123 - hass_token = ${hass_token} - ''; - - jupyterEnvironment = jupyter.jupyterlabWith { - kernels = [ pyscriptKernel ]; - }; - -in jupyterEnvironment.env -- cgit v1.2.3