summaryrefslogtreecommitdiffstats
path: root/lass/2configs/hass/pyscript/shell.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-09-11 14:55:04 +0200
committertv <tv@krebsco.de>2023-09-11 14:55:04 +0200
commit8fc162ee3d9525a2b45346a1ca8f34ccb5ef971b (patch)
treeaa37724dd0452860d4b9b033332587c8832629e3 /lass/2configs/hass/pyscript/shell.nix
parent90b1515dcd5b67a85cd92901fb211764b1fa5f83 (diff)
parent083229d0211096daec08673f743ccc45b1d8a0ac (diff)
Merge remote-tracking branch 'orange/master'
Diffstat (limited to 'lass/2configs/hass/pyscript/shell.nix')
-rw-r--r--lass/2configs/hass/pyscript/shell.nix51
1 files changed, 0 insertions, 51 deletions
diff --git a/lass/2configs/hass/pyscript/shell.nix b/lass/2configs/hass/pyscript/shell.nix
deleted file mode 100644
index 3cfac0275..000000000
--- a/lass/2configs/hass/pyscript/shell.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ pkgs ? import <nixpkgs> {} }: 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