From 6c555ba21c69d0ce48ca3a7333610dcb78cd9cde Mon Sep 17 00:00:00 2001 From: tobinio Date: Tue, 28 Jul 2026 16:49:37 +0200 Subject: [PATCH] add lightcontroller --- flake.lock | 35 ++++++++++++++++++++++ flake.nix | 2 ++ hosts/homeserver/configuration.nix | 1 + hosts/homeserver/services/lightcontrol.nix | 19 ++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 hosts/homeserver/services/lightcontrol.nix diff --git a/flake.lock b/flake.lock index f984d68..bc25250 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,24 @@ "url": "https://tangled.org/tobinio.dev/hydration-notifier" } }, + "lightcontrol": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1785243890, + "narHash": "sha256-ho8mmpI3HYserPNz2y9NoM7mSZhO+WtBXBzS+xLiBLY=", + "ref": "refs/heads/main", + "rev": "8d00a26873b278fe836bd0f3131bd62388f0855a", + "revCount": 38, + "type": "git", + "url": "https://tangled.org/tobinio.dev/light-control" + }, + "original": { + "type": "git", + "url": "https://tangled.org/tobinio.dev/light-control" + } + }, "nixpkgs": { "locked": { "lastModified": 1784707089, @@ -66,9 +84,26 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1785090369, + "narHash": "sha256-m0pDuRJG7EDo9ri+4Ksu83VsI+PlxNC9lNBfydejce4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "624af665418d3c65d544145b4d34ad696439570e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "hydration-notifier": "hydration-notifier", + "lightcontrol": "lightcontrol", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", diff --git a/flake.nix b/flake.nix index d3e9d18..7a4bf7a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,8 @@ inputs.nixpkgs.follows = "nixpkgs-stable"; }; + lightcontrol.url = "git+https://tangled.org/tobinio.dev/light-control"; + zen-browser = { url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs-unstable"; diff --git a/hosts/homeserver/configuration.nix b/hosts/homeserver/configuration.nix index 80d62d5..1c4cf0f 100644 --- a/hosts/homeserver/configuration.nix +++ b/hosts/homeserver/configuration.nix @@ -22,6 +22,7 @@ ./services/nextcloud.nix ./services/backup.nix ./services/modrinth-statistics.nix + ./services/lightcontrol.nix # Common modules ../../shared/fish.nix diff --git a/hosts/homeserver/services/lightcontrol.nix b/hosts/homeserver/services/lightcontrol.nix new file mode 100644 index 0000000..2650bde --- /dev/null +++ b/hosts/homeserver/services/lightcontrol.nix @@ -0,0 +1,19 @@ +{ config, pkgs, inputs, ... }: +{ + systemd.services.lightcontrol = { + description = "LightControl"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${inputs.lightcontrol.packages.${pkgs.system}.backend}/bin/backend"; + + Environment = [ + "DEVICE_STORAGE_PATH=/srv/apps/lightcontrol/devices.json" + "STATIC_FILES_DIR=${inputs.lightcontrol.packages.${pkgs.system}.frontend}" + "WEB_PORT=8080" + "TCP_PORT=1234" + ]; + }; + }; +} -- 2.51.2