From 61f3db56410f41d5249c88e44db60d9713dae26d Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Tue, 3 Dec 2024 21:19:39 -0600 Subject: home: big refactor --- home/environ/units.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 home/environ/units.nix (limited to 'home/environ/units.nix') diff --git a/home/environ/units.nix b/home/environ/units.nix new file mode 100644 index 0000000..bb039b7 --- /dev/null +++ b/home/environ/units.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: +with lib; let + cfg = config.local.environ; +in +{ + config = mkIf cfg.enable { + systemd.user = { + timers = { + units-cur = { + Install.WantedBy = [ "timers.target" ]; + Timer.OnCalendar = "daily"; + Unit.Description = "Update currency information for 'units'"; + }; + }; + + services = { + units-cur = { + Unit.Description = "Update currency information for 'units'"; + + Service = { + Type = "exec"; + ExecStart = "${pkgs.units}/bin/units_cur .units"; + }; + }; + }; + }; + + home.file = { + #TODO: .calc_history + ".units_history".source = config.lib.file.mkOutOfStoreSymlink "/dev/null"; + }; + }; +} -- cgit v1.2.3