From 392e6768f9f60c761b65f8774c1667ab8d00f230 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 3 Jan 2021 01:14:47 +0100 Subject: gkleen@sif: systemd --- accounts/gkleen@sif/systemd.nix | 107 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 accounts/gkleen@sif/systemd.nix (limited to 'accounts/gkleen@sif/systemd.nix') diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix new file mode 100644 index 00000000..c6ec6f64 --- /dev/null +++ b/accounts/gkleen@sif/systemd.nix @@ -0,0 +1,107 @@ +{ pkgs, config, userName, ... }: +let + xmobar = import ./xmobar pkgs.haskellPackages; + cfg = config.home-manager.users.${userName}; +in { + services = { + "dynamic-forward@" = { + Service = { + WorkingDirectory = "~"; + ExecStart = "${pkgs.autossh}/bin/autossh -M 20000 -- -vN -o ControlMaster=no \"%I\""; + Environment = [ "AUTOSSH_POLL=30" "AUTOSSH_PIDFILE=.ssh/autossh.%i.pid" ]; + PIDFile = "~/.ssh/autossh.%i.pid"; + Restart = "on-failure"; + RestartSec = "30"; + }; + Install = { + WantedBy = ["default.target"]; + }; + }; + sync-keepass = { + Service = { + Type = "oneshot"; + WorkingDirectory = "~"; + ExecStart = "${pkgs.lftp}/bin/lftp -f ${./store.kdbx.lftp}"; + }; + }; + urxvtd = { + Service = { + Type = "simple"; + WorkingDirectory = "~"; + ExecStart = "${cfg.programs.urxvt.package}/bin/urxvtd"; + Restart = "always"; + }; + Unit = { + After = ["graphical-session.target"]; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + emacs = { + Unit = { + After = ["graphical-session-pre.target"]; + }; + }; + trayer = { + Service = { + Type = "simple"; + WorkingDirectory = "~"; + ExecStart = "${pkgs.trayer}/bin/trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 8 --tint 0x000000 --alpha 0 --transparent true --height 32 --monitor primary"; + Restart = "always"; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + xmobar = { + Service = { + Type = "simple"; + WorkingDirectory = "~"; + ExecStart = "${xmobar}/bin/xmobar"; + Restart = "always"; + Environment = "PATH=${pkgs.worktime}/bin:${pkgs.openssh}/bin"; + + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + dunst = { + Service = { + Restart = "always"; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + xiccd = { + Service = { + Type = "simple"; + WorkingDirectory = "~"; + ExecStart = "${pkgs.xiccd}/bin/xiccd"; + Restart = "always"; + }; + }; + }; + timers = { + sync-keepass = { + Timer = { + OnActiveSec = "1m"; + OnUnitActiveSec = "1m"; + }; + + Install = { + WantedBy = ["default.target"]; + }; + }; + }; + targets = { + graphical-session = { + Unit = { + BindsTo = ["default.target"]; + After = ["basic.target"]; + }; + }; + }; +} -- cgit v1.2.3