2021-12-21 21:48:41 +00:00
|
|
|
{ config, lib, pkgs, ... }: {
|
2021-12-21 22:18:14 +00:00
|
|
|
imports = [ ./users ./microcode.nix ];
|
2021-12-21 21:48:41 +00:00
|
|
|
|
|
|
|
boot.cleanTmpDir = true;
|
|
|
|
boot.kernelModules = [ "wireguard" ];
|
|
|
|
|
2021-12-26 17:01:31 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
age
|
|
|
|
minisign
|
|
|
|
tmate
|
|
|
|
jq
|
|
|
|
nfs-utils
|
|
|
|
git
|
|
|
|
];
|
2021-12-21 21:48:41 +00:00
|
|
|
|
|
|
|
nix = {
|
|
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
|
2022-02-19 20:34:01 +00:00
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
sandbox = true;
|
|
|
|
substituters =
|
|
|
|
[ "https://xe.cachix.org" "https://nix-community.cachix.org" ];
|
|
|
|
trusted-users = [ "root" "cadey" ];
|
|
|
|
trusted-public-keys = [
|
|
|
|
"xe.cachix.org-1:kT/2G09KzMvQf64WrPBDcNWTKsA79h7+y2Fn2N7Xk2Y="
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
};
|
2021-12-21 21:48:41 +00:00
|
|
|
};
|
|
|
|
|
2022-02-23 17:11:13 +00:00
|
|
|
services.prometheus.exporters.node.enabledCollectors = [ "systemd" ];
|
|
|
|
|
2021-12-21 21:48:41 +00:00
|
|
|
security.pam.loginLimits = [{
|
|
|
|
domain = "*";
|
|
|
|
type = "soft";
|
|
|
|
item = "nofile";
|
|
|
|
value = "unlimited";
|
|
|
|
}];
|
|
|
|
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
SystemMaxUse=100M
|
|
|
|
MaxFileSec=7day
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.resolved = {
|
|
|
|
enable = true;
|
|
|
|
dnssec = "false";
|
|
|
|
};
|
2021-12-26 17:01:31 +00:00
|
|
|
|
2021-12-26 18:46:17 +00:00
|
|
|
systemd.services.nginx.serviceConfig.SupplementaryGroups = "within";
|
2021-12-26 18:38:26 +00:00
|
|
|
|
2021-12-26 17:01:31 +00:00
|
|
|
users.groups.within = { };
|
2021-12-26 18:33:00 +00:00
|
|
|
systemd.services."within.homedir-setup" = {
|
2021-12-26 17:01:31 +00:00
|
|
|
description = "Creates homedirs for /srv/within services";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
|
|
|
|
script = with pkgs; ''
|
|
|
|
${coreutils}/bin/mkdir -p /srv/within
|
|
|
|
${coreutils}/bin/chown root:within /srv/within
|
|
|
|
${coreutils}/bin/chmod 775 /srv/within
|
|
|
|
${coreutils}/bin/mkdir -p /srv/within/run
|
|
|
|
${coreutils}/bin/chown root:within /srv/within/run
|
|
|
|
${coreutils}/bin/chmod 770 /srv/within/run
|
|
|
|
'';
|
|
|
|
};
|
2021-12-21 21:48:41 +00:00
|
|
|
}
|