dotfiles/root-conf/nixos/configuration.nix
2025-05-19 14:13:37 +02:00

315 lines
7.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual
# (accessible by running nixos-help).
{ config, pkgs, pkgs-unstable, ... }:
let
optionalPkgs = import ./optional-packages.nix { inherit pkgs; };
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./device-specific.nix
];
# Enable nix flakes
nix.settings.experimental-features = ["nix-command" "flakes" ];
# Hybrantion
boot.resumeDevice = "/dev/disk/by-uuid/1942318f-792a-4c0c-9b42-6e146d835bd7";
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = [ "ntfs" ];
# Allow user to rw
services.udev.extraRules = ''
KERNEL=="ttyACM0", MODE:="666"
'';
# Enable openrgb
services.hardware.openrgb.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"
networking = {
hostName = "nixMain";
networkmanager.enable = true;
};
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 5000 5001 ];
allowedUDPPortRanges = [
{ from = 4000; to = 4007; }
{ from = 8000; to = 8010; }
];
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.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";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "gb";
variant = "";
};
# Configure console keymap
console.keyMap = "uk";
# Define a user account. Don't forget to set a password with passwd.
users.users.someone = {
isNormalUser = true;
description = "someone";
extraGroups = [ "wheel" "docker" "libvirtd" ];
packages = with pkgs; [];
shell = pkgs.zsh;
};
users.users.another = {
isNormalUser = true;
description = "another";
extraGroups = [];
packages = with pkgs; [];
shell = pkgs.bash;
};
# Use lemurs as display manager
services.displayManager.ly = {
enable = true;
settings = {
tty = 1;
};
};
# Docker
virtualisation.docker.enable = true;
virtualisation.docker.storageDriver = "btrfs";
# Added docker group to user
# Libvirt
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd];
};
};
};
virtualisation.spiceUSBRedirection.enable = true;
# Added user to the libvirtd group
# Add zsh
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -l";
update = "sudo nixos-rebuild switch";
};
};
# Desktop enviorment
programs.hyprland = {
enable = true;
withUWSM = false; # Universal Wayland Session Manage, ly dosnt like this
xwayland.enable = true; # Xwayland can be disabled.
};
# https://discourse.nixos.org/t/unable-to-add-new-library-folder-to-steam/38923/9
# xdg.portal = {
# enable = true;
# extraPortals = with pkgs; [xdg-desktop-portal-gtk];
# config = {
# common.default = ["gtk"];
# };
# };
# Additional steam settings
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
#localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
# Thunar file manager
programs.thunar.enable = true;
programs.xfconf.enable = true; # Neded to save preferances
programs.thunar.plugins = with pkgs.xfce; [
thunar-archive-plugin
];
services.gvfs.enable = true; # Mount, trash, and other functionalities
services.tumbler.enable = true; # Thumbnail support for images
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
nixpkgs.config.permittedInsecurePackages = [
"electron-33.4.11"
];
environment.systemPackages = with pkgs; [
polkit
libsecret # needet by gnnnome keyring
xdg-desktop-portal-gtk
xdg-utils
shared-mime-info
xwayland
wget
librewolf
kitty
copyq
distrobox
virt-manager
virtiofsd
distrobox
dunst
htop
nvtopPackages.full
nwg-drawer
rofi-wayland
swaylock
waybar
dconf
hyprpolkitagent
jq
bc
tree
unzip
adwaita-icon-theme
hyprpicker
hypridle
playerctl
pwvucontrol
hyprlandPlugins.hyprexpo
# Coms
discord-ptb
freecad
gimp
libreoffice-qt6-fresh
hyphenDicts.de_DE
nextcloud-client
qimgv
vlc
rawtherapee
vscode
git
python3
vim
rnote
spotify
blender
file-roller # GUI arciver, support for thunar-arcive
starship # zsh greeter
fzf # terminal fuzzy finder
seahorse # Gnome keyring viewer
yazi
pkgs-unstable.orca-slicer
pkgs-unstable.video-downloader
bind # nsutils
grim # screenshot
slurp # area selectionn
swappy # draw on pic
wl-clipboard
python312Packages.pillow # pic manipulation
# Theme
catppuccin-cursors.frappeMauve
libsForQt5.qt5ct
qt6ct
hyprpaper
lxappearance
# Games
heroic
steam
] ++ optionalPkgs;
fonts.packages = with pkgs; [
nerdfonts
];
#Enviormant
# needet for electron apps under wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# Enable auth polkit
security.polkit.enable = true;
# Walet, needet for nextcloud login
services.gnome.gnome-keyring.enable = true;
security.pam.services.ly.enableGnomeKeyring = true;
# Required for non native linked programms
# https://nix.dev/guides/faq#how-to-run-non-nix-executables
programs.nix-ld.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}