blob: 2ff257ae2bf5b87aad3ad0bf850086ce289cd9c5 (
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
43
44
|
{
config,
lib,
pkgs,
inputs,
...
}:
let
cfg = config.server;
in
{
options.server = {
enable = lib.mkEnableOption "basic server settings";
};
imports = [
./host-user.nix
./mixins
];
config = lib.mkIf cfg.enable {
# all servers are most likely on stable, so we may want to pull some newer packages from time to time
_module.args.unstable = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
boot.tmp.cleanOnBoot = lib.mkDefault true;
# we don't need it here
documentation.enable = false;
environment.defaultPackages = lib.mkForce [ ];
nix = {
gc = {
# ~every 2 days
dates = "Mon,Wed,Fri *-*-* 00:00:00";
options = "-d --delete-older-than 2d";
};
# hardening access to `nix` on servers as no other users
# *should* ever really touch it
settings.allowed-users = [ config.networking.hostName ];
};
};
}
|