full restructure

This commit is contained in:
Bart van der Braak 2025-01-15 01:15:34 +01:00
parent af4429982d
commit 8dd28119e7
74 changed files with 921 additions and 3490 deletions

16
nixos/modules/battery.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
services.power-profiles-daemon.enable = false;
services.thermald.enable = true;
services.tlp = {
enable = true;
settings = {
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
};
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
# Only power the Bluetooth controller after logon
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = false;
# Use Overskride bluetooth client
environment.systemPackages = with pkgs; [
overskride
];
}

View file

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
# Bootloader options
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.timeout = 2;
boot.initrd.enable = true;
boot.initrd.systemd.enable = true;
boot.consoleLogLevel = 3;
boot.plymouth = {
enable = true;
font = "${pkgs.jetbrains-mono}/share/fonts/truetype/JetBrainsMono-Regular.ttf";
themePackages = [ pkgs.nixos-bgrt-plymouth ];
theme = "nixos-bgrt";
};
}

View file

@ -0,0 +1,9 @@
# Edit trueconfiguration 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).
{ ... }:
{
system.stateVersion = "24.11";
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
blender
inkscape
gimp
];
}

View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
azure-cli
opentofu
curl
go-task
sops
];
}

View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
# Enable Display Manager
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a %h | %F' --cmd Hyprland";
user = "greeter";
};
};
};
environment.systemPackages = with pkgs; [
greetd.tuigreet
];
}

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
# Setup Env Variables
environment.variables.SPOTIFY_PATH = "${pkgs.spotify}/";
environment.variables.JDK_PATH = "${pkgs.jdk11}/";
environment.variables.NODEJS_PATH = "${pkgs.nodePackages_latest.nodejs}/";
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
# Open ports in the firewall.
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ ];
networking.firewall.allowedUDPPorts = [
5353 # Spotify Connect
];
}

10
nixos/modules/fonts.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
# Fonts
fonts.packages = with pkgs; [
jetbrains-mono
nerd-font-patcher
noto-fonts-color-emoji
];
}

6
nixos/modules/gaming.nix Normal file
View file

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
# Enable Steam
programs.steam.enable = true;
}

16
nixos/modules/gc.nix Normal file
View file

@ -0,0 +1,16 @@
{ ... }:
{
# Optimize storage and automatic scheduled GC running
# If you want to run GC manually, use commands:
# `nix-store --optimize` for finding and eliminating redundant copies of identical store paths
# `nix-store --gc` for optimizing the nix store and removing unreferenced and obsolete store paths
# `nix-collect-garbage -d` for deleting old generations of user profiles
nix.settings.auto-optimise-store = true;
nix.optimise.automatic = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
}

8
nixos/modules/gnome.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
# Enable Gnome
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
}

18
nixos/modules/greeter.nix Normal file
View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
# Enable Display Manager
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --time-format '%I:%M %p | %a %h | %F' --cmd Hyprland";
user = "greeter";
};
};
};
environment.systemPackages = with pkgs; [
greetd.tuigreet
];
}

View file

@ -0,0 +1,25 @@
{ inputs, pkgs, ... }:
{
# Enable Hyprland
programs.hyprland.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1";
environment.systemPackages = with pkgs; [
pyprland # plugin system
hyprpicker # color picker
hyprcursor # cursor format
hyprlock # lock screen
hypridle # idle daemon
hyprpaper # wallpaper util
inputs.ghostty.packages.${pkgs.system}.default # terminal emulator
starship # prompt
helix # txt editor
inputs.zen-browser.packages.${pkgs.system}.default # browser
zathura # pdf viewer
mpv # media player
imv # image viewer
];
}

View file

@ -0,0 +1,28 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
neofetch
onefetch
ipfetch
cpufetch
ramfetch
starfetch
octofetch
htop
bottom
btop
zfxtop
kmon
vulkan-tools
# opencl-info
# clinfo
# vdpauinfo
# libva-utils
wlr-randr
gpu-viewer
dig
speedtest-rs
];
}

View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
{
i18n.supportedLocales = [
"en_US.UTF-8/UTF-8"
"nl_NL.UTF-8/UTF-8"
];
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
environment.systemPackages = with pkgs; [
nuspell
hyphen
hunspell
hunspellDicts.en_US
hunspellDicts.nl_NL
];
}

11
nixos/modules/kde.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
# Enable KDE Plasma 6
services.xserver.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
};
services.desktopManager.plasma6.enable = true;
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
services.xserver = {
xkb.layout = "us";
xkb.options = "grp:alt_shift_toggle";
};
environment.systemPackages = with pkgs; [
klavaro # typing tutor
gtypist # typing tutor
via # keyboard configurator
];
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
# Linux Kernel
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
boot.kernelParams = [
"splash"
"quiet"
"fbcon=nodefer"
"vt.global_cursor_default=0"
"kernel.modules_disabled=1"
"lsm=landlock,lockdown,yama,integrity,bpf,tomoyo"
"usbcore.autosuspend=-1"
"video4linux"
"acpi_rev_override=5"
];
environment.systemPackages = with pkgs; [
policycoreutils
];
}

31
nixos/modules/lsp.nix Normal file
View file

@ -0,0 +1,31 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
python311Packages.python-lsp-server
nodePackages_latest.nodemon
nodePackages_latest.typescript
nodePackages_latest.typescript-language-server
nodePackages_latest.vscode-langservers-extracted
nodePackages_latest.yaml-language-server
nodePackages_latest.dockerfile-language-server-nodejs
nodePackages_latest.bash-language-server
nodePackages_latest.graphql-language-service-cli
sumneko-lua-language-server
marksman
markdown-oxide
nil
zls
gopls
delve
emmet-language-server
buf
cmake-language-server
docker-compose-language-service
vscode-extensions.vadimcn.vscode-lldb
slint-lsp
terraform-ls
ansible-language-server
hyprls
];
}

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
# Enable networking
networking.hostName = "tongfang";
networking.networkmanager.enable = true;
users.extraGroups.networkmanager.members = [ "bart" ];
environment.systemPackages = with pkgs; [
iwgtk
impala
];
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
# Nix Configuration
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
}

View file

@ -0,0 +1,6 @@
{ ... }:
{
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
AllowUsers = [ "bart" ];
};
};
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
# Enable CUPS to print documents.
services.printing.enable = true;
# Disable browsed: https://discourse.nixos.org/t/newly-announced-vulnerabilities-in-cups
services.printing.browsed.enable = false;
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
go
(python312Full.withPackages(ps: with ps; [ pygobject3 gobject-introspection pyqt6-sip]))
nodePackages_latest.nodejs
nodePackages_latest.pnpm
bun
lua
zig
numbat
];
}

10
nixos/modules/screen.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
programs.light.enable = true;
environment.systemPackages = with pkgs; [
wlsunset
brightnessctl
];
}

View file

@ -0,0 +1,56 @@
{ pkgs, ... }:
{
# Systemd services setup
systemd.packages = with pkgs; [
auto-cpufreq
];
# Enable Services
programs.direnv.enable = true;
services.upower.enable = true;
programs.dconf.enable = true;
services.dbus = {
enable = true;
implementation = "broker";
packages = with pkgs; [
xfce.xfconf
gnome2.GConf
];
};
services.mpd.enable = true;
programs.thunar.enable = true;
programs.xfconf.enable = true;
services.tumbler.enable = true;
services.fwupd.enable = true;
services.auto-cpufreq.enable = true;
# services.gnome.core-shell.enable = true;
# services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
environment.systemPackages = with pkgs; [
at-spi2-atk
qt6.qtwayland
psi-notify
poweralertd
playerctl
psmisc
grim
slurp
imagemagick
swappy
ffmpeg_6-full
wl-screenrec
wl-clipboard
wl-clip-persist
cliphist
xdg-utils
wtype
wlrctl
waybar
rofi-wayland
dunst
avizo
wlogout
gifsicle
];
}

25
nixos/modules/sound.nix Normal file
View file

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
# 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;
wireplumber.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;
};
environment.systemPackages = with pkgs; [
pamixer
pavucontrol
];
}

View file

@ -0,0 +1,59 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
file
upx
git
lazygit
delta
license-generator
git-ignore
gitleaks
git-secrets
pass-git-helper
just
xh
process-compose
# mcfly # terminal history
zellij
progress
noti
topgrade
ripgrep
rewrk
wrk2
procs
tealdeer
monolith
aria
sd
ouch
duf
du-dust
fd
jq
gh
trash-cli
zoxide
tokei
fzf
bat
hexyl
mdcat
pandoc
lsd
lsof
gping
viu
tre-command
yazi
chafa
cmatrix
pipes-rs
rsclock
cava
figlet
];
}

62
nixos/modules/theme.nix Normal file
View file

@ -0,0 +1,62 @@
{ pkgs, ... }:
{
# Enable Theme
environment.variables.GTK_THEME = "catppuccin-macchiato-teal-standard";
environment.variables.XCURSOR_THEME = "Catppuccin-Macchiato-Teal";
environment.variables.XCURSOR_SIZE = "24";
environment.variables.HYPRCURSOR_THEME = "Catppuccin-Macchiato-Teal";
environment.variables.HYPRCURSOR_SIZE = "24";
qt.enable = true;
qt.platformTheme = "gtk2";
qt.style = "gtk2";
console = {
earlySetup = true;
colors = [
"24273a"
"ed8796"
"a6da95"
"eed49f"
"8aadf4"
"f5bde6"
"8bd5ca"
"cad3f5"
"5b6078"
"ed8796"
"a6da95"
"eed49f"
"8aadf4"
"f5bde6"
"8bd5ca"
"a5adcb"
];
};
# Override packages
nixpkgs.config.packageOverrides = pkgs: {
colloid-icon-theme = pkgs.colloid-icon-theme.override { colorVariants = ["teal"]; };
catppuccin-gtk = pkgs.catppuccin-gtk.override {
accents = [ "teal" ]; # You can specify multiple accents here to output multiple themes
size = "standard";
variant = "macchiato";
};
discord = pkgs.discord.override {
withOpenASAR = true;
withTTS = true;
};
};
environment.systemPackages = with pkgs; [
numix-icon-theme-circle
colloid-icon-theme
catppuccin-gtk
catppuccin-kvantum
catppuccin-cursors.macchiatoTeal
# gnome.gnome-tweaks
# gnome.gnome-shell
# gnome.gnome-shell-extensions
# xsettingsd
# themechanger
];
}

7
nixos/modules/time.nix Normal file
View file

@ -0,0 +1,7 @@
{ ... }:
{
# Set your time zone.
time.hardwareClockInLocalTime = true;
time.timeZone = "Europe/Amsterdam";
}

25
nixos/modules/usb.nix Normal file
View file

@ -0,0 +1,25 @@
{ pkgs, ... }:
{
# USB Automounting
services.gvfs.enable = true;
# services.udisks2.enable = true;
# services.devmon.enable = true;
# Enable USB Guard
# services.usbguard = {
# enable = true;
# dbus.enable = true;
# implicitPolicyTarget = "block";
# # FIXME: set yours pref USB devices (change {id} to your trusted USB device), use `lsusb` command (from usbutils package) to get list of all connected USB devices including integrated devices like camera, bluetooth, wifi, etc. with their IDs or just disable `usbguard`
# rules = ''
# allow id {id} # device 1
# allow id {id} # device 2
# '';
# };
# Enable USB-specific packages
environment.systemPackages = with pkgs; [
usbutils
];
}

19
nixos/modules/users.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
# Define a user account.
users.users.bart = {
isNormalUser = true;
description = "Bart van der Braak";
extraGroups = [ "networkmanager" "input" "wheel" "video" "audio" "tss" ];
shell = pkgs.bash;
packages = with pkgs; [
spotify
discord
vscodium
];
};
# Change runtime directory size
services.logind.extraConfig = "RuntimeDirectorySize=8G";
}

18
nixos/modules/utils.nix Normal file
View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
mold
gcc
clang
lld
lldb
musl
jdk11
dioxus-cli
surrealdb
surrealdb-migrations
surrealist
trunk
];
}

View file

@ -0,0 +1,23 @@
{ pkgs, ... }:
{
# Enable Docker
virtualisation.docker.enable = true;
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
users.extraGroups.docker.members = [ "bart" ];
# Add KVM support
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
users.extraGroups.libvirtd.members = [ "bart" ];
environment.systemPackages = with pkgs; [
qemu
docker-compose
lazydocker
docker-credential-helpers
];
}

12
nixos/modules/vpn.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
# Enable Mullvad VPN, OpenVPN via Network Manager and Tailscale
services.mullvad-vpn.enable = true;
services.mullvad-vpn.package = pkgs.mullvad;
services.tailscale.enable = true;
environment.systemPackages = with pkgs; [
networkmanager-openvpn
mullvad-closest
];
}

12
nixos/modules/work.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
thunderbird
element-desktop
aws-sam-cli
awscli2
gnumake
cmake
];
}