nix/hosts/nxs/configuration.nix
Narrator 33332afe63
Some checks failed
CI / formatting (push) Failing after 9m22s
CI / nix_flake_check (push) Failing after 9m21s
test ssh sig
2025-12-08 17:47:53 +01:00

261 lines
7.3 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, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
fileSystems."/home" = {
device = "/dev/disk/by-uuid/31dbc3a8-dfdc-4177-8d3e-2b6e294e7daf";
fsType = "btrfs";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/f9da6980-510f-4cce-bff5-50a791346c07"; }
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
#boot.loader.systemd-boot.enable = true;
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.enable = true;
boot.loader.grub.efiSupport = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub.device = "nodev";
boot.loader.grub.useOSProber = true;
boot.loader.grub.configurationLimit = 5;
boot.loader.efi.canTouchEfiVariables = true;
#boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.extraConfig = ''
GRUB_DISABLE_OS_PROBER=false
GRUB_TERMINAL_OUTPUT=console
'';
boot.loader.grub.gfxmodeBios = "1280x720"; # for BIOS, or
boot.loader.grub.gfxmodeEfi = "1280x720"; # for EFI
boot.loader.grub.gfxpayloadBios = "keep";
# Use latest kernel.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [ "nvidia-drm.modeset=1" "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
networking.hostName = "nxs"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/Rome";
virtualisation.docker.enable = true;
# optional but sane:
virtualisation.docker.enableOnBoot = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
services.xserver = {
enable = true;
libinput = {
enable = true;
touchpad = {
naturalScrolling = true;
tapping = true;
disableWhileTyping = true;
clickMethod = "clickfinger";
};
};
displayManager.lightdm = {
enable = true;
autoLogin.enable = true;
autoLogin.user = "narrator";
};
windowManager.i3.enable = true;
videoDrivers = [ "amdgpu" "nvidia" ];
deviceSection = ''
BusID "PCI:1:0:0"
Driver "nvidia"
'';
};
# Configure keymap in X11
# services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# services.pulseaudio.enable = true;
# OR
security.rtkit.enable = true;
services.pipewire = {
alsa.enable = true;
enable = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
programs.fish.enable = true;
users.users.narrator = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; # Enable sudo for the user.
shell = pkgs.fish;
packages = with pkgs; [
tree
];
};
programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
gnupg
wget
cryptsetup
xorg.xinit
os-prober
fish
htop
fzf
curl
git
pinentry-curses
lightdm
i3-gaps
awesome
blueman
];
fonts.packages = with pkgs; [
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.symbols-only
];
services.logind = {
lidSwitch = "ignore";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "lock";
extraConfig = ''
IdleAction=ignore
HandleSuspendKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
SuspendKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
HandlePowerKey=poweroff
HandleSuspendKey=hibernate
'';
};
systemd.sleep.extraConfig = ''
AllowSuspend=no
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no
'';
# firewall bc duh
networking.firewall.enable = true;
documentation.man.generateCaches = false;
# time sync
services.timesyncd.enable = true;
# bluetooth
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# enable printing
services.printing.enable = true;
# enable openssh for remote access
services.openssh.enable = true;
programs.ssh.startAgent = true;
security.sudo.wheelNeedsPassword = false;
system.stateVersion = "25.05"; # Did you read the comment?
# GnuPG
programs.gnupg.agent = {
enable = true;
};
services.pcscd.enable = true;
systemd.services."getty@tty2".enable = true;
systemd.services."getty@tty3".enable = true;
hardware.graphics = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
#powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
# SSH config:
};
hardware.nvidia.forceFullCompositionPipeline = true;
systemd.services = {
systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
systemd-hibernate.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; # if u care
};
hardware.nvidia.prime = {
offload.enable = true;
amdgpuBusId = "PCI:7:0:0";
nvidiaBusId = "PCI:1:0:0";
#amdgpuBusId = "PCI:54:0:0"; # If you have an AMD iGPU
};
}