summaryrefslogtreecommitdiff
path: root/modules/nixos/base/default.nix
blob: 30e75d900100bb450d7f0ff0ee5e71b4a68d0dbe (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
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.base;
in
{
  imports = [
    ../../shared
    ./networking.nix
    ./nix.nix
    ./programs.nix
    ./security.nix
    ./users.nix
  ];

  config = lib.mkIf cfg.enable {
    services.journald.extraConfig = ''
      MaxRetentionSec=1w
    '';

    system.activationScripts."upgrade-diff" = {
      supportsDryActivation = true;
      text = ''
        ${lib.getExe pkgs.nvd} \
          --nix-bin-dir=${config.nix.package}/bin \
          diff /run/current-system "$systemConfig"
      '';
    };
  };
}