This repository was archived by the owner on Jun 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.nix
108 lines (92 loc) · 1.98 KB
/
common.nix
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
config,
inputs',
inputs,
lib,
pkgs,
self',
self,
...
}: let
inherit (lib) mkDefault mkForce attrsets;
in {
imports = [
./hardening.nix
./modules
inputs.agenix.nixosModules.default
];
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
flake-registry = "";
log-lines = 500;
show-trace = true;
trusted-users = ["root" "@wheel"];
max-free = 20 * 1024 * 1024 * 1024;
min-free = 5 * 1024 * 1024 * 1024;
};
gc = {
automatic = mkDefault true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
boot = {
kernelParams = ["boot.shell_on_fail"];
kernel.sysctl = {
"vm.page-cluster" = 0;
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
};
tmp = {
useTmpfs = true;
tmpfsSize = "200%";
};
};
zramSwap = {
enable = true;
memoryPercent = 200;
};
networking = {
nameservers = ["1.1.1.1" "8.8.8.8"];
hosts = attrsets.listToAttrs (map (entry: {
name = entry.value;
value = [entry.name];
}) (attrsets.attrsToList (import ../shared/hostnames.nix)));
};
security.sudo.extraConfig = ''
Defaults:root,%wheel timestamp_timeout=10
'';
services = {
getty = {
greetingLine = ''>>> NixOS ${config.system.nixos.label} (\m) - \l'';
helpLine = mkForce "";
};
openssh.enable = mkDefault true;
};
programs.command-not-found.enable = false;
environment = {
systemPackages = with pkgs;
[
bandwhich
btop
btrfs-map-physical
btrfs-progs
duf
ethtool
iotop-c
tcpdump
whois
]
++ (import ../shared/packages.nix {
inherit config inputs' pkgs self';
});
etc."nixos/current".source = lib.cleanSource ./..;
};
system.configurationRevision = self.rev or self.dirtyRev;
}