about summary refs log tree commit diff
path: root/ops
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-04-25T23·24+0100
committerVincent Ambo <tazjin@google.com>2020-04-25T23·28+0100
commit6644d0031da7af16effda4287ea2da17506ee415 (patch)
tree0cd32cf4f408c981143c1ffedfbd44f88d41f895 /ops
parent28bf77a1f12b720d4e1448434f3eda94814bcad4 (diff)
feat(fun/idual && nixos/camden): Add light alarm systemd units r/688
Adds a systemd unit to run the idual light alarm using a transient
timer created by systemd-run.
Diffstat (limited to 'ops')
-rw-r--r--ops/nixos/camden/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix
index 0528e5c3585b..f37d6a1f7884 100644
--- a/ops/nixos/camden/default.nix
+++ b/ops/nixos/camden/default.nix
@@ -1,5 +1,5 @@
 # This file configures camden.tazj.in, my homeserver.
-{ depot, lib, ... }:
+{ depot, pkgs, lib, ... }:
 
 config: let
   nixpkgs = import depot.third_party.nixpkgsSrc {
@@ -100,6 +100,7 @@ in lib.fix(self: {
   environment.systemPackages =
     # programs from the depot
     (with depot; [
+      fun.idual.setAlarm
       third_party.git
       third_party.honk
       third_party.pounce
@@ -347,5 +348,14 @@ in lib.fix(self: {
     };
   };
 
+  # Timer units that can be started with systemd-run to set my alarm.
+  systemd.user.services.light-alarm = {
+    script = "${depot.fun.idual.script}/bin/__init__.py";
+    postStart = "${pkgs.systemd}/bin/systemctl --user stop light-alarm.timer";
+    serviceConfig = {
+      Type = "oneshot";
+    };
+  };
+
   system.stateVersion = "19.09";
 })