Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kenanpelit/nixosc

Repository files navigation

NixOS Configuration Suite (nixosc)


Kenan's NixOS Configuration Suite

🖼️ Gallery




📋 Project Overview

NixOS Configuration Suite (nixosc) - Snowfall Edition

A comprehensive, declarative, and modular NixOS configuration built on Snowfall Lib. It manages both system (NixOS) and user (Home Manager) layers from a single flake, featuring a highly customized Wayland desktop environment.

  • Architecture: Snowfall Lib (auto module discovery)
  • Desktop:
    • Niri (Primary): Scrollable-tiling compositor, powered by niri-flake for build-time config validation and binary caching.
    • Hyprland (Secondary): Dynamic tiling compositor with extensive customization.
    • GNOME: Fallback session.
  • Shell / Panel: DankMaterialShell (DMS) integration for panels, widgets, and lock screen.
  • Greeter: greetd + DMS Greeter (dms-greeter) support.
  • Theme: Catppuccin (Mocha) end-to-end integration.
  • Secrets: SOPS-Nix (Age) for secure credential management.

🗃️ Repository Structure

The repository follows the Snowfall Lib layout, where modules are automatically discovered and imported.

.
├── flake.nix             # Core configuration & inputs
├── install.sh            # Unified installation & management tool
├── systems/              # ❄️ Host configurations (hardware-specific)
│   ├── hay/              # Workstation (Laptop)
│   └── vhay/             # Virtual Machine profile
├── modules/              # 🍱 Modular configs
│   ├── nixos/            # System-level modules (services, hardware, greeters)
│   └── home/             # User-level modules (apps, WMs, shell config)
│       ├── niri/         # Modular Niri config (binds, rules, settings)
│       ├── hyprland/     # Modular Hyprland config
│       └── dms/          # DankMaterialShell configuration
├── homes/                # Home-Manager profiles per host/user
├── overlays/             # 🔧 Nixpkgs overlays
└── secrets/              # 🔐 SOPS-encrypted secrets

🧩 Key Technologies

Component Implementation Details
Framework Snowfall Lib
Niri Compositor Uses niri-flake (unstable) for latest features, build-time validation, and caching.
Hyprland Pinned flake input for stability; configs split into binds.nix, rules.nix, etc.
Shell/UI DankMaterialShell (Quickshell-based). Provides top bar, dock, and OSDs.
Launchers DMS Spotlight (primary), Rofi (fallback), Walker.
Authentication Polkit-GNOME + GNOME Keyring (fully integrated via PAM & DBus).
Browsers Brave (default), Chrome.

🚀 Installation

Caution

This configuration is tailored for specific hardware (Dell XPS / Intel). Review systems/x86_64-linux/hay/hardware-configuration.nix before applying to a new machine.

1. Clone & Setup

git clone https://github.com/kenanpelit/nixosc ~/.nixosc
cd ~/.nixosc

2. Install / Switch

Use the helper script to build and switch configurations:

# For Physical Machine (hay)
./install.sh install hay

# For Virtual Machine (vhay)
./install.sh install vhay

3. Update

To update flake inputs (including Niri unstable):

./install.sh update

⌨️ Keybindings

Niri + DMS (Main Session)

  • Modifier: Super (Windows Key)
  • General:
    • Super + Enter -> Terminal (Kitty)
    • Super + Q -> Close Window
    • Super + F -> Maximize Column / Shift+F Fullscreen
    • Super + Space -> DMS Spotlight (Launcher)
    • Super + Tab -> Recent Windows (Alt-Tab switcher)
  • Navigation:
    • Super + Arrows or h/j/k/l -> Move focus
    • Super + Shift + Arrows -> Move window
    • Super + Wheel -> Scroll workspaces
  • DMS Features:
    • Super + C -> Control Center
    • Super + N -> Notifications
    • Alt + L -> Lock Screen (DMS Lock)

Hyprland (Secondary Session)

  • Modifier: Super
  • Same core navigation bindings (h/j/k/l).
  • Super + F -> Toggle Float
  • Super + G -> Toggle Group
  • Super + Tab -> DMS Hypr Overview

🛠 Advanced Features

Modular WM Configuration

Both Niri and Hyprland configurations are split into granular Nix files for better maintainability:

  • binds.nix: Keybindings
  • rules.nix: Window & Layer rules
  • settings.nix: Core compositor settings
  • variables.nix: Environment variables & theming constants

🔋 Power Management (v17 stack)

This repo includes a custom power management stack for laptops (especially Intel HWP / intel_pstate=active) that aims to stay consistent across boot/suspend/AC changes and avoid “mystery overrides”.

  • Module: modules/nixos/power/default.nix
  • Status CLI: osc-system status (use sudo osc-system turbostat-quick to validate real CPU MHz under HWP)
  • Note: Under Intel HWP, scaling_cur_freq can report ~400MHz even when the CPU is busy; prefer turbostat for truth.

What it controls

On physical hosts, the module manages:

  • ACPI Platform Profile (/sys/firmware/acpi/platform_profile)
  • CPU governor (policy-level scaling_governor)
  • Intel EPP (HWP energy preference; policy-level energy_performance_preference)
  • Minimum performance floor (/sys/devices/system/cpu/intel_pstate/min_perf_pct)
  • RAPL power limits (MSR interface via /sys/class/powercap/intel-rapl:0)
  • Thermal guard that clamps PL1/PL2 when package temp crosses thresholds
  • Drift guard (power-policy-guard) to re-apply settings if firmware/other services revert them shortly after boot/resume

Services

The main units you’ll see on a running system:

  • platform-profile.service
  • cpu-governor.service
  • cpu-epp.service
  • cpu-min-freq-guard.service
  • rapl-power-limits.service
  • rapl-thermo-guard.service
  • battery-thresholds.service
  • power-policy-guard.service

To re-apply everything after changes or debugging:

sudo osc-system profile-refresh

Avoiding conflicts

This module disables power-profiles-daemon to prevent it from overriding platform profile / EPP / governor after boot. If you use other power tools (e.g. tlp, auto-cpufreq, thermald), double-check that they are not fighting your policy.

DMS Integration

  • Themes: Automatically managed by DMS/Matugen or manually pinned via settings.nix.
  • Plugins: Installed via imperative dms-plugin-sync service (best-effort).
  • Greeter: Fully supported via modules/nixos/dms-greeter.

Troubleshooting

  • Niri Config Validation: If the build fails with a KDL error, check modules/home/niri/default.nix. The config is validated at build time!
  • Keyring/PAM: If you see gkr-pam errors in logs, ensure seahorse shows the Login keyring as unlocked. It usually works despite the log noise.
  • Discord: Use WebCord for better Wayland support if standard Discord crashes.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

❄️ NixOS - Hyprland rice with Home-Manager ❄️

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •