nix-config/modules/system.nix

245 lines
6.2 KiB
Nix
Raw Normal View History

2025-03-24 12:11:44 +01:00
{
pkgs,
lib,
username,
...
}: {
2025-03-26 15:17:45 +01:00
# ============================= User related =============================
# Define a user account. Don't forget to set a password with passwd.
users.users.${username} = {
isNormalUser = true;
description = username;
2025-03-26 15:36:46 +01:00
extraGroups = ["networkmanager" "wheel" "podman"];
2025-03-26 15:17:45 +01:00
};
# given the users in this list the right to specify additional substituters via:
# 1. `nixConfig.substituers` in `flake.nix`
# 2. command line args `--options substituers http://xxx`
nix.settings.trusted-users = [username];
# customise /etc/nix/nix.conf declaratively via `nix.settings`
nix.settings = {
# enable flakes globally
2025-03-26 21:59:46 +01:00
experimental-features = ["nix-command" "flakes"];
auto-optimise-store = true;
substituters = [
"https://cache.nixos.org"
"https://hyprland.cachix.org"
];
2025-03-24 12:11:44 +01:00
2025-03-26 21:59:46 +01:00
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
builders-use-substitutes = true;
2025-03-26 15:17:45 +01:00
};
2025-03-24 12:11:44 +01:00
2025-03-26 15:17:45 +01:00
# do garbage collection weekly to keep disk usage low
nix.gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
2025-03-26 21:59:46 +01:00
options = lib.mkDefault "--delete-older-than +3";
2025-03-24 12:11:44 +01:00
};
2025-03-26 15:17:45 +01:00
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
2025-03-26 21:59:46 +01:00
nixpkgs.config.allowBroken = true;
2025-03-26 15:17:45 +01: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";
};
# Enable CUPS to print documents.
services.printing.enable = true;
fonts = {
packages = with pkgs; [
# icon fonts
2025-04-01 13:15:41 +02:00
material-icons
material-black-colors
2025-03-26 15:17:45 +01:00
material-design-icons
# normal fonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
2025-03-28 17:38:17 +01:00
nerdfonts
2025-03-26 15:17:45 +01:00
];
# use fonts specified by user rather than default ones
enableDefaultPackages = false;
# user defined fonts
# the reason there's Noto Color Emoji everywhere is to override DejaVu's
# B&W emojis that would sometimes show instead of some Color emojis
fontconfig.defaultFonts = {
serif = ["Noto Serif" "Noto Color Emoji"];
sansSerif = ["Noto Sans" "Noto Color Emoji"];
monospace = ["JetBrainsMono Nerd Font" "Noto Color Emoji"];
emoji = ["Noto Color Emoji"];
};
};
programs.dconf.enable = true;
2025-04-02 19:43:31 +02:00
2025-04-03 00:12:49 +02:00
programs.spacefm.enable = true;
2025-04-02 23:34:58 +02:00
/*programs.xfconf.enable = true;
2025-03-26 15:17:45 +01:00
services.gvfs.enable = true;
services.tumbler.enable = true;
2025-04-02 19:49:10 +02:00
programs.thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
2025-04-02 23:34:58 +02:00
};*/
2025-03-26 15:17:45 +01:00
2025-03-26 15:36:46 +01:00
# Virtualisation
2025-03-26 15:17:45 +01:00
virtualisation = {
containers.enable = true;
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
2025-03-26 15:36:46 +01:00
oci-containers = {
backend = "podman";
containers = {
/*container-name = {
image = "image";
autoStart = true;
ports = [ "127.0.0.1:1234:1234" ];
};*/
2025-03-26 15:27:25 +01:00
};
};
};
2025-03-26 15:36:46 +01:00
2025-03-26 15:17:45 +01:00
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
X11Forwarding = true;
PermitRootLogin = "no"; # disable root login
PasswordAuthentication = false; # disable password login
};
openFirewall = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# Bare minimum
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
# System tools
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils # lspci
usbutils # lsusb
2025-04-02 19:07:35 +02:00
libGL
2025-03-26 15:17:45 +01:00
# Rizz
fastfetch
2025-04-01 13:52:53 +02:00
cpufetch
hyfetch
ramfetch
neofetch
ghfetch
2025-03-26 16:06:17 +01:00
libnotify
2025-03-26 15:17:45 +01:00
#microfetch
# Terminal
yazi # file manager
jq # JSON Parser
yq-go # YAML Parser
glow # Markdown Reader
btop # system monitor
iotop # iomonitor
iftop # network monitor
iperf3 # network tester
nmap # network discovery
eza # ls replacement
curl
dnsutils
ldns
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
# Archives
zip
unzip
p7zip
xz
2025-03-26 15:36:46 +01:00
# Virtualisation
podman-compose # docker-compose alternative
dive # docker layer viewer
2025-03-26 21:59:46 +01:00
podman-tui # status of containers in terminal
podman-desktop # Desktop client
tailscale # Vpn
2025-03-26 15:17:45 +01:00
];
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
2025-04-02 19:07:35 +02:00
services.power-profiles-daemon = {
2025-03-26 15:17:45 +01:00
enable = true;
2025-03-24 12:11:44 +01:00
};
2025-03-26 15:17:45 +01:00
security.polkit.enable = true;
2025-03-24 12:11:44 +01:00
2025-03-26 15:17:45 +01:00
services = {
dbus.packages = [pkgs.gcr];
geoclue2.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
2025-03-26 21:59:46 +01:00
tailscale.enable = true;
2025-03-26 15:17:45 +01:00
udev.packages = with pkgs; [gnome.gnome-settings-daemon];
};
2025-03-24 12:11:44 +01:00
}