From 23214ff78f0d9baccd26cd151ec2c79b481dac98 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Fri, 13 Oct 2023 13:57:49 +0200 Subject: [PATCH] deleted unused file --- nix/hm-module.nix | 70 ----------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 nix/hm-module.nix diff --git a/nix/hm-module.nix b/nix/hm-module.nix deleted file mode 100644 index c04271e..0000000 --- a/nix/hm-module.nix +++ /dev/null @@ -1,70 +0,0 @@ -self: { - config, - lib, - pkgs, - ... -}: let - cfg = config.dyn-gandi; - package = self.packages.${pkgs.stdenv.hostPlatform.system}.default; - inherit (lib) mkIf mkEnableOption mkOption types; - - format = pkgs.formats.json {}; - configFile = format.generate "config.json" cfg.settings; -in { - options.dyn-gandi = { - enable = mkEnableOption "dyn-gandi"; - - timer = lib.mkOption { - type = types.nullOr types.int; - default = null; - description = lib.mdDoc '' - The time intervall in seconds the script should be repeated. - ''; - }; - - settings = mkOption { - type = with types; let - valueType = nullOr (oneOf [ - # TODO: restrict type to actual config file structure - bool - int - float - str - path - (attrsOf valueType) - (listOf valueType) - ]); - in - valueType; - default = throw "Please specify dyn-gandi.settings"; - }; - }; - - config = mkIf cfg.enable { - home.packages = [package]; # TODO: make this architecture independent - - systemd.user.services.dyn-gandi = mkIf (cfg.timer - != null) { - Unit = { - After = ["network.target"]; - }; - - Install = {WantedBy = ["default.target"];}; - - Service = { - Type = "oneshot"; - ExecStart = "${package}/bin/dyn_gandi --config ${configFile}"; - }; - }; - - systemd.user.timers.dyn-gandi = mkIf (cfg.timer - != null) { - Install = {WantedBy = ["timers.target"];}; - Timer = { - OnBootSec = "0s"; - OnUnitActiveSec = "${toString cfg.timer}s"; - Unit = "dyn-gandi.service"; - }; - }; - }; -}