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 . 6 6 . 2 5 5 " " 1 8 5 . 1 5 0 . 9 9 . 2 5 5 "
# https://www.kuketz-blog.de/empfehlungsecke/#dns
# unfiltered.adguard-dns.com (supports DNSSEC)
" 9 4 . 1 4 0 . 1 4 . 1 4 0 " " 9 4 . 1 4 0 . 1 4 . 1 4 1 "
] ;
2023-09-02 15:33:36 +02:00
# Set your time zone.
time . timeZone = " E u r o p e / B e r l i n " ;
# Select internationalisation properties.
i18n . defaultLocale = " e n _ U S . U T F - 8 " ;
i18n . extraLocaleSettings = {
LC_ADDRESS = " d e _ D E . U T F - 8 " ;
LC_IDENTIFICATION = " d e _ D E . U T F - 8 " ;
LC_MEASUREMENT = " d e _ D E . U T F - 8 " ;
LC_MONETARY = " d e _ D E . U T F - 8 " ;
LC_NAME = " d e _ D E . U T F - 8 " ;
LC_NUMERIC = " d e _ D E . U T F - 8 " ;
LC_PAPER = " d e _ D E . U T F - 8 " ;
LC_TELEPHONE = " d e _ D E . U T F - 8 " ;
LC_TIME = " d e _ D E . U T F - 8 " ;
} ;
2023-10-24 20:06:36 +02:00
console = {
#font = "Lat2-Terminus16";
# Configure console keymap.
keyMap = " d e - l a t i n 1 - n o d e a d k e y s " ;
} ;
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 = " Y o d a " ;
extraGroups = [ " n e t w o r k m a n a g e r " " w h e e l " ] ;
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 = 8 0 0 M
MaxFileSec = 7 day
'' ;
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 = " w e e k l y " ;
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 = " - - d e l e t e - o l d e r - t h a n + 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-01-18 11:53:04 +01:00
# Whether to install NixOS’ s own documentation.
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
}