diff --git a/hosts/workstation/systemd.nix b/hosts/workstation/systemd.nix index f83ef11..c56dd15 100644 --- a/hosts/workstation/systemd.nix +++ b/hosts/workstation/systemd.nix @@ -1,16 +1,19 @@ -{ pkgs, lib, ... }: -let +{ + pkgs, + lib, + ... +}: let readlink = "${pkgs.coreutils}/bin/readlink"; notify-send = "${pkgs.libnotify}/bin/notify-send"; in { systemd = { services = { - systemd-lock-handler = { enable = true; }; + systemd-lock-handler = {enable = true;}; NetworkManager-wait-online.enable = lib.mkForce false; systemd-networkd-wait-online.enable = lib.mkForce false; clean-keychain = { description = "Clean up .keychain on boot"; - wantedBy = [ "multi-user.target" ]; + wantedBy = ["multi-user.target"]; serviceConfig = { Type = "oneshot"; ExecStart = "${pkgs.coreutils-full}/bin/rm -rf /home/don/.keychain"; @@ -21,15 +24,14 @@ in { services = { swaylock = { description = "Screen locker for Wayland"; - documentation = [ "man:swaylock(1)" ]; - onSuccess = [ "unlock.target" ]; - partOf = [ "lock.target" ]; - before = [ "lock.target" ]; - wantedBy = [ "lock.target" ]; + documentation = ["man:swaylock(1)"]; + onSuccess = ["unlock.target"]; + partOf = ["lock.target"]; + before = ["lock.target"]; + wantedBy = ["lock.target"]; serviceConfig = { Type = "forking"; - Environment = - "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; + Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; ExecStart = "/home/don/bin/lock.sh -m"; Restart = "on-failure"; RestartSec = 0; @@ -46,31 +48,30 @@ in { ${notify-send} --urgency=low --icon=system-reboot "Reboot is needed for a NixOS upgrade." fi ''; - serviceConfig = { Type = "oneshot"; }; + serviceConfig = {Type = "oneshot";}; }; check-nic = { description = "Adjust tailscale MTU based on location"; - unitConfig = { Type = "simple"; }; + unitConfig = {Type = "simple";}; serviceConfig = { Type = "oneshot"; - Environment = - "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; + Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; ExecStart = "/home/don/bin/check-nic"; }; }; }; timers = { check-nic = { - wantedBy = [ "timers.target" ]; - partOf = [ "check-nic.service" ]; + wantedBy = ["timers.target"]; + partOf = ["check-nic.service"]; timerConfig = { OnCalendar = "1m"; Unit = "check-nic.service"; }; }; detect-reboot-for-upgrade = { - wantedBy = [ "timers.target" ]; - partOf = [ "detect-reboot-for-upgrade.service" ]; + wantedBy = ["timers.target"]; + partOf = ["detect-reboot-for-upgrade.service"]; timerConfig = { OnCalendar = "hourly"; Unit = "detect-reboot-for-upgrade.service";