about summary refs log tree commit diff
path: root/machines/rpi3-amadeus/hyperion.nix
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-01-27 15:20:47 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-01-27 15:20:47 +0100
commite105f15292f5de776bcebac9972eaca296c236bd (patch)
treebe3a7643b3c6977f5a12bec0aea5f1b17d70844f /machines/rpi3-amadeus/hyperion.nix
parentb7c4edc5c3d154d8b488cc65e1c6eee171c0f74a (diff)
downloaddots-e105f15292f5de776bcebac9972eaca296c236bd.tar.gz
dots-e105f15292f5de776bcebac9972eaca296c236bd.zip
Add rpi config
Diffstat (limited to 'machines/rpi3-amadeus/hyperion.nix')
-rw-r--r--machines/rpi3-amadeus/hyperion.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/machines/rpi3-amadeus/hyperion.nix b/machines/rpi3-amadeus/hyperion.nix
new file mode 100644
index 0000000..531eaad
--- /dev/null
+++ b/machines/rpi3-amadeus/hyperion.nix
@@ -0,0 +1,32 @@
+{ pkgs, ... }:
+let
+  hyperion = pkgs.callPackage ./hyperion-ng.nix { };
+  hyperionConfig = pkgs.fetchurl {
+    url = "https://gist.githubusercontent.com/pniedzwiedzinski/e1810bc4dd08b97512d28c42daa95326/raw/460febec24390dc90d3b70987f07ef1ab8a77b3a/hyperion.config.json";
+    sha256 = "1yaiw8ljy6kaq6vnf5ccq2c4wpjlakd00nmq51v1q2sdnc06jmqq";
+  };
+in
+{
+  imports = [
+    ./spi.nix
+  ];
+
+  environment.systemPackages = [
+    hyperion
+  ];
+
+  systemd.services.hyperion = {
+    enable = true;
+    wantedBy = ["multi-user.target"];
+    serviceConfig = {
+      ExecStart = "${hyperion}/bin/hyperiond";
+      ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
+      Restart = "on-failure";
+      User = "root";
+      Group = "root";
+      Type = "simple";
+      UMask = "007";
+      TimeoutStopSec = "10";
+    };
+  };
+}