summaryrefslogtreecommitdiff
path: root/modules/nixos/profiles/headless.nix
blob: 9faf5310f350e0829c7d693ac817dfaac993c20b (plain)
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
{
  config,
  lib,
  pkgs,
  this,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.profiles.headless;
in {
  config = mkIf cfg.enable {
    nixfiles.modules = {
      openssh.server.enable = true;
      endlessh-go.enable = true;

      fail2ban.enable = true;

      node-exporter.enable = true;
      promtail.enable = true;
    };

    # Pin version to prevent any surprises.
    boot.kernelPackages = pkgs.linuxPackages_5_15_hardened;

    nix = {
      gc = {
        automatic = true;
        dates = "weekly";
        options = "--delete-older-than 30d";
      };

      optimise = {
        automatic = true;
        dates = ["daily"];
      };
    };

    services.udisks2.enable = false;

    xdg.sounds.enable = false;
  };
}