infrastructure/nixos/common/default.nix

83 lines
2.4 KiB
Nix
Raw Normal View History

2022-09-26 14:08:44 +02:00
{ config, lib, pkgs, inputs, ... }:
2021-10-13 18:17:45 +02:00
{
imports = [
2022-07-30 18:02:40 +02:00
inputs.vault-secrets.nixosModules.vault-secrets
2021-10-13 18:17:45 +02:00
# User account definitions
./users
2022-09-27 14:05:24 +02:00
./modules
2021-10-13 18:17:45 +02:00
];
# Clean /tmp on boot.
boot.cleanTmpDir = true;
# Set your time zone.
2022-08-20 12:16:29 +02:00
time.timeZone = lib.mkDefault "Europe/Amsterdam";
2021-10-13 18:17:45 +02:00
2022-09-29 21:14:34 +02:00
# Systemd OOMd
# Fedora enables these options by default. See the 10-oomd-* files here:
# https://src.fedoraproject.org/rpms/systemd/tree/acb90c49c42276b06375a66c73673ac3510255
systemd.oomd = {
enableRootSlice = true;
enableUserServices = true;
};
2021-10-13 18:17:45 +02:00
# Nix Settings
nix = {
2022-09-26 14:08:44 +02:00
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
2021-10-13 18:17:45 +02:00
package = pkgs.nixUnstable;
2022-08-23 22:31:19 +02:00
registry.nixpkgs.flake = inputs.nixpkgs;
2022-03-31 12:25:45 +02:00
settings = {
auto-optimise-store = true;
trusted-users = [ "root" "victor" ];
substituters = [
"https://cachix.cachix.org"
"https://nix-community.cachix.org"
"https://nixpkgs-review-bot.cachix.org"
2022-07-30 18:02:40 +02:00
"https://colmena.cachix.org"
2022-08-24 18:17:29 +02:00
"https://hyprland.cachix.org"
2022-09-09 20:48:13 +02:00
"https://0x76-infra.cachix.org"
2022-09-18 10:59:15 +02:00
"https://webcord.cachix.org"
2022-03-31 12:25:45 +02:00
];
trusted-public-keys = [
"cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-review-bot.cachix.org-1:eppgiDjPk7Hkzzz7XlUesk3rcEHqNDozGOrcLc8IqwE="
2022-07-30 18:02:40 +02:00
"colmena.cachix.org-1:7BzpDnjjH8ki2CT3f6GdOk7QAzPOl+1t3LvTLXqYcSg="
2022-08-24 18:17:29 +02:00
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
2022-09-09 20:48:13 +02:00
"0x76-infra.cachix.org-1:dC1qp+VEN3jj5pdK4URlXR9hf3atT+MnpKGu6PZjMc8="
2022-09-18 10:59:15 +02:00
"webcord.cachix.org-1:l555jqOZGHd2C9+vS8ccdh8FhqnGe8L78QrHNn+EFEs="
2022-03-31 12:25:45 +02:00
];
2022-07-30 18:02:40 +02:00
};
optimise = {
automatic = true;
dates = [ "weekly" ];
2022-07-30 18:02:40 +02:00
};
2021-10-13 18:17:45 +02:00
extraOptions = ''
2022-03-31 12:25:45 +02:00
experimental-features = nix-command flakes
2021-10-13 18:17:45 +02:00
'';
};
nixpkgs.config.allowUnfree = true;
# Limit the systemd journal to 100 MB of disk or the
# last 7 days of logs, whichever happens first.
services.journald.extraConfig = ''
SystemMaxUse=100M
MaxFileSec=7day
'';
2021-11-21 14:35:09 +01:00
# Enable SSH daemon support.
2021-11-23 17:44:00 +01:00
services.openssh = {
enable = true;
passwordAuthentication = false;
permitRootLogin = "no";
};
2021-11-21 14:35:09 +01:00
2022-07-30 23:35:52 +02:00
vault-secrets = lib.mkIf (config.networking.domain == "olympus") {
2022-09-25 15:17:55 +02:00
vaultPrefix = "olympus_secrets/nixos";
2021-11-23 14:26:40 +01:00
vaultAddress = "http://vault.olympus:8200/";
2021-11-22 00:10:21 +01:00
approlePrefix = "olympus-${config.networking.hostName}";
};
2021-10-13 18:17:45 +02:00
}