From c0c867477cd1db39b1d5c56ebe0e98de10686e0a Mon Sep 17 00:00:00 2001 From: Paul Zinselmeyer Date: Wed, 28 Aug 2024 22:58:04 +0200 Subject: [PATCH] module change --- flake.nix | 2 +- module.nix | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index c9c3041..52ecdaa 100644 --- a/flake.nix +++ b/flake.nix @@ -114,6 +114,6 @@ }; }) // { - nixosModules.thekenlicht-daemon = ./module.nix; + nixosModules.thekenlicht-daemon = (import ./module.nix {flake=self;}); }; } diff --git a/module.nix b/module.nix index 4c80b9e..09fc183 100644 --- a/module.nix +++ b/module.nix @@ -1,3 +1,4 @@ +{flake}: { self, config, pkgs, lib, ... }: let cfg = config.services.thekenlicht-daemon; @@ -6,7 +7,10 @@ in options = { services.thekenlicht-daemon = { enable = lib.mkEnableOption "Enable Module"; - serialPort = lib.mkStringOption "Serial Port"; + serialPort = lib.mkOption { + description = "Serial Port"; + type = lib.types.uniq lib.types.str; + }; }; }; @@ -14,7 +18,7 @@ in systemd.services.thekenlicht-daemon = { description = "converts artnet to serial thekenlicht commands"; wantedBy = [ "multi-user.target" ]; - serviceConfig.ExecStart = "${self.packages.thekenlicht-daemon}/bin/thekenlicht-daemon ${cfg.serialPort}"; + serviceConfig.ExecStart = "${flake.packages.${pkgs.system}.default}/bin/thekenlicht-daemon ${cfg.serialPort}"; serviceConfig.Restart = "on-failure"; }; };