Added working example

This commit is contained in:
2026-03-21 20:01:50 +00:00
parent 73284fa1da
commit 8ab9d28526
25 changed files with 1493 additions and 0 deletions
@@ -0,0 +1,99 @@
{ ... }:
{
flake.nixosModules.fastfetch = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.apps.fastfetch;
in {
options.mySystem.apps.fastfetch.enable = lib.mkEnableOption "Personalized Fastfetch";
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.fastfetch ];
home-manager.users.shonh.programs.fastfetch = {
enable = true;
settings = {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
"logo" = {
"type" = "small";
"padding" = {
"top" = 1;
"left" = 1;
};
};
"display" = {
"separator" = " ";
};
"modules" = [
{
"key" = "";
"type" = "custom";
}
{
"key" = " {#31} user {#keys}";
"type" = "title";
"format" = "{user-name}";
}
{
"key" = " {#32}󰇅 hname {#keys}";
"type" = "title";
"format" = "{host-name}";
}
{
"key" = " {#33}󰅐 uptime {#keys}";
"type" = "uptime";
}
{
"key" = " {#34}{icon} distro {#keys}";
"type" = "os";
}
{
"key" = " {#35} kernel {#keys}";
"type" = "kernel";
}
{
"key" = " {#36}󰇄 desktop {#keys}";
"type" = "de";
}
{
"key" = " {#31} term {#keys}";
"type" = "terminal";
}
{
"key" = " {#32} shell {#keys}";
"type" = "shell";
}
{
"key" = " {#33}󰍛 cpu {#keys}";
"type" = "cpu";
"showPeCoreCount" = true;
}
{
"key" = " {#34}󰉉 disk {#keys}";
"type" = "disk";
"folders" = "/";
}
{
"key" = " {#35} memory {#keys}";
"type" = "memory";
}
{
"key" = "";
"type" = "custom";
}
{
"key" = " {#39} colors {#keys}";
"type" = "colors";
"symbol" = "circle";
}
{
"key" = "";
"type" = "custom";
}
];
};
};
};
};
}
@@ -0,0 +1,54 @@
{ ... }:
{
flake.nixosModules.foot = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.apps.foot;
colors = config.lib.stylix.colors;
fonts = config.stylix.fonts;
in {
options.mySystem.apps.foot.enable = lib.mkEnableOption "Foot Terminal Emulator";
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.foot ];
home-manager.users.shonh = {
stylix.targets.foot.enable = false;
programs.foot = {
enable = true;
settings = {
main = {
term = "xterm-256color";
dpi-aware = lib.mkForce "yes";
font = "${fonts.monospace.name}:size=${toString fonts.sizes.terminal}";
};
colors-dark = {
background = colors.base00;
foreground = colors.base05;
regular0 = colors.base01; # black
regular1 = colors.base08; # red
regular2 = colors.base0B; # green
regular3 = colors.base0A; # yellow
regular4 = colors.base0D; # blue
regular5 = colors.base0E; # magenta
regular6 = colors.base0C; # cyan
regular7 = colors.base05; # white
bright0 = colors.base03; # bright black
bright1 = colors.base08;
bright2 = colors.base0B;
bright3 = colors.base0A;
bright4 = colors.base0D;
bright5 = colors.base0E;
bright6 = colors.base0C;
bright7 = colors.base07;
};
};
};
};
};
};
}
+23
View File
@@ -0,0 +1,23 @@
{ ... }:
{
flake.nixosModules.git = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.apps.git;
in {
options.mySystem.apps.git.enable = lib.mkEnableOption "Git";
config = lib.mkIf cfg.enable {
programs.git.enable = true;
home-manager.users.shonh.programs.git = {
enable = true;
settings.user = {
name = "Shonhh";
email = "endinja.versitile@gmail.com";
};
};
};
};
}
@@ -0,0 +1,18 @@
{ ... }:
{
flake.nixosModules.neovim = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.apps.neovim;
in {
options.mySystem.apps.neovim.enable = lib.mkEnableOption "Neovim Editor";
config = lib.mkIf cfg.enable {
programs.neovim.enable = true;
home-manager.users.shonh.programs.neovim = {
enable = true;
};
};
};
}
@@ -0,0 +1,48 @@
# modules/apps/yazi.nix
{ ... }:
{
flake.nixosModules.yazi = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.apps.yazi;
in {
options.mySystem.apps.yazi.enable = lib.mkEnableOption "Yazi File Manager";
config = lib.mkIf cfg.enable {
home-manager.users.shonh = {
home.packages = [ pkgs.ripdrag ];
programs.yazi = {
enable = true;
enableBashIntegration = true;
settings = {
opener = {
edit = [
{ run = "nvim \"$@\""; block = true; desc = "Neovim"; }
];
};
open = {
prepend_rules = [
{ mime = "text/*"; use = "edit"; }
];
};
};
keymap = {
mgr.prepend_keymap = [
{
on = [ "<C-n>" ];
run = "shell 'ripdrag \"$@\" -x 2>/dev/null' --confirm --orphan";
desc = "Drag and drop selected files";
}
];
};
};
};
};
};
}
@@ -0,0 +1,242 @@
{ ... }:
{
flake.nixosModules.hyprland = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.desktop.hyprland;
in {
options.mySystem.desktop.hyprland.enable = lib.mkEnableOption "Hyprland Wayland Compositor";
config = lib.mkIf cfg.enable {
# --- System Level Setup ---
programs.hyprland = {
enable = true;
withUWSM = true;
};
# --- User Level Setup
home-manager.users.shonh = {
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false;
settings = {
"$terminal" = "foot";
"$browser" = "vivaldi";
"$file-manager" = "foot yazi";
"$mod" = "SUPER";
"exec-once" = [
"uwsm app -- noctalia-shell"
];
monitor = [
"Virtual-1,1280x720,auto,1"
",highres@highrr,auto,1" # Default
];
bind = [
# Applications
"$mod, T, exec, uwsm app -- $terminal"
"$mod, F, exec, uwsm app -- $browser"
"$mod, E, exec, uwsm app -- $file-manager"
# Desktop Keybinds
"$mod, Delete, exit,"
"$mod+Alt, G, exec, ~/nixos/scripts/gamemode.sh"
"CTRL+ALT, W, exec, noctalia-shell kill || uwsm app -- noctalia-shell"
"$mod, A, exec, noctalia-shell ipc call launcher toggle"
"$mod, Q, killactive,"
"$mod, W, togglefloating,"
"$mod+SHIFT, F, fullscreen"
"$mod, J, togglesplit," # dwindle
# Move focus with mod + arrow keys
"$mod, left, movefocus, l"
"$mod, right, movefocus, r"
"$mod, up, movefocus, u"
"$mod, down, movefocus, d"
# Handling Workspaces
"$mod, 0, workspace, 10"
"$mod SHIFT, 0, movetoworkspace, 10"
"$mod, code:36, togglespecialworkspace, terminal"
# Scroll through existing workspaces with $mod + scroll
"$mod, mouse_down, workspace, e+1"
"$mod, mouse_up, workspace, e-1"
]
++ (
# Binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (
builtins.genList (
i:
let
ws = i + 1;
in
[
"$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
) 9
)
);
bindm = [
"$mod, Z, movewindow"
"$mod, X, resizewindow"
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
# Laptop multimedia keys for volume and LCD brightness
bindel = [
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
",XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
",XF86MonBrightnessUp, exec, brightnessctl s 5%+"
",XF86MonBrightnessDown, exec, brightnessctl s 5%-"
];
bindl = [
", XF86AudioNext, exec, playerctl next"
", XF86AudioPause, exec, playerctl play-pause"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
];
# General
general = {
gaps_in = 3;
gaps_out = 8;
border_size = 2;
resize_on_border = true;
allow_tearing = false;
layout = "dwindle";
};
# Decoration
decoration = {
rounding = 7;
active_opacity = 1.0;
inactive_opacity = 1.0;
blur = {
enabled = true;
size = 5;
passes = 3;
new_optimizations = "on";
ignore_opacity = "on";
xray = false;
};
};
windowrule = [
# Opacity Rules
"match:class ^($terminal)$, opacity 0.80 0.80"
];
workspace = [
"10, border:false, rounding:false"
"special:terminal, on-created-empty:[float; size 960 540] $terminal, persistent:false"
];
gesture = [
"3, horizontal, workspace"
];
# Layout configuration
dwindle = {
pseudotile = true;
preserve_split = true;
};
master = {
new_status = "master";
};
# Miscellaneous
misc = {
force_default_wallpaper = 0;
disable_hyprland_logo = true;
};
# Input
input = {
kb_layout = "us";
follow_mouse = 1;
sensitivity = 0.30;
scroll_factor = 0.5;
accel_profile = "flat";
emulate_discrete_scroll = 0;
touchpad = {
disable_while_typing = false;
natural_scroll = true;
scroll_factor = 0.15;
};
};
cursor = {
no_hardware_cursors = 1;
};
device = [
{
# ... add later
}
];
# Animations
animations = {
enabled = true;
bezier = [
"wind, 0.05, 0.85, 0.03, 0.97"
"winIn, 0.07, 0.88, 0.04, 0.99"
"winOut, 0.20, -0.15, 0, 1"
"liner, 1, 1, 1, 1"
"md3_standard, 0.12, 0, 0, 1"
"md3_decel, 0.05, 0.80, 0.10, 0.97"
"md3_accel, 0.20, 0, 0.80, 0.08"
"overshot, 0.05, 0.85, 0.07, 1.04"
"crazyshot, 0.1, 1.22, 0.68, 0.98"
"hyprnostretch, 0.05, 0.82, 0, 1"
"menu_decel, 0.05, 0.82, 0, 1"
"menu_accel, 0.20, 0, 0.82, 0.10"
"easeInOutCirc, 0.78, 0, 0.15, 1"
"easeOutCirc, 0, 0.48, 0.38, 1"
"easeOutExpo, 0.10, 0.94, 0.23, 0.98"
"softAcDecel, 0.20, 0.20, 0.15, 1"
"md2, 0.30, 0, 0.15, 1"
"OutBack, 0.28, 1.40, 0.58, 1"
];
animation = [
"border, 1, 1.6, liner"
"borderangle, 1, 82, liner, once"
"windowsIn, 1, 3.2, winIn, slide"
"windowsOut, 1, 2.8, easeOutCirc"
"windowsMove, 1, 3.0, wind, slide"
"fade, 1, 1.8, md3_decel"
"layersIn, 1, 1.8, menu_decel, slide"
"layersOut, 1, 1.5, menu_accel"
"fadeLayersIn, 1, 1.6, menu_decel"
"fadeLayersOut, 1, 1.8, menu_accel"
"workspaces, 1, 4.0, menu_decel, slide"
"specialWorkspace, 1, 2.3, md3_decel, slidefadevert 15%"
];
};
};
};
};
};
};
}
@@ -0,0 +1,26 @@
# modules/desktop/noctalia.nix
{ ... }:
{
flake.nixosModules.noctalia = { config, lib, pkgs, inputs, ... }:
let
cfg = config.mySystem.desktop.noctalia;
in {
options.mySystem.desktop.noctalia.enable = lib.mkEnableOption "Noctalia Shell";
config = lib.mkIf cfg.enable {
# Noctalia needs these background services to read battery and hardware data
mySystem.system.power-management.enable = true;
mySystem.hardware.bluetooth.enable = true;
home-manager.users.shonh = {
imports = [ inputs.noctalia.homeModules.default ];
programs.noctalia-shell = {
enable = true;
};
};
};
};
}
@@ -0,0 +1,52 @@
{ ... }:
{
flake.nixosModules.stylix = { inputs, config, lib, pkgs, ... }:
let
cfg = config.mySystem.desktop.stylix;
in {
options.mySystem.desktop.stylix.enable = lib.mkEnableOption "Stylix System Theming";
config = lib.mkIf cfg.enable {
stylix = {
enable = true;
image = inputs.self + "/wallpapers/wallpaper1.jpg";
polarity = "dark";
cursor = {
package = pkgs.phinger-cursors;
name = "phinger-cursors-light";
size = 24;
};
fonts = {
monospace = {
package = pkgs.nerd-fonts.fira-code;
name = "Fira Code Nerd Font";
};
sansSerif = {
package = pkgs.lato;
name = "Lato";
};
};
icons = {
enable = true;
package = pkgs.papirus-icon-theme;
dark = "Papirus-Dark";
light = "Papirus-Light";
};
};
home-manager.users.shonh.home.sessionVariables = {
XCURSOR_THEME = config.stylix.cursor.name;
XCURSOR_SIZE = toString config.stylix.cursor.size;
HYPRCURSOR_THEME = config.stylix.cursor.name;
HYPRCURSOR_SIZE = toString config.stylix.cursor.size;
};
};
};
}
@@ -0,0 +1,18 @@
{ ... }:
{
flake.nixosModules.bluetooth = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.hardware.bluetooth;
in {
options.mySystem.hardware.bluetooth.enable = lib.mkEnableOption "Bluetooth Support";
config = lib.mkIf cfg.enable {
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
environment.systemPackages = [
pkgs.bluetui
];
};
};
}
@@ -0,0 +1,50 @@
{ ... }:
{
flake.nixosModules.nvidia = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.hardware.nvidia;
in {
options.mySystem.hardware.nvidia.enable = lib.mkEnableOption "NVIDIA Drivers and Wayland Fixes";
config = lib.mkIf cfg.enable {
# 1. Enable OpenGL / Graphics Support
hardware.graphics = {
enable = true;
enable32Bit = true; # Crucial for 32-bit games (like older Terraria versions/mods)
extraPackages = with pkgs; [
nvidia-vaapi-driver
];
};
# 2. Tell X11/Wayland to use the Nvidia driver
services.xserver.videoDrivers = [ "nvidia" ];
# 3. Configure the Nvidia package
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# 4. Inject Wayland variables into UWSM to force NVIDIA hardware acceleration
home-manager.users.shonh = {
home.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
XDG_SESSION_TYPE = "wayland";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
NVD_BACKEND = "direct"; # Fixes graphical glitches in Electron/Chromium apps
NIXOS_OZONE_WL = "1";
};
};
};
};
}
@@ -0,0 +1,92 @@
{ ... }:
{
flake.nixosModules.core = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.system.core;
in {
options.mySystem.system.core.enable = lib.mkEnableOption "Core System Settings";
config = lib.mkIf cfg.enable {
# --- Flakes & Nix Settings ---
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
download-buffer-size = 536870912; # 512 MB
cores = 2;
max-jobs = 1;
};
nixpkgs.config.allowUnfree = true;
# --- Kernel ---
boot.kernelPackages = pkgs.linuxPackages_latest;
# --- Networking ---
networking.networkmanager.enable = true;
# --- Time & Locale ---
time.timeZone = "America/Chicago";
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";
};
# --- X11 & Login Manager ---
services.xserver.enable = true;
mySystem.system.login-manager.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
# --- Services (Printing & Audio) ---
services.printing.enable = true;
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# --- User Account ---
users.users.shonh = {
isNormalUser = true;
description = "Shonh";
extraGroups = [ "networkmanager" "wheel" ];
};
# --- Home Manager Base ---
home-manager = {
backupFileExtension = "backup";
users.shonh = {
home.sessionVariables = {
TERMINAL = "foot";
EDITOR = "nvim";
BROWSER = "vivaldi";
};
home.stateVersion = "25.11";
};
};
# --- Base Applications ---
environment.systemPackages = with pkgs; [
tree
sl
vivaldi
];
};
};
}
@@ -0,0 +1,22 @@
{ ... }:
{
flake.nixosModules.login-manager = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.system.login-manager;
in {
options.mySystem.system.login-manager.enable = lib.mkEnableOption "TuiGreetd Login Manager";
config = lib.mkIf cfg.enable {
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.tuigreet}/bin/tuigreet -t --user-menu -r --remember-session --asterisks --sessions ${config.services.displayManager.sessionData.desktops}/share/wayland-sessions";
user = "greeter";
};
};
};
};
};
}
@@ -0,0 +1,18 @@
{ ... }:
{
# Push the configuration into the Flake's module pool
flake.nixosModules.bluetooth = { config, lib, pkgs, ... }:
let
cfg = config.mySystem.system.power-management;
in {
# 1. Define the custom toggle
options.mySystem.system.power-management.enable = lib.mkEnableOption "Power Management/Profiles";
# 2. Apply the configuration
config = lib.mkIf cfg.enable {
services.upower.enable = true;
services.power-profiles-daemon.enable = true;
};
};
}