about summary refs log tree commit diff
path: root/modules/common/systemd.nix
blob: 81df05c14362a0d999aa1d63824aac33f9777bb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  config,
  pkgs,
  lib,
  ...
}:
with lib;
{
  ark = {
    files = [ "/etc/machine-id" ];
    directories = [ "/var/lib/systemd/coredump" ];
  };

  my.extraGroups = [ "systemd-journal" ];

  hm.systemd.user.startServices = "sd-switch";

  boot.initrd.systemd = {
    enable = true;
    network = {
      inherit (config.systemd.network) enable;
    };
  };

  services = {
    resolved = {
      llmnr = "false";
      dnsovertls = "opportunistic";
      domains = mapAttrsToList (_: v: v) my.domain;
      fallbackDns = map (v: "${v}#dns.quad9.net") dns.const.quad9.default;
    };

    journald.extraConfig = ''
      SystemMaxUse=5G
    '';
  };

  systemd =
    let
      extraConfig = ''
        DefaultTimeoutStartSec=30s
        DefaultTimeoutStopSec=15s
      '';
    in
    {
      inherit extraConfig;
      user = {
        inherit extraConfig;
      };
    };

  environment.variables = {
    SYSTEMD_PAGERSECURE = "1";
    SYSTEMD_PAGER = "${pkgs.less}/bin/less";
    SYSTEMD_LESS = "FRSXMK";
  };
}

Consider giving Nix/NixOS a try! <3