This commit is contained in:
2025-09-13 23:16:22 +02:00
commit 5057e1effa
179 changed files with 20524 additions and 0 deletions

22
modules/core/boot.nix Normal file
View File

@@ -0,0 +1,22 @@
{ pkgs, config, ... }:
{
boot = {
kernelPackages = pkgs.linuxPackages_zen;
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
kernel.sysctl = { "vm.max_map_count" = 2147483642; };
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
# Appimage Support
binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
plymouth.enable = true;
};
}

36
modules/core/default.nix Normal file
View File

@@ -0,0 +1,36 @@
{
inputs,
host,
...
}:
let
# Import the host-specific variables.nix
vars = import ../../hosts/${host}/variables.nix;
in
{
imports = [
./boot.nix
./flatpak.nix
./fonts.nix
./hardware.nix
./network.nix
./nfs.nix
./nh.nix
#./quickshell.nix #Disabled for now not using it yet
./packages.nix
./printing.nix
# Conditionally import the display manager module
(if vars.displayManager == "tui" then ./greetd.nix else ./sddm.nix)
./security.nix
./services.nix
./steam.nix
./stylix.nix
./syncthing.nix
./system.nix
./thunar.nix
./user.nix
./virtualisation.nix
./xserver.nix
inputs.stylix.nixosModules.stylix
];
}

31
modules/core/flatpak.nix Normal file
View File

@@ -0,0 +1,31 @@
{ pkgs, ... }: {
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
configPackages = [ pkgs.hyprland ];
};
services = {
flatpak = {
enable = true;
# List the Flatpak applications you want to install
# Use the official Flatpak application ID (e.g., from flathub.org)
# Examples:
packages = [
#"com.github.tchx84.Flatseal" #Manage flatpak permissions - should always have this
#"com.rtosta.zapzap" # WhatsApp client
#"io.github.flattool.Warehouse" # Manage flatpaks, clean data, remove flatpaks and deps
#"it.mijorus.gearlever" # Manage and support AppImages
#"io.github.freedoom.Phase1" # Classic Doom FPS 1
#"io.github.freedoom.Phase2" # Classic Doom FPS 2
#"io.github.dvlv.boxbuddyrs" # Manage distroboxes
#"de.schmidhuberj.tubefeeder" #watch YT videos
# Add other Flatpak IDs here, e.g., "org.mozilla.firefox"
];
# Optional: Automatically update Flatpaks when you run nixos-rebuild swit ch
update.onActivation = true;
};
};
}

29
modules/core/fonts.nix Normal file
View File

@@ -0,0 +1,29 @@
{pkgs, ...}: {
fonts = {
packages = with pkgs; [
dejavu_fonts
fira-code
fira-code-symbols
font-awesome
hackgen-nf-font
ibm-plex
inter
jetbrains-mono
material-icons
maple-mono.NF
minecraftia
nerd-fonts.im-writing
nerd-fonts.blex-mono
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-monochrome-emoji
powerline-fonts
roboto
roboto-mono
#symbola
terminus_font
];
};
}

15
modules/core/greetd.nix Normal file
View File

@@ -0,0 +1,15 @@
{ pkgs
, username
, ...
}: {
services.greetd = {
enable = true;
#vt = 3;
settings = {
default_session = {
user = username;
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; # start Hyprland with a TUI login manager
};
};
};
}

18
modules/core/hardware.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
hardware = {
sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
disabledDefaultBackends = [ "escl" ];
};
logitech.wireless.enable = false;
logitech.wireless.enableGraphical = false;
graphics.enable = true;
enableRedistributableFirmware = true;
keyboard.qmk.enable = true;
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
local.hardware-clock.enable = false;
}

41
modules/core/network.nix Normal file
View File

@@ -0,0 +1,41 @@
{ pkgs
, host
, options
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) hostId;
in
{
# Defensive assertion for hostname validity (clearer message at eval time)
assertions = [
{
assertion = builtins.match "^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$" host != null;
message = "Invalid hostname '${host}'. Must be 1-63 chars, start/end alphanumeric; allowed middle chars: letters, digits, '-' or '_'.";
}
];
networking = {
hostName = "${host}";
hostId = hostId;
networkmanager.enable = true;
timeServers = options.networking.timeServers.default ++ [ "pool.ntp.org" ];
firewall = {
enable = true;
allowedTCPPorts = [
22
80
443
59010
59011
8080
];
allowedUDPPorts = [
59010
59011
];
};
};
environment.systemPackages = with pkgs; [ networkmanagerapplet ];
}

10
modules/core/nfs.nix Normal file
View File

@@ -0,0 +1,10 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) enableNFS;
in
{
services = {
rpcbind.enable = enableNFS;
nfs.server.enable = enableNFS;
};
}

18
modules/core/nh.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs
, username
, ...
}: {
programs.nh = {
enable = true;
clean = {
enable = true;
extraArgs = "--keep-since 7d --keep 5";
};
flake = "/home/${username}/garandos";
};
environment.systemPackages = with pkgs; [
nix-output-monitor
nvd
];
}

85
modules/core/packages.nix Normal file
View File

@@ -0,0 +1,85 @@
{
pkgs,
inputs,
...
}:
{
programs = {
neovim = {
enable = true;
defaultEditor = true;
};
firefox.enable = false; # Firefox is not installed by default
hyprland = {
enable = true; # set this so desktop file is created
withUWSM = false;
};
dconf.enable = true;
seahorse.enable = true;
fuse.userAllowOther = true;
mtr.enable = true;
adb.enable = true;
hyprlock.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# Hyprland systeminfo QT (Optional)
#inputs.hyprsysteminfo.packages.${pkgs.system}.default
amfora # Fancy Terminal Browser For Gemini Protocol
appimage-run # Needed For AppImage Support
brave # Brave Browser
brightnessctl # For Screen Brightness Control
cliphist # Clipboard manager using rofi menu
cmatrix # Matrix Movie Effect In Terminal
cowsay # Great Fun Terminal Program
docker-compose # Allows Controlling Docker From A Single File
duf # Utility For Viewing Disk Usage In Terminal
dysk # Disk space util nice formattting
eza # Beautiful ls Replacement
ffmpeg # Terminal Video / Audio Editing
file-roller # Archive Manager
gedit # Simple Graphical Text Editor
#gemini-cli # CLI AI client ONLY (optional)
gimp # Great Photo Editor
glxinfo # needed for inxi diag util
greetd.tuigreet # The Login Manager (Sometimes Referred To As Display Manager)
htop # Simple Terminal Based System Monitor
hyprpicker # Color Picker
eog # For Image Viewing
inxi # CLI System Information Tool
killall # For Killing All Instances Of Programs
libnotify # For Notifications
lm_sensors # Used For Getting Hardware Temps
lolcat # Add Colors To Your Terminal Command Output
lshw # Detailed Hardware Information
mpv # Incredible Video Player
ncdu # Disk Usage Analyzer With Ncurses Interface
nixfmt-rfc-style # Nix Formatter
nwg-displays # configure monitor configs via GUI
onefetch # provides zsaneyos build info on current system
pavucontrol # For Editing Audio Levels & Devices
pciutils # Collection Of Tools For Inspecting PCI Devices
picard # For Changing Music Metadata & Getting Cover Art
pkg-config # Wrapper Script For Allowing Packages To Get Info On Others
playerctl # Allows Changing Media Volume Through Scripts
rhythmbox # audio player
ripgrep # Improved Grep
socat # Needed For Screenshots
unrar # Tool For Handling .rar Files
unzip # Tool For Handling .zip Files
usbutils # Good Tools For USB Devices
uwsm # Universal Wayland Session Manager (optional must be enabled)
v4l-utils # Used For Things Like OBS Virtual Camera
waypaper # wallpaper changer
warp-terminal # Terminal with AI support build in
wget # Tool For Fetching Files With Links
ytmdl # Tool For Downloading Audio From YouTube
];
}

20
modules/core/printing.nix Normal file
View File

@@ -0,0 +1,20 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) printEnable;
in
{
services = {
printing = {
enable = printEnable;
drivers = [
# pkgs.hplipWithPlugin
];
};
avahi = {
enable = printEnable;
nssmdns4 = true;
openFirewall = true;
};
ipp-usb.enable = printEnable;
};
}

View File

@@ -0,0 +1,31 @@
{ pkgs, inputs, ... }:
{
environment.systemPackages = with pkgs; [
inputs.quickshell.packages.${pkgs.system}.default
# Qt6 related kitsfor slove Qt5Compat problem
qt6.qt5compat
qt6.qtbase
qt6.qtquick3d
qt6.qtwayland
qt6.qtdeclarative
qt6.qtsvg
# alternate options
# libsForQt5.qt5compat
kdePackages.qt5compat
libsForQt5.qt5.qtgraphicaleffects
];
# necessary environment variables
environment.variables = {
QML_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml";
QML2_IMPORT_PATH = "${pkgs.qt6.qt5compat}/lib/qt-6/qml:${pkgs.qt6.qtbase}/lib/qt-6/qml";
};
# make sure the Qt application is working properly
environment.sessionVariables = {
QT_QPA_PLATFORM = "wayland;xcb";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
};
}

72
modules/core/sddm.nix Normal file
View File

@@ -0,0 +1,72 @@
# SDDM is a display manager for X11 and Wayland
{
pkgs,
config,
lib,
...
}: let
foreground = config.stylix.base16Scheme.base00;
textColor = config.stylix.base16Scheme.base05;
sddm-astronaut = pkgs.sddm-astronaut.override {
embeddedTheme = "pixel_sakura";
themeConfig =
if lib.hasSuffix "sakura_static.png" config.stylix.image
then {
FormPosition = "left";
Blur = "2.0";
}
else if lib.hasSuffix "studio.png" config.stylix.image
then {
Background = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/anotherhadi/nixy-wallpapers/refs/heads/main/wallpapers/studio.gif";
sha256 = "sha256-qySDskjmFYt+ncslpbz0BfXiWm4hmFf5GPWF2NlTVB8=";
};
HeaderTextColor = "#${textColor}";
DateTextColor = "#${textColor}";
TimeTextColor = "#${textColor}";
LoginFieldTextColor = "#${textColor}";
PasswordFieldTextColor = "#${textColor}";
UserIconColor = "#${textColor}";
PasswordIconColor = "#${textColor}";
WarningColor = "#${textColor}";
LoginButtonBackgroundColor = "#${foreground}";
SystemButtonsIconsColor = "#${foreground}";
SessionButtonTextColor = "#${textColor}";
VirtualKeyboardButtonTextColor = "#${textColor}";
DropdownBackgroundColor = "#${foreground}";
HighlightBackgroundColor = "#${textColor}";
}
else {
FormPosition = "left";
Blur = "4.0";
Background = "${toString config.stylix.image}";
HeaderTextColor = "#${textColor}";
DateTextColor = "#${textColor}";
TimeTextColor = "#${textColor}";
LoginFieldTextColor = "#${textColor}";
PasswordFieldTextColor = "#${textColor}";
UserIconColor = "#${textColor}";
PasswordIconColor = "#${textColor}";
WarningColor = "#${textColor}";
LoginButtonBackgroundColor = "#${config.stylix.base16Scheme.base01}";
SystemButtonsIconsColor = "#${textColor}";
SessionButtonTextColor = "#${textColor}";
VirtualKeyboardButtonTextColor = "#${textColor}";
DropdownBackgroundColor = "#${config.stylix.base16Scheme.base01}";
HighlightBackgroundColor = "#${textColor}";
FormBackgroundColor = "#${config.stylix.base16Scheme.base01}";
};
};
in {
services.displayManager = {
sddm = {
package = pkgs.kdePackages.sddm;
extraPackages = [sddm-astronaut];
enable = true;
wayland.enable = true;
theme = "sddm-astronaut-theme";
};
};
environment.systemPackages = [sddm-astronaut];
}

22
modules/core/security.nix Normal file
View File

@@ -0,0 +1,22 @@
_: {
security = {
rtkit.enable = true;
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ( subject.isInGroup("users") && (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
))
{ return polkit.Result.YES; }
})
'';
};
pam.services.swaylock = {
text = ''auth include login '';
};
};
}

57
modules/core/services.nix Normal file
View File

@@ -0,0 +1,57 @@
{ profile, ... }: {
# Services to start
services = {
libinput.enable = true; # Input Handling
fstrim.enable = true; # SSD Optimizer
gvfs.enable = true; # For Mounting USB & More
openssh = {
enable = true; # Enable SSH
settings = {
PermitRootLogin = "no"; # Prevent root from SSH login
PasswordAuthentication = true; #Users can SSH using kb and password
KbdInteractiveAuthentication = true;
};
ports = [ 22 ];
};
blueman.enable = true; # Bluetooth Support
tumbler.enable = true; # Image/video preview
gnome.gnome-keyring.enable = true;
smartd = {
enable =
if profile == "vm"
then false
else true;
autodetect = true;
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
extraConfig.pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 256;
"default.clock.min-quantum" = 256;
"default.clock.max-quantum" = 256;
};
};
extraConfig.pipewire-pulse."92-low-latency" = {
context.modules = [
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "256/48000";
pulse.default.req = "256/48000";
pulse.max.req = "256/48000";
pulse.min.quantum = "256/48000";
pulse.max.quantum = "256/48000";
};
}
];
};
};
};
}

73
modules/core/starfish.nix Normal file
View File

@@ -0,0 +1,73 @@
{ ... }: {
programs = {
starship = {
enable = false;
settings = {
add_newline = false;
buf = {
symbol = " ";
};
c = {
symbol = " ";
};
directory = {
read_only = " 󰌾";
};
docker_context = {
symbol = " ";
};
fossil_branch = {
symbol = " ";
};
git_branch = {
symbol = " ";
};
golang = {
symbol = " ";
};
hg_branch = {
symbol = " ";
};
hostname = {
ssh_symbol = " ";
};
lua = {
symbol = " ";
};
memory_usage = {
symbol = "󰍛 ";
};
meson = {
symbol = "󰔷 ";
};
nim = {
symbol = "󰆥 ";
};
nix_shell = {
symbol = " ";
};
nodejs = {
symbol = " ";
};
ocaml = {
symbol = " ";
};
package = {
symbol = "󰏗 ";
};
python = {
symbol = " ";
};
rust = {
symbol = " ";
};
swift = {
symbol = " ";
};
zig = {
symbol = " ";
};
};
};
};
}

20
modules/core/steam.nix Normal file
View File

@@ -0,0 +1,20 @@
{ pkgs, ... }: {
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
gamescopeSession.enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
gamescope = {
enable = true;
capSysNice = true;
args = [
"--rt"
"--expose-wayland"
];
};
};
}

59
modules/core/stylix.nix Normal file
View File

@@ -0,0 +1,59 @@
{ pkgs
, host
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) stylixImage;
in
{
# Styling Options
stylix = {
enable = true;
image = stylixImage;
# base16Scheme = {
# base00 = "282936";
# base01 = "3a3c4e";
# base02 = "4d4f68";
# base03 = "626483";
# base04 = "62d6e8";
# base05 = "e9e9f4";
# base06 = "f1f2f8";
# base07 = "f7f7fb";
# base08 = "ea51b2";
# base09 = "b45bcf";
# base0A = "00f769";
# base0B = "ebff87";
# base0C = "a1efe4";
# base0D = "62d6e8";
# base0E = "b45bcf";
# base0F = "00f769";
# };
polarity = "dark";
opacity.terminal = 1.0;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
fonts = {
monospace = {
package = pkgs.nerd-fonts.jetbrains-mono;
name = "JetBrains Mono";
};
sansSerif = {
package = pkgs.montserrat;
name = "Montserrat";
};
serif = {
package = pkgs.montserrat;
name = "Montserrat";
};
sizes = {
applications = 12;
terminal = 15;
desktop = 11;
popups = 12;
};
};
};
}

View File

@@ -0,0 +1,8 @@
{ username, ... }: {
services.syncthing = {
enable = false;
user = "${username}";
dataDir = "/home/${username}";
configDir = "/home/${username}/.config/syncthing";
};
}

38
modules/core/system.nix Normal file
View File

@@ -0,0 +1,38 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) consoleKeyMap;
in
{
nix = {
settings = {
download-buffer-size = 200000000;
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
};
};
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "pl_PL.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "pl_PL.UTF-8";
LC_IDENTIFICATION = "pl_PL.UTF-8";
LC_MEASUREMENT = "pl_PL.UTF-8";
LC_MONETARY = "pl_PL.UTF-8";
LC_NAME = "pl_PL.UTF-8";
LC_NUMERIC = "pl_PL.UTF-8";
LC_PAPER = "pl_PL.UTF-8";
LC_TELEPHONE = "pl_PL.UTF-8";
LC_TIME = "pl_PL.UTF-8";
};
environment.variables = {
NIXOS_OZONE_WL = "1";
ZANEYOS_VERSION = "2.4";
ZANEYOS = "true";
};
console.keyMap = "${consoleKeyMap}";
system.stateVersion = "23.11"; # Do not change!
}

21
modules/core/thunar.nix Normal file
View File

@@ -0,0 +1,21 @@
{ host
, pkgs
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) thunarEnable;
in
{
programs = {
thunar = {
enable = thunarEnable;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
environment.systemPackages = with pkgs; [
ffmpegthumbnailer # Need For Video / Image Preview
];
}

45
modules/core/user.nix Normal file
View File

@@ -0,0 +1,45 @@
{ pkgs
, inputs
, username
, host
, profile
, ...
}:
let
inherit (import ../../hosts/${host}/variables.nix) gitUsername;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = false;
backupFileExtension = "backup";
extraSpecialArgs = { inherit inputs username host profile; };
users.${username} = {
imports = [ ./../home ];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "23.11";
};
};
};
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${gitUsername}";
extraGroups = [
"adbusers"
"docker" #access to docker as non-root
"libvirtd" #Virt manager/QEMU access
"lp"
"networkmanager"
"scanner"
"wheel" #subdo access
"vboxusers" #Virtual Box
];
shell = pkgs.zsh;
ignoreShellProgramCheck = true;
};
nix.settings.allowed-users = [ "${username}" ];
}

View File

@@ -0,0 +1,29 @@
{ pkgs, ... }: {
# Only enable either docker or podman -- Not both
virtualisation = {
docker = {
enable = true;
};
podman.enable = false;
libvirtd = {
enable = true;
};
virtualbox.host = {
enable = false;
enableExtensionPack = true;
};
};
programs = {
virt-manager.enable = false;
};
environment.systemPackages = with pkgs; [
virt-viewer # View Virtual Machines
lazydocker
docker-client
];
}

13
modules/core/xserver.nix Normal file
View File

@@ -0,0 +1,13 @@
{ host, ... }:
let
inherit (import ../../hosts/${host}/variables.nix) keyboardLayout;
in
{
services.xserver = {
enable = false;
xkb = {
layout = "${keyboardLayout}";
variant = "";
};
};
}