summaryrefslogtreecommitdiff
path: root/home/environ/units.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/environ/units.nix')
-rw-r--r--home/environ/units.nix33
1 files changed, 33 insertions, 0 deletions
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";
+ };
+ };
+}