Files
NixOS/configuration.nix
2025-09-02 15:12:57 +02:00

222 lines
5.7 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).
#Access Internet using:
#nmcli device wifi list
#nmcli device wifi connect <ssid> password <password>
# or if no password (open wifi)
#nmcli device wifi connect <ssid>
#Nix flake file limit: ulimit -n 500000
{ config, pkgs, ... }:
{
#Assign Swap to the PC
#swapDevices = [{
# device = "/swapfile";
# size = 16 * 1024; # 16GB
#}];
imports =
[
./hardware-configuration.nix
];
# Bootloader.
boot.loader = {
systemd-boot.enable = false;
efi.canTouchEfiVariables = true;
#boot.loader.efi.efiSysMountPoint = "/boot/efi";
grub = {
enable = true;
device = "/dev/sda"; #Needs to be changed when using a new computer! (Make grub partition - look below!)
#devices = [ "nodev" ];
efiSupport = true;
useOSProber = true;
};
grub2-theme = {
enable = true;
theme = "whitesur";
footer = true;
};
timeout = 10;
};
#Ensure there is a grub_bios partition: (gparted)
#Create a new parititon. File System: Unformatted - Size: ~5 Mib
#Apply
#Manage flags -> Add bios_grub
networking.hostName = "nixos";
# Define your hostname.
# 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";
# Enable networking
networking.networkmanager.enable = true;
networking.extraHosts = ''
100.89.141.79 tail-rpi
'';
# 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";
};
# List services that you want to enable:
services = {
ollama = {
enable = true;
# Optional: load models on startup
#loadModels = [ ... ];
};
locate = {
enable = true;
package = pkgs.plocate;
};
tailscale = {
enable = true;
extraUpFlags = [
"--operator=${builtins.getEnv "USER"}"
"--accept-routes"
];
};
#Enable CUPS to print documents.
printing.enable = true;
xserver = {
enable = true;
xkb = {
layout = "de";
variant = "";
};
## Enable sound with pipewire.
#services.pulseaudio.enable = false;
};
displayManager.sddm = {
enable = true;
theme = "breeze";
wayland.enable = true;
};
# Enable the OpenSSH daemon.
openssh.enable = true;
};
fonts.packages = with pkgs; [
font-awesome
nerd-fonts.jetbrains-mono
meslo-lgs-nf
];
#In order for dynamically linked executables to work
programs.nix-ld.enable = true;
# Configure console keymap
console.keyMap = "de";
# security.rtkit.enable = true;
# services.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;
# };
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.cookiez = {
isNormalUser = true;
description = "Cookiez";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
#User Packages Here
];
};
virtualisation.docker.enable = true;
environment.etc."gitconfig".text = ''
[init]
defaultBranch = main
'';
#So no user in the group Wheel has to input the password in order to use sudo
security.sudo.wheelNeedsPassword = false;
# #Install firefox.
#programs.firefox.enable = true;
#Enabled in a separate firefox.nix
#Allow Nix Commands
nix.settings.experimental-features = [ "nix-command" "flakes" ];
#To allow the Flake to build all packages (Too many open files error)
#systemd.services.nix-deamon.serviceConfig.LimitNOFILE = 100000;
# Allow unfree packages
nixpkgs.config.allowUnfree = 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;
# };
environment.variables = {
EDITOR = "nvim";
# XKB_DEFAULT_LAYOUT = "de";
};
# 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 = "25.05"; # Did you read the comment?
}