From 05571aa5ed5eb898be468bff237657914f7e9dcf Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 29 Apr 2018 15:00:53 +0200 Subject: Delay startup of non-essential services --- modules/hardware/laptop.nix | 13 ++++++++++++- modules/hardware/nitrokey.nix | 10 +++++++++- modules/hardware/printing.nix | 9 +++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) (limited to 'modules/hardware') diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix index bd08308..c662885 100644 --- a/modules/hardware/laptop.nix +++ b/modules/hardware/laptop.nix @@ -6,7 +6,18 @@ ]; hardware = { - bluetooth.enable = true; + bluetooth = { + enable = true; + powerOnBoot = false; + }; + }; + systemd.services.bluetooth.wantedBy = lib.mkForce []; + systemd.timers.bluetooth = { + description = "Delayed startup of Bluetooth"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; }; environment.systemPackages = with pkgs; [ diff --git a/modules/hardware/nitrokey.nix b/modules/hardware/nitrokey.nix index ec25d8e..22e9d76 100644 --- a/modules/hardware/nitrokey.nix +++ b/modules/hardware/nitrokey.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { programs.ssh.startAgent = false; @@ -26,6 +26,14 @@ enable = true; }; }; + systemd.services.tor.wantedBy = lib.mkForce []; + systemd.timers.tor = { + description = "Delayed startup of Tor"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "1 min"; + }; + }; environment.systemPackages = with pkgs; [ gnupg diff --git a/modules/hardware/printing.nix b/modules/hardware/printing.nix index 32aa403..96d3a95 100644 --- a/modules/hardware/printing.nix +++ b/modules/hardware/printing.nix @@ -3,6 +3,15 @@ { services.printing.enable = true; systemd.services.cups.wantedBy = lib.mkForce []; systemd.sockets.cups.wantedBy = [ "sockets.target" ]; + systemd.services.cups-browsed.wantedBy = lib.mkForce []; + + systemd.timers.cups-browsed = { + description = "Delayed startup of CUPS Remote Printer Discovery"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "2 min"; + }; + }; imports = [ ../services/zeroconf.nix -- cgit 1.4.1