refactor: nix fmt classic to nix fmt

This commit is contained in:
Rasyidan Akbar F. 2026-01-30 15:59:48 +07:00
commit f9614371a3
57 changed files with 923 additions and 493 deletions

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
{ lib, ... }:
{
# Modern audio stack - PipeWire replaces PulseAudio + JACK + ALSA
services.pipewire = {
enable = lib.mkDefault true;

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
{ lib, ... }:
{
hardware.bluetooth = {
enable = lib.mkDefault false; # Enable when needed
powerOnBoot = lib.mkDefault true;

View file

@ -1,37 +1,51 @@
{ config, lib, pkgs, user, ... }:
{
config,
lib,
pkgs,
user,
...
}:
let
inherit (lib)
mkEnableOption mkOption mkIf types mkMerge mkAfter optionals mkDefault;
mkEnableOption
mkOption
mkIf
types
mkMerge
mkAfter
optionals
mkDefault
;
cfg = config.rsydn.containerization;
in {
in
{
options.rsydn.containerization = {
podman = {
enable = mkOption {
type = types.bool;
default = true;
description =
"Enable Podman for rootless containers as the primary engine.";
description = "Enable Podman for rootless containers as the primary engine.";
};
dockerCompat = mkOption {
type = types.bool;
default = true;
description =
"Expose the Docker-compatible socket for CLI compatibility.";
description = "Expose the Docker-compatible socket for CLI compatibility.";
};
enableDnsnamePlugin = mkOption {
type = types.bool;
default = true;
description =
"Enable the dnsname CNI plugin so containers can resolve each other.";
description = "Enable the dnsname CNI plugin so containers can resolve each other.";
};
extraPackages = mkOption {
type = types.listOf types.package;
default = with pkgs; [ podman-compose podman-tui ];
description =
"Additional Podman-related packages to install system-wide.";
default = with pkgs; [
podman-compose
podman-tui
];
description = "Additional Podman-related packages to install system-wide.";
};
};
@ -39,8 +53,7 @@ in {
enable = mkOption {
type = types.bool;
default = false;
description =
"Enable the Docker daemon alongside Podman when explicitly requested.";
description = "Enable the Docker daemon alongside Podman when explicitly requested.";
};
autoPrune = mkOption {
@ -49,18 +62,19 @@ in {
enable = mkOption {
type = types.bool;
default = true;
description =
"Automatically prune unused Docker data on a schedule.";
description = "Automatically prune unused Docker data on a schedule.";
};
dates = mkOption {
type = types.str;
default = "weekly";
description =
"Systemd calendar expression for docker system prune.";
description = "Systemd calendar expression for docker system prune.";
};
flags = mkOption {
type = types.listOf types.str;
default = [ "--all" "--volumes" ];
default = [
"--all"
"--volumes"
];
description = "Extra flags passed to docker system prune.";
};
};
@ -71,11 +85,13 @@ in {
};
k3s = {
enable =
mkEnableOption "Run a lightweight Kubernetes control plane with k3s.";
enable = mkEnableOption "Run a lightweight Kubernetes control plane with k3s.";
role = mkOption {
type = types.enum [ "server" "agent" ];
type = types.enum [
"server"
"agent"
];
default = "server";
description = "Choose whether this node runs as a k3s server or agent.";
};
@ -99,14 +115,18 @@ in {
environment.systemPackages = mkAfter cfg.podman.extraPackages;
users.users.${user} = {
subUidRanges = mkDefault [{
startUid = 100000;
count = 65536;
}];
subGidRanges = mkDefault [{
startGid = 100000;
count = 65536;
}];
subUidRanges = mkDefault [
{
startUid = 100000;
count = 65536;
}
];
subGidRanges = mkDefault [
{
startGid = 100000;
count = 65536;
}
];
};
})
@ -130,8 +150,7 @@ in {
extraFlags = cfg.k3s.extraFlags;
};
networking.firewall.allowedTCPPorts =
mkAfter (optionals (cfg.k3s.role == "server") [ 6443 ]);
networking.firewall.allowedTCPPorts = mkAfter (optionals (cfg.k3s.role == "server") [ 6443 ]);
})
];
}

View file

@ -1,4 +1,5 @@
{ pkgs, user, ... }: {
{ pkgs, user, ... }:
{
# Browser configurations for desktop users
home-manager.users.${user} = {

View file

@ -1,4 +1,10 @@
{ lib, pkgs, user, ... }: {
{
lib,
pkgs,
user,
...
}:
{
# Terminal emulator configurations for desktop users
home-manager.users.${user} = {

View file

@ -1,4 +1,5 @@
{ lib, pkgs, ... }: {
{ lib, pkgs, ... }:
{
# Shared desktop settings (imported by all DEs)
# XDG portals for desktop integration

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
# Gaming configuration module
# Steam, Proton, Vulkan, Wine, and gaming optimizations
@ -9,17 +10,18 @@
dedicatedServer.openFirewall = true;
# Enable Proton compatibility layer
extraCompatPackages = with pkgs;
[
proton-ge-bin # GloriousEggroll's Proton builds
];
extraCompatPackages = with pkgs; [
proton-ge-bin # GloriousEggroll's Proton builds
];
};
# GameMode for performance optimization
programs.gamemode = {
enable = true;
settings = {
general = { renice = 10; };
general = {
renice = 10;
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
@ -72,5 +74,7 @@
# ];
# Increase file watchers for game modding tools
boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
boot.kernel.sysctl = {
"fs.inotify.max_user_watches" = 524288;
};
}

View file

@ -2,15 +2,25 @@
# Generated by running: nixos-generate-config --show-hardware-config
# This file contains hardware-specific settings that should be adjusted for your actual hardware
{ config, lib, modulesPath, ... }:
{
config,
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Kernel modules needed during boot
# Adjust based on your hardware (NVMe, SATA, USB, etc.)
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; # Change to "kvm-intel" for Intel CPUs
@ -24,7 +34,10 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/REPLACE-WITH-YOUR-BOOT-UUID";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = [
"fmask=0022"
"dmask=0022"
];
};
# Swap configuration (optional)
@ -34,8 +47,7 @@
# ];
# CPU microcode updates
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# For Intel CPUs, use this instead:
# hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -1,4 +1,10 @@
{ pkgs, lib, user, ... }: {
{
pkgs,
lib,
user,
...
}:
{
imports = [ ../base.nix ];
# System-level: Enable Hyprland
@ -55,17 +61,18 @@
border_size = 2;
};
decoration = { rounding = 8; };
decoration = {
rounding = 8;
};
};
};
# User packages: Hyprland utilities
home.packages = with pkgs;
[
# Uncomment as needed:
# wofi # Launcher
# waybar # Status bar
# dunst # Notifications
];
home.packages = with pkgs; [
# Uncomment as needed:
# wofi # Launcher
# waybar # Status bar
# dunst # Notifications
];
};
}

View file

@ -1,4 +1,10 @@
{ lib, pkgs, user, ... }: {
{
lib,
pkgs,
user,
...
}:
{
imports = [ ./base.nix ];
# System-level: KDE Plasma 6
@ -11,16 +17,15 @@
};
# System packages: KDE applications
environment.systemPackages = with pkgs;
[
# KDE applications (uncomment as needed)
# kdePackages.kate # Text editor
# kdePackages.dolphin # File manager
# kdePackages.konsole # Terminal
# kdePackages.okular # Document viewer
# kdePackages.gwenview # Image viewer
# kdePackages.spectacle # Screenshot tool
];
environment.systemPackages = with pkgs; [
# KDE applications (uncomment as needed)
# kdePackages.kate # Text editor
# kdePackages.dolphin # File manager
# kdePackages.konsole # Terminal
# kdePackages.okular # Document viewer
# kdePackages.gwenview # Image viewer
# kdePackages.spectacle # Screenshot tool
];
# User-level: KDE Plasma settings (optional)
home-manager.users.${user} = {
@ -34,9 +39,8 @@
# };
# User packages for KDE environment
home.packages = with pkgs;
[
# Add user-specific apps here
];
home.packages = with pkgs; [
# Add user-specific apps here
];
};
}

View file

@ -1,4 +1,10 @@
{ lib, pkgs, user, ... }: {
{
lib,
pkgs,
user,
...
}:
{
# Catppuccin theme configuration
# Soothing pastel theme for both GTK and Qt applications
# Works with KDE Plasma, Hyprland, and other desktop environments

View file

@ -1,4 +1,10 @@
{ lib, pkgs, user, ... }: {
{
lib,
pkgs,
user,
...
}:
{
# Default theme configuration for desktop
# Simple Adwaita-dark theme that works across all desktop environments
# Switch to catppuccin.nix or create your own for custom themes

View file

@ -1,10 +1,17 @@
{ lib, pkgs, ... }: {
{ lib, pkgs, ... }:
{
fonts = {
enableDefaultPackages = lib.mkDefault true;
packages = with pkgs; [
# Nerd Fonts for terminal icons
(nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" "Iosevka" ]; })
(nerdfonts.override {
fonts = [
"FiraCode"
"JetBrainsMono"
"Iosevka"
];
})
# Core fonts
noto-fonts
@ -20,7 +27,10 @@
fontconfig = {
enable = lib.mkDefault true;
defaultFonts = {
monospace = [ "JetBrains Mono" "FiraCode Nerd Font" ];
monospace = [
"JetBrains Mono"
"FiraCode Nerd Font"
];
sansSerif = [ "Noto Sans" ];
serif = [ "Noto Serif" ];
emoji = [ "Noto Color Emoji" ];

View file

@ -1,4 +1,5 @@
{ lib, pkgs, ... }: {
{ lib, pkgs, ... }:
{
# Hardware acceleration (OpenGL/Vulkan)
hardware.graphics = {
enable = lib.mkDefault true;

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
# Minimal CLI-only Home Manager configuration
# Used for servers, VMs, and headless systems
# Desktop configs are handled directly in nixos/desktops/* modules

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
{ lib, ... }:
{
networking.useDHCP = lib.mkDefault true;
networking.networkmanager.enable = lib.mkDefault true;
}

View file

@ -1,4 +1,5 @@
{ lib, ... }: {
{ lib, ... }:
{
services.openssh = {
enable = lib.mkDefault true;
openFirewall = lib.mkDefault true;

View file

@ -1,10 +1,22 @@
{ lib, user, ... }: {
imports = [ ./users.nix ./network.nix ./ssh.nix ./containerization.nix ];
{ lib, user, ... }:
{
imports = [
./users.nix
./network.nix
./ssh.nix
./containerization.nix
];
nix = {
settings.auto-optimise-store = lib.mkDefault true;
settings.experimental-features = lib.mkDefault [ "nix-command" "flakes" ];
settings.trusted-users = lib.mkDefault [ "root" user ];
settings.experimental-features = lib.mkDefault [
"nix-command"
"flakes"
];
settings.trusted-users = lib.mkDefault [
"root"
user
];
optimise.automatic = lib.mkDefault true;
gc = {
automatic = lib.mkDefault true;

View file

@ -1,7 +1,17 @@
{ lib, pkgs, user, ... }: {
{
lib,
pkgs,
user,
...
}:
{
users.users.${user} = {
isNormalUser = lib.mkDefault true;
extraGroups = lib.mkDefault [ "wheel" "networkmanager" "docker" ];
extraGroups = lib.mkDefault [
"wheel"
"networkmanager"
"docker"
];
home = lib.mkDefault "/home/${user}";
shell = pkgs.fish;
};

View file

@ -1,4 +1,5 @@
{ lib, pkgs, ... }: {
{ lib, pkgs, ... }:
{
# QEMU guest agent provides graceful shutdowns and metadata exchange.
# Disabled by default - enable in host overlay if needed.
services.qemuGuest.enable = lib.mkDefault false;
@ -18,8 +19,11 @@
"virtio_mmio"
];
boot.kernelModules =
lib.mkDefault [ "virtio_balloon" "virtio_console" "virtio_rng" ];
boot.kernelModules = lib.mkDefault [
"virtio_balloon"
"virtio_console"
"virtio_rng"
];
# Provide udev rules to improve virtio device behaviour.
services.udev.extraRules = lib.mkDefault ''