Files
nixos-config/hosts/nixos/default.nix
2025-08-04 22:45:52 +02:00

282 lines
6.3 KiB
Nix

{
config,
inputs,
pkgs,
agenix,
hostname,
user,
...
}:
let
keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOk8iAnIaa1deoc7jw8YACPNVka1ZFJxhnU4G74TmS+p" ];
in
{
imports = [
../../profiles/base
../../profiles/nixos
agenix.nixosModules.default
];
boot = {
loader = {
systemd-boot = {
enable = true;
configurationLimit = 42;
};
efi.canTouchEfiVariables = true;
};
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = [ "uinput" ];
};
time.timeZone = "UTC";
networking = {
hostName = hostname;
useDHCP = false;
interfaces."%INTERFACE%".useDHCP = true;
};
nix.nixPath = [ "nixos-config=/home/${user}/.local/share/src/nixos-config:/etc/nixos" ];
programs = {
gnupg.agent.enable = true;
dconf.enable = true;
fish.enable = true;
};
services = {
displayManager.defaultSession = "none+bspwm";
xserver = {
enable = true;
displayManager.lightdm = {
enable = true;
greeters.slick.enable = true;
background = ../../profiles/nixos/config/login-wallpaper.png;
};
windowManager.bspwm = {
enable = true;
};
xkb = {
layout = "us";
options = "ctrl:nocaps";
};
};
libinput.enable = true;
openssh.enable = true;
syncthing = {
enable = true;
openDefaultPorts = true;
dataDir = "/home/${user}/.local/share/syncthing";
configDir = "/home/${user}/.config/syncthing";
user = "${user}";
group = "users";
guiAddress = "127.0.0.1:8384";
overrideFolders = true;
overrideDevices = true;
settings = {
devices = { };
options.globalAnnounceEnabled = false; # Only sync on LAN
};
};
# Picom, my window compositor with fancy effects
#
# Notes on writing exclude rules:
#
# class_g looks up index 1 in WM_CLASS value for an application
# class_i looks up index 0
#
# To find the value for a specific application, use `xprop` at the
# terminal and then click on a window of the application in question
#
picom = {
enable = true;
settings = {
animations = true;
animation-stiffness = 300.0;
animation-dampening = 35.0;
animation-clamping = false;
animation-mass = 1;
animation-for-workspace-switch-in = "auto";
animation-for-workspace-switch-out = "auto";
animation-for-open-window = "slide-down";
animation-for-menu-window = "none";
animation-for-transient-window = "slide-down";
corner-radius = 12;
rounded-corners-exclude = [
"class_i = 'polybar'"
"class_g = 'i3lock'"
];
round-borders = 3;
round-borders-exclude = [ ];
round-borders-rule = [ ];
shadow = true;
shadow-radius = 8;
shadow-opacity = 0.4;
shadow-offset-x = -8;
shadow-offset-y = -8;
fading = false;
inactive-opacity = 0.8;
frame-opacity = 0.7;
inactive-opacity-override = false;
active-opacity = 1.0;
focus-exclude = [
];
opacity-rule = [
"100:class_g = 'i3lock'"
"60:class_g = 'Dunst'"
"100:class_g = 'Alacritty' && focused"
"90:class_g = 'Alacritty' && !focused"
];
blur-kern = "3x3box";
blur = {
method = "kernel";
strength = 8;
background = false;
background-frame = false;
background-fixed = false;
kern = "3x3box";
};
shadow-exclude = [
"class_g = 'Dunst'"
];
blur-background-exclude = [
"class_g = 'Dunst'"
];
backend = "glx";
vsync = false;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = false;
detect-transient = true;
detect-client-leader = true;
use-damage = true;
log-level = "info";
wintypes = {
normal = {
fade = true;
shadow = false;
};
tooltip = {
fade = true;
shadow = false;
opacity = 0.75;
focus = true;
full-shadow = false;
};
dock = {
shadow = false;
};
dnd = {
shadow = false;
};
popup_menu = {
opacity = 1.0;
};
dropdown_menu = {
opacity = 1.0;
};
};
};
};
gvfs.enable = true; # Mount, trash, and other functionalities
tumbler.enable = true; # Thumbnail support for images
};
# Enable CUPS to print documents
# services.printing.enable = true;
# services.printing.drivers = [ pkgs.brlaser ]; # Brother printer driver
# Enable sound
# sound.enable = true;
# hardware.pulseaudio.enable = true;
# Video support
hardware = {
graphics.enable = true;
# nvidia.modesetting.enable = true;
# Enable Xbox support
# xone.enable = true;
# Crypto wallet support
ledger.enable = true;
};
# Add docker daemon
virtualisation.docker.enable = true;
virtualisation.docker.logDriver = "json-file";
# Additional user config beyond what's in profiles/nixos
users.users = {
${user} = {
extraGroups = [
"docker"
];
openssh.authorizedKeys.keys = keys;
};
root = {
openssh.authorizedKeys.keys = keys;
};
};
# Don't require password for users in `wheel` group for these commands
security.sudo = {
enable = true;
extraRules = [
{
commands = [
{
command = "${pkgs.systemd}/bin/reboot";
options = [ "NOPASSWD" ];
}
];
groups = [ "wheel" ];
}
];
};
fonts.packages = with pkgs; [
dejavu_fonts
emacs-all-the-icons-fonts
feather-font # from overlay
jetbrains-mono
font-awesome
noto-fonts
noto-fonts-emoji
];
environment.systemPackages = with pkgs; [
agenix.packages."${pkgs.system}".default # "x86_64-linux"
gitAndTools.gitFull
inetutils
];
system.stateVersion = "21.05"; # Don't change this
}