nix-conf/hosts/nixos/configuration.nix

135 lines
3.2 KiB
Nix
Raw Normal View History

{
inputs,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.home-manager
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Get nicer hostname
networking.hostName = "nixos"; # Define your hostname.
# Enable flakes
nix.settings.experimental-features = ["nix-command" "flakes"];
# Setup gpu
hardware.graphics = {
enable = true;
enable32Bit = true;
};
2025-02-01 08:29:40 +01:00
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Zagreb";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "hr_HR.UTF-8";
LC_IDENTIFICATION = "hr_HR.UTF-8";
LC_MEASUREMENT = "hr_HR.UTF-8";
LC_MONETARY = "hr_HR.UTF-8";
LC_NAME = "hr_HR.UTF-8";
LC_NUMERIC = "hr_HR.UTF-8";
LC_PAPER = "hr_HR.UTF-8";
LC_TELEPHONE = "hr_HR.UTF-8";
LC_TIME = "hr_HR.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
options = "caps:escape";
};
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.crony = {
isNormalUser = true;
description = "Crony";
extraGroups = ["networkmanager" "wheel" "video" "input" "audio" "libvirtd"];
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile
environment.systemPackages = with pkgs; [
neovim
mangohud
2025-01-30 12:32:10 +01:00
lm_sensors
];
# Enable nixd to see nixpkgs path
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Enable zram swap device
zramSwap.enable = true;
# Nfs share
fileSystems."/mnt/share" = {
device = "192.168.0.4:/mnt/nfs";
fsType = "nfs";
2025-01-30 08:42:41 +01:00
options = ["_netdev" "noauto" "x-systemd.automount" "x-systemd.mount-timeout=10" "timeo=14" "x-systemd.idle-timeout=600"];
};
2025-01-30 12:23:59 +01:00
# Setup auto-cpufreq
programs.auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
2025-01-29 22:32:03 +01:00
# Allow for wireguard traffic
networking.firewall = {
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
};
# DO NOT CHANGE
system.stateVersion = "24.11";
}