nix-git/modules/base.nix

101 lines
3.5 KiB
Nix
Raw Normal View History

2023-09-02 15:33:36 +02:00
{ config, pkgs, ... }:
{
2023-09-20 23:02:49 +02:00
# Firmware.
2023-09-25 22:52:32 +02:00
#
2024-02-04 14:53:41 +01:00
# The list of hardware.enableAllFirmware contains non-redistributable licensed firmware files.
# This requires nixpkgs.config.allowUnfree to be true.
# An alternative is to use the hardware.enableRedistributableFirmware option.
hardware.enableAllFirmware = false;
#
2023-09-20 23:02:49 +02:00
# Enables e.g. Intel microcode updates.
2023-09-25 22:52:32 +02:00
# Defaults to `config.hardware.enableAllFirmware`.
2024-02-04 14:53:41 +01:00
hardware.enableRedistributableFirmware = true;
2023-09-25 22:52:32 +02:00
# Allow unfree packages.
2024-02-04 14:53:41 +01:00
nixpkgs.config.allowUnfree = false;
2023-09-20 23:02:49 +02:00
2023-09-02 15:33:36 +02:00
# Enables wireless support via wpa_supplicant.
# networking.wireless.enable = true;
# Enable networking.
networking.networkmanager.enable = true;
2023-09-16 12:53:10 +02:00
networking.nameservers = [
# https://www.kuketz-blog.de/empfehlungsecke/#dns
# dot.ffmuc.net (supports DNSSEC)
"5.1.66.255" "185.150.99.255"
# https://www.kuketz-blog.de/empfehlungsecke/#dns
# unfiltered.adguard-dns.com (supports DNSSEC)
"94.140.14.140" "94.140.14.141"
];
2023-09-02 15:33:36 +02:00
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
2023-10-24 20:06:36 +02:00
console = {
#font = "Lat2-Terminus16";
# Configure console keymap.
keyMap = "de-latin1-nodeadkeys";
};
2023-09-02 15:33:36 +02:00
2023-11-03 15:22:09 +01:00
# Define a user account.
# Don't forget to set a password with `passwd`.
2023-09-02 15:33:36 +02:00
users.users.yoda = {
isNormalUser = true;
description = "Yoda";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
# Nix dependency management.
niv
];
};
2023-09-17 15:34:06 +02:00
# SystemMaxFileSize: Defaults to one eighth of the values configured with SystemMaxUse= and RuntimeMaxUse=, so that usually seven rotated journal files are kept as history.
# MaxFileSec: To ensure that not too much data is lost at once when old journal files are deleted, it might make sense to change this value from the default of one month.
# https://www.freedesktop.org/software/systemd/man/journald.conf.html
services.journald.extraConfig = ''
SystemMaxUse=800M
MaxFileSec=7day
'';
2023-09-02 15:33:36 +02:00
nix.settings.auto-optimise-store = true;
2023-10-08 21:09:25 +02:00
# https://nixos.wiki/wiki/Storage_optimization#Automation
nix.gc = {
automatic = true;
dates = "weekly";
2024-01-16 15:41:58 +01:00
# Options given to nix-collect-garbage.
# They are documented here: https://nixos.org/manual/nix/stable/command-ref/nix-collect-garbage
# The `--delete-older-than <period` option refers the manual for `nix-env --delete-generations <period>`: https://nixos.org/manual/nix/stable/command-ref/nix-env/delete-generations#generations-time
# There, two meanings of <period> are described. The second one is:
# +<number>: Keep the last number generations, along with any newer than current.
2024-01-22 13:55:09 +01:00
# TODO: +7 does currently not work. There is an open issue: https://github.com/NixOS/nixpkgs/issues/282884
2024-01-16 15:41:58 +01:00
options = "--delete-older-than +7";
2023-10-08 21:09:25 +02:00
};
2023-10-24 20:06:36 +02:00
# Delete all files in /tmp during boot.
boot.tmp.cleanOnBoot = true;
2024-02-07 14:29:55 +01:00
# Whether to install NixOS's own documentation.
2024-01-18 11:53:04 +01:00
documentation.nixos.enable = false;
2023-09-20 15:38:13 +02:00
# Firewall.
# https://nixos.wiki/wiki/Firewall
2024-01-16 15:43:45 +01:00
# Note: Firewall rules may be bypassed/overwritten by Docker, as per https://github.com/NixOS/nixpkgs/issues/111852
2023-09-20 15:38:13 +02:00
networking.firewall.enable = true;
2023-09-02 15:33:36 +02:00
}