refactor: make hosts declarative and consolidate shared config

- add my.username / my.gaming.enable / my.ai.local.enable options and
  gate optional app modules on them instead of per-host import lists
- move vendor-neutral hardware.graphics into modules/graphical, leaving
  only NVIDIA-specific drivers and env vars in modules/hardware/nvidia
- derive the primary user everywhere from my.username (users, getty,
  home-manager, tmpfiles)
- de-duplicate Hyprland autostart down to a single system loginShellInit
  using the start-hyprland wrapper
- consolidate all nixpkgs overlays into modules/core/nix.nix and use
  final.stdenv.hostPlatform.system
- make the zsh rebuild helper target $(hostname) instead of hardcoded hades
- add nixpkgs follows for nixos-hardware, pi and comfy-ui (single nixpkgs)
- add .gitignore and a nixfmt flake formatter; format all nix files
- remove empty browser.nix/display-configuration.nix and rename
  local_ai.nix -> local-ai.nix
- document the my.* toggles in the README
This commit is contained in:
2026-09-18 23:32:32 -07:00
parent 367e21ef95
commit 598a43eace
30 changed files with 1093 additions and 768 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
# Nix build results
result
result-*
# home-manager backup files (backupFileExtension = "backup")
*.backup
# direnv
.direnv/

View File

@@ -24,10 +24,22 @@ rebuild switch # zsh helper: sudo nixos-rebuild switch --flake ~/NixOS-Configs
## Adding a new host (e.g. a laptop)
1. Create `hosts/<name>/` with `default.nix`, `hardware-configuration.nix`, and
(optionally) `disko.nix`; import the shared modules (`modules/core`,
`modules/graphical`, `modules/apps`).
(optionally) `disko.nix`. Shared modules (`modules/core`, `modules/graphical`,
`modules/apps`) are already pulled in by `commonModules` in `flake.nix` — the
host only adds its own hardware/disko config.
2. Register it in `flake.nix` under `nixosConfigurations`.
3. Declare host-specific displays in `hosts/<name>/default.nix`:
3. Turn optional features on per machine via the shared `my.*` options:
```nix
# hosts/<name>/default.nix
my = {
username = "anish"; # default; change for a different primary user
gaming.enable = false; # Steam, Gamemode, MangoHud
ai.local.enable = false; # Ollama, ComfyUI, Open WebUI
};
```
4. Declare host-specific displays in `hosts/<name>/default.nix`:
```nix
home-manager.users.anish.volt.monitors = [
@@ -44,4 +56,19 @@ home-manager.users.anish.volt.monitors = [
The `volt.monitors` default (any output @ preferred) keeps every machine working
out of the box; hosts override only what they need. Hosts without an NVIDIA GPU
simply don't import `modules/hardware/nvidia.nix` — all vendor env vars live there.
simply don't import `modules/hardware/nvidia.nix` — all vendor env vars live there,
while the vendor-neutral `hardware.graphics` stack lives in `modules/graphical`.
## Feature toggles (`my.*`)
Optional app modules are always imported (via `modules/apps/default.nix`) but only
activate when a host sets the corresponding flag, so hosts never need to edit
import lists:
| Option | Enables |
| --- | --- |
| `my.username` | Primary user (users, home-manager, getty autologin) |
| `my.gaming.enable` | Steam, Gamemode, MangoHud |
| `my.ai.local.enable` | Ollama (CUDA), ComfyUI, Open WebUI |
Hardware modules remain explicit imports per host (e.g. `modules/hardware/nvidia.nix`).

67
flake.lock generated
View File

@@ -51,7 +51,9 @@
"comfy-ui": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1787851822,
@@ -186,7 +188,9 @@
},
"nixos-hardware": {
"inputs": {
"nixpkgs": "nixpkgs_2"
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1788044418,
@@ -205,16 +209,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1766902085,
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
"lastModified": 1787962033,
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
"rev": "c5c4a43b0e8056328ec4529f735cabdb8f1942bb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
@@ -250,56 +254,13 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1767892417,
"narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
"rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1787962033,
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c5c4a43b0e8056328ec4529f735cabdb8f1942bb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1773646010,
"narHash": "sha256-iYrs97hS7p5u4lQzuNWzuALGIOdkPXvjz7bviiBjUu8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5b2c2d84341b2afb5647081c1386a80d7a8d8605",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pi": {
"inputs": {
"bun2nix": "bun2nix",
"jail-nix": "jail-nix",
"nixpkgs": "nixpkgs_4",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
},
"locked": {
@@ -324,7 +285,7 @@
"herdr": "herdr",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"pi": "pi"
}

View File

@@ -4,7 +4,10 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
@@ -23,9 +26,9 @@
comfy-ui = {
url = "github:utensils/comfyui-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
herdr = {
url = "github:herdrdev/herdr";
inputs.nixpkgs.follows = "nixpkgs";
@@ -33,6 +36,7 @@
pi = {
url = "github:lukasl-dev/pi.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@@ -46,26 +50,18 @@
./modules/graphical
./modules/apps
inputs.home-manager.nixosModules.home-manager
(
{ config, ... }:
{
nixpkgs.overlays = [
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (final) system;
config.allowUnfree = true;
};
})
inputs.antigravity.overlays.default
inputs.comfy-ui.overlays.default
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
backupFileExtension = "backup";
users.anish = import ./home;
users.${config.my.username} = import ./home;
};
}
)
];
in
{
@@ -80,6 +76,8 @@
};
};
formatter.${system} = inputs.nixpkgs.legacyPackages.${system}.nixfmt;
devShells.${system}.default =
let
pkgs = import inputs.nixpkgs {

View File

@@ -48,6 +48,7 @@ in
];
};
xdg.configFile."brave/policies/managed/policies.json".text = builtins.toJSON bravePolicies;
xdg.configFile."BraveSoftware/Brave-Browser/policies/managed/policies.json".text = builtins.toJSON bravePolicies;
xdg.configFile."BraveSoftware/Brave-Browser/policies/managed/policies.json".text =
builtins.toJSON bravePolicies;
xdg.configFile."chromium/policies/managed/policies.json".text = builtins.toJSON bravePolicies;
}

View File

@@ -1,14 +1,22 @@
{ pkgs, inputs, ... }:
let
herdrPkg = if (inputs ? herdr && inputs.herdr ? packages && inputs.herdr.packages ? ${pkgs.stdenv.hostPlatform.system})
then inputs.herdr.packages.${pkgs.stdenv.hostPlatform.system}.default
else (pkgs.herdr or null);
herdrPkg =
if
(
inputs ? herdr
&& inputs.herdr ? packages
&& inputs.herdr.packages ? ${pkgs.stdenv.hostPlatform.system}
)
then
inputs.herdr.packages.${pkgs.stdenv.hostPlatform.system}.default
else
(pkgs.herdr or null);
herdrPicker = pkgs.writeShellScriptBin "herdr-picker" (builtins.readFile ./scripts/herdr-picker.sh);
in
{
home.packages = (if herdrPkg != null then [ herdrPkg ] else []) ++ [
home.packages = (if herdrPkg != null then [ herdrPkg ] else [ ]) ++ [
herdrPicker
];

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
# Deterministic Silicon Volt wallpaper: rendered from SVG at build time,

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
mkLua = lib.generators.mkLuaInline;
@@ -8,13 +13,14 @@ in
# Per-host monitor configuration.
#
# Hosts declare their displays once, in hosts/<host>/default.nix, via:
# home-manager.users.anish.volt.monitors = [ { ... } ];
# home-manager.users.<my.username>.volt.monitors = [ { ... } ];
# and the setting flows into Hyprland here. The default (empty output +
# preferred mode) works on any machine with any display.
# -------------------------------------------------------------------------
options.volt.monitors = lib.mkOption {
description = "Hyprland monitor rules for this host";
type = lib.types.listOf (lib.types.submodule {
type = lib.types.listOf (
lib.types.submodule {
options = {
output = lib.mkOption {
type = lib.types.str;
@@ -40,15 +46,29 @@ in
description = "Optional per-monitor VRR setting (0/1/on-demand).";
};
};
});
}
);
default = [
{ output = ""; mode = "preferred"; position = "auto"; scale = "auto"; }
{
output = "";
mode = "preferred";
position = "auto";
scale = "auto";
}
];
};
config = {
wayland.windowManager.hyprland.settings.monitor = map (m:
{ inherit (m) output mode position scale; }
wayland.windowManager.hyprland.settings.monitor = map (
m:
{
inherit (m)
output
mode
position
scale
;
}
// (lib.optionalAttrs (m.vrr != null) { inherit (m) vrr; })
) config.volt.monitors;
@@ -61,9 +81,15 @@ in
# -----------------------------------------------------------------------
# 1. Variables & Modifiers (Rendered as Lua local variables)
# -----------------------------------------------------------------------
mainMod = { _var = "SUPER"; };
terminal = { _var = "foot"; };
browser = { _var = "brave"; };
mainMod = {
_var = "SUPER";
};
terminal = {
_var = "foot";
};
browser = {
_var = "brave";
};
# -----------------------------------------------------------------------
# 2. Monitors (hl.monitor) - declared per-host via volt.monitors
@@ -74,8 +100,18 @@ in
# 3. Environment Variables (hl.env)
# -----------------------------------------------------------------------
env = [
{ _args = [ "XCURSOR_SIZE" "24" ]; }
{ _args = [ "XDG_SESSION_TYPE" "wayland" ]; }
{
_args = [
"XCURSOR_SIZE"
"24"
];
}
{
_args = [
"XDG_SESSION_TYPE"
"wayland"
];
}
];
# -----------------------------------------------------------------------
@@ -107,7 +143,10 @@ in
col = {
# Silicon Volt: electric lime gradient on focus, glass gray at rest
active_border = {
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
colors = [
"rgba(cffc00ee)"
"rgba(e3ff66ee)"
];
angle = 45;
};
inactive_border = "rgba(ffffff14)";
@@ -127,7 +166,10 @@ in
col = {
border_active = {
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
colors = [
"rgba(cffc00ee)"
"rgba(e3ff66ee)"
];
angle = 45;
};
border_inactive = "rgba(ffffff14)";
@@ -184,19 +226,59 @@ in
"myBezier"
{
type = "bezier";
points = [ [ 0.05 0.9 ] [ 0.1 1.05 ] ];
points = [
[
0.05
0.9
]
[
0.1
1.05
]
];
}
];
}
];
animation = [
{ leaf = "windows"; enabled = true; speed = 7; bezier = "myBezier"; }
{ leaf = "windowsOut"; enabled = true; speed = 7; bezier = "default"; style = "popin 80%"; }
{ leaf = "border"; enabled = true; speed = 10; bezier = "default"; }
{ leaf = "borderangle"; enabled = true; speed = 8; bezier = "default"; }
{ leaf = "fade"; enabled = true; speed = 7; bezier = "default"; }
{ leaf = "workspaces"; enabled = true; speed = 6; bezier = "default"; }
{
leaf = "windows";
enabled = true;
speed = 7;
bezier = "myBezier";
}
{
leaf = "windowsOut";
enabled = true;
speed = 7;
bezier = "default";
style = "popin 80%";
}
{
leaf = "border";
enabled = true;
speed = 10;
bezier = "default";
}
{
leaf = "borderangle";
enabled = true;
speed = 8;
bezier = "default";
}
{
leaf = "fade";
enabled = true;
speed = 7;
bezier = "default";
}
{
leaf = "workspaces";
enabled = true;
speed = 6;
bezier = "default";
}
];
# -----------------------------------------------------------------------
@@ -206,7 +288,8 @@ in
{
_args = [
"hyprland.start"
(mkLua ''function()
(mkLua ''
function()
hl.exec_cmd("qs")
hl.exec_cmd("hyprpaper")
hl.exec_cmd("mako")
@@ -223,48 +306,178 @@ in
# -----------------------------------------------------------------------
bind = [
# Launchers & Window Controls
{ _args = [ (mkLua "mainMod .. \" + Q\"") (mkLua "hl.dsp.exec_cmd(terminal)") ]; }
{ _args = [ (mkLua "mainMod .. \" + C\"") (mkLua "hl.dsp.window.close()") ]; }
{ _args = [ (mkLua "mainMod .. \" + SPACE\"") (mkLua "hl.dsp.exec_cmd(\"rofi -show combi -show-icons\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + N\"") (mkLua "hl.dsp.exec_cmd(\"swaync-client -t -sw\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + TAB\"") (mkLua "hl.dsp.exec_cmd(\"qs ipc call overview toggle\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + V\"") (mkLua "hl.dsp.window.float({ action = \"toggle\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + R\"") (mkLua "hl.dsp.exec_cmd(\"rofi -show combi\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + G\"") (mkLua "hl.dsp.group.toggle()") ]; }
{ _args = [ (mkLua "mainMod .. \" + F\"") (mkLua "hl.dsp.window.fullscreen({ fullscreen = 0 })") ]; }
{
_args = [
(mkLua "mainMod .. \" + Q\"")
(mkLua "hl.dsp.exec_cmd(terminal)")
];
}
{
_args = [
(mkLua "mainMod .. \" + C\"")
(mkLua "hl.dsp.window.close()")
];
}
{
_args = [
(mkLua "mainMod .. \" + SPACE\"")
(mkLua "hl.dsp.exec_cmd(\"rofi -show combi -show-icons\")")
];
}
{
_args = [
(mkLua "mainMod .. \" + N\"")
(mkLua "hl.dsp.exec_cmd(\"swaync-client -t -sw\")")
];
}
{
_args = [
(mkLua "mainMod .. \" + TAB\"")
(mkLua "hl.dsp.exec_cmd(\"qs ipc call overview toggle\")")
];
}
{
_args = [
(mkLua "mainMod .. \" + V\"")
(mkLua "hl.dsp.window.float({ action = \"toggle\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + R\"")
(mkLua "hl.dsp.exec_cmd(\"rofi -show combi\")")
];
}
{
_args = [
(mkLua "mainMod .. \" + G\"")
(mkLua "hl.dsp.group.toggle()")
];
}
{
_args = [
(mkLua "mainMod .. \" + F\"")
(mkLua "hl.dsp.window.fullscreen({ fullscreen = 0 })")
];
}
# Move focus with mainMod + vim
{ _args = [ (mkLua "mainMod .. \" + h\"") (mkLua "hl.dsp.focus({ direction = \"left\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + l\"") (mkLua "hl.dsp.focus({ direction = \"right\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + k\"") (mkLua "hl.dsp.focus({ direction = \"up\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + j\"") (mkLua "hl.dsp.focus({ direction = \"down\" })") ]; }
{
_args = [
(mkLua "mainMod .. \" + h\"")
(mkLua "hl.dsp.focus({ direction = \"left\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + l\"")
(mkLua "hl.dsp.focus({ direction = \"right\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + k\"")
(mkLua "hl.dsp.focus({ direction = \"up\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + j\"")
(mkLua "hl.dsp.focus({ direction = \"down\" })")
];
}
# Move focus within a grouped page
{ _args = [ (mkLua "mainMod .. \" + e\"") (mkLua "hl.dsp.group.next()") ]; }
{ _args = [ (mkLua "mainMod .. \" + d\"") (mkLua "hl.dsp.group.prev()") ]; }
{
_args = [
(mkLua "mainMod .. \" + e\"")
(mkLua "hl.dsp.group.next()")
];
}
{
_args = [
(mkLua "mainMod .. \" + d\"")
(mkLua "hl.dsp.group.prev()")
];
}
# Move window or group with vim keys
{ _args = [ (mkLua "mainMod .. \" + SHIFT + h\"") (mkLua "hl.dsp.window.move({ direction = \"left\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + SHIFT + l\"") (mkLua "hl.dsp.window.move({ direction = \"right\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + SHIFT + k\"") (mkLua "hl.dsp.window.move({ direction = \"up\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + SHIFT + j\"") (mkLua "hl.dsp.window.move({ direction = \"down\" })") ]; }
{
_args = [
(mkLua "mainMod .. \" + SHIFT + h\"")
(mkLua "hl.dsp.window.move({ direction = \"left\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + SHIFT + l\"")
(mkLua "hl.dsp.window.move({ direction = \"right\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + SHIFT + k\"")
(mkLua "hl.dsp.window.move({ direction = \"up\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + SHIFT + j\"")
(mkLua "hl.dsp.window.move({ direction = \"down\" })")
];
}
# Scroll through existing workspaces with mainMod + scroll
{ _args = [ (mkLua "mainMod .. \" + mouse_down\"") (mkLua "hl.dsp.focus({ workspace = \"e+1\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + mouse_up\"") (mkLua "hl.dsp.focus({ workspace = \"e-1\" })") ]; }
{
_args = [
(mkLua "mainMod .. \" + mouse_down\"")
(mkLua "hl.dsp.focus({ workspace = \"e+1\" })")
];
}
{
_args = [
(mkLua "mainMod .. \" + mouse_up\"")
(mkLua "hl.dsp.focus({ workspace = \"e-1\" })")
];
}
# Lock shortcut
{ _args = [ (mkLua "mainMod .. \" + S\"") (mkLua "hl.dsp.exec_cmd(\"hyprlock\")") ]; }
{
_args = [
(mkLua "mainMod .. \" + S\"")
(mkLua "hl.dsp.exec_cmd(\"hyprlock\")")
];
}
# Quick access applications
{ _args = [ (mkLua "mainMod .. \" + b\"") (mkLua "hl.dsp.exec_cmd(browser)") ]; }
{
_args = [
(mkLua "mainMod .. \" + b\"")
(mkLua "hl.dsp.exec_cmd(browser)")
];
}
# Scratch workspace
{ _args = [ (mkLua "mainMod .. \" + RETURN\"") (mkLua "hl.dsp.workspace.toggle_special(\"scratch\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + SHIFT + RETURN\"") (mkLua "hl.dsp.window.move({ workspace = \"special:scratch\" })") ]; }
{
_args = [
(mkLua "mainMod .. \" + RETURN\"")
(mkLua "hl.dsp.workspace.toggle_special(\"scratch\")")
];
}
{
_args = [
(mkLua "mainMod .. \" + SHIFT + RETURN\"")
(mkLua "hl.dsp.window.move({ workspace = \"special:scratch\" })")
];
}
# Messaging workspace
{ _args = [ (mkLua "mainMod .. \" + M\"") (mkLua "hl.dsp.workspace.toggle_special(\"messaging\")") ]; }
{
_args = [
(mkLua "mainMod .. \" + M\"")
(mkLua "hl.dsp.workspace.toggle_special(\"messaging\")")
];
}
# Move/resize windows with mouse and dragging
{
@@ -294,28 +507,40 @@ in
_args = [
"XF86AudioLowerVolume"
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-volume @DEFAULT_SINK@ -5%\")")
{ repeating = true; locked = true; }
{
repeating = true;
locked = true;
}
];
}
{
_args = [
"XF86AudioMute"
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-mute @DEFAULT_SINK@ toggle\")")
{ repeating = true; locked = true; }
{
repeating = true;
locked = true;
}
];
}
{
_args = [
"XF86MonBrightnessUp"
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%+\")")
{ repeating = true; locked = true; }
{
repeating = true;
locked = true;
}
];
}
{
_args = [
"XF86MonBrightnessDown"
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%-\")")
{ repeating = true; locked = true; }
{
repeating = true;
locked = true;
}
];
}
@@ -382,17 +607,23 @@ in
window_rule = [
{
name = "signal-messaging";
match = { class = "Signal"; };
match = {
class = "Signal";
};
workspace = "special:messaging";
}
{
name = "vesktop-messaging";
match = { class = "vesktop"; };
match = {
class = "vesktop";
};
workspace = "special:messaging";
}
{
name = "ghidra-tile";
match = { class = "ghidra-Ghidra"; };
match = {
class = "ghidra-Ghidra";
};
float = false;
}
];

View File

@@ -1,9 +1,17 @@
{ pkgs, inputs, ... }:
let
quickshellPkg = if (inputs ? quickshell && inputs.quickshell ? packages && inputs.quickshell.packages ? ${pkgs.stdenv.hostPlatform.system})
then inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default
else (pkgs.quickshell or pkgs.qt6.qtbase);
quickshellPkg =
if
(
inputs ? quickshell
&& inputs.quickshell ? packages
&& inputs.quickshell.packages ? ${pkgs.stdenv.hostPlatform.system}
)
then
inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default
else
(pkgs.quickshell or pkgs.qt6.qtbase);
in
{
home.packages = with pkgs; [

View File

@@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
treesitterParsers = pkgs.symlinkJoin {
@@ -61,7 +66,9 @@ in
];
extraWrapperArgs = [
"--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}"
"--set"
"NVIM_TREESITTER_PARSERS"
"${treesitterParsers}"
];
};

View File

@@ -3,8 +3,7 @@
let
# Rofi script-mode indexer: exposes every executable user script
# (shell, python, whatever) so the launcher finds "everything".
rofiScripts = pkgs.writeShellScriptBin "rofi-scripts"
(builtins.readFile ./rofi/rofi-scripts.sh);
rofiScripts = pkgs.writeShellScriptBin "rofi-scripts" (builtins.readFile ./rofi/rofi-scripts.sh);
in
{
programs.rofi = {

View File

@@ -47,7 +47,7 @@ rebuild () {
shift 2>/dev/null || true
local config_dir="${FLAKE_CONFIG:-$HOME/NixOS-Configs}"
local host="hades"
local host="${REBUILD_HOST:-$(hostname)}"
local target="$config_dir#$host"
case "$action" in

View File

@@ -11,18 +11,21 @@
inputs.disko.nixosModules.disko
./disko.nix
./hardware-configuration.nix
./display-configuration.nix
../../modules/hardware/nvidia.nix
../../modules/apps/gaming.nix
../../modules/apps/local_ai.nix
];
networking.hostName = "hades";
# Opt this machine into the shared optional feature modules.
my = {
gaming.enable = true;
ai.local.enable = true;
};
# ---------------------------------------------------------------------------
# Host display configuration (absorbed by home/hypr/hyprland.nix)
# ---------------------------------------------------------------------------
home-manager.users.anish.volt.monitors = [
home-manager.users.${config.my.username}.volt.monitors = [
{
# Samsung Odyssey Ark - matched by description so it survives port changes
output = "desc:Samsung Electric Company Odyssey Ark H1AK500000";
@@ -44,7 +47,7 @@
# Ensure /games directory is accessible by default user
systemd.tmpfiles.rules = [
"d /games 0755 anish users -"
"d /games 0755 ${config.my.username} users -"
];
powerManagement.cpuFreqGovernor = "performance";
@@ -58,7 +61,6 @@
};
environment.systemPackages = with pkgs; [
mangohud
nvtopPackages.nvidia
];
}

View File

@@ -14,7 +14,10 @@
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "fmask=0077" "dmask=0077" ];
mountOptions = [
"fmask=0077"
"dmask=0077"
];
};
};
root = {

View File

@@ -1,5 +0,0 @@
{ ... }:
{
# Host-specific display configurations can be placed here if needed.
}

View File

@@ -1,14 +1,27 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "thunderbolt" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"thunderbolt"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];

View File

@@ -1,5 +0,0 @@
{ ... }:
{
# Browser is configured and managed via Home Manager (home/brave.nix)
}

View File

@@ -3,9 +3,10 @@
{
imports = [
./terminal.nix
./browser.nix
./communication.nix
./dev.nix
./virt.nix
./gaming.nix
./local-ai.nix
];
}

View File

@@ -1,6 +1,12 @@
{ pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf config.my.gaming.enable {
programs.steam = {
enable = true;
remotePlay.openFirewall = false;
@@ -12,4 +18,5 @@
mangohud
gamemode
];
};
}

45
modules/apps/local-ai.nix Normal file
View File

@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
inputs,
...
}:
{
imports = [
inputs.comfy-ui.nixosModules.default
];
config = lib.mkIf config.my.ai.local.enable {
services = {
comfyui = {
enable = true;
gpuSupport = "cuda";
enableManager = true;
port = 8188;
listenAddress = "0.0.0.0";
dataDir = "/var/lib/comfyui";
user = "comfyui";
group = "comfyui";
createUser = true;
};
ollama = {
enable = true;
package = pkgs.unstable.ollama-cuda;
host = "0.0.0.0";
port = 11434;
user = "ollama";
group = "ollama";
home = "/var/lib/ollama";
};
open-webui.enable = true;
};
environment.systemPackages = with pkgs; [
unstable.ollama-cuda
];
};
}

View File

@@ -1,37 +0,0 @@
{ pkgs, inputs, ... }:
{
imports = [
inputs.comfy-ui.nixosModules.default
];
services = {
comfyui = {
enable = true;
gpuSupport = "cuda";
enableManager = true;
port = 8188;
listenAddress = "0.0.0.0";
dataDir = "/var/lib/comfyui";
user = "comfyui";
group = "comfyui";
createUser = true;
};
ollama = {
enable = true;
package = pkgs.unstable.ollama-cuda;
host = "0.0.0.0";
port = 11434;
user = "ollama";
group = "ollama";
home = "/var/lib/ollama";
};
open-webui.enable = true;
};
environment.systemPackages = with pkgs; [
unstable.ollama-cuda
];
}

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
virtualisation = {
@@ -27,7 +27,7 @@
programs.virt-manager.enable = true;
users.users.anish.extraGroups = [
users.users.${config.my.username}.extraGroups = [
"libvirtd"
"kvm"
"incus-admin"

View File

@@ -2,6 +2,7 @@
{
imports = [
../options.nix
./system.nix
./users.nix
./nix.nix

View File

@@ -36,12 +36,16 @@
nixpkgs.config.allowUnfree = true;
# Single source of truth for overlays; the flake module imports only the
# modules and does not declare overlays itself.
nixpkgs.overlays = [
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (prev) system;
inherit (prev) config;
system = final.stdenv.hostPlatform.system;
config = final.config;
};
})
inputs.antigravity.overlays.default
inputs.comfy-ui.overlays.default
];
}

View File

@@ -1,20 +1,20 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
{
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
loginShellInit = ''
if [ -z "$DISPLAY" ] && [ "$TTY" = "/dev/tty1" ]; then
exec start-hyprland
fi
'';
};
programs.zsh.enable = true;
users.users.anish = {
users.users.${config.my.username} = {
isNormalUser = true;
description = "Main Account";
extraGroups = [ "wheel" "networkmanager" "video" "audio" "gaming" "llm" ];
extraGroups = [
"wheel"
"networkmanager"
"video"
"audio"
"gaming"
"llm"
];
openssh.authorizedKeys.keys = [
# ssh-ed25519 AAAAA.... add my key here to enable ssh from another computer
];

View File

@@ -1,4 +1,9 @@
{ pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
programs.hyprland = {
@@ -6,16 +11,25 @@
xwayland.enable = true;
};
services.getty.autologinUser = "anish";
services.getty.autologinUser = config.my.username;
# Boot straight into Hyprland from the first virtual console on any machine.
# No display manager required; tty2-6 remain available as plain shells.
# The start-hyprland wrapper ships with programs.hyprland and sets up the
# session environment correctly.
environment.loginShellInit = ''
if [ "$(tty)" = "/dev/tty1" ]; then
exec ${pkgs.hyprland}/bin/Hyprland
exec start-hyprland
fi
'';
# Vendor-neutral graphics stack. Vendor modules (e.g. modules/hardware/nvidia.nix)
# only add drivers and vendor-specific environment variables.
hardware.graphics = {
enable = true;
enable32Bit = true;
};
# Machine-agnostic Wayland session variables.
# GPU/vendor specific variables live with their hardware module (e.g. modules/hardware/nvidia.nix).
environment.sessionVariables = {
@@ -31,11 +45,14 @@
# Fonts used across the desktop shell (Silicon Volt theme):
# JetBrains Mono for terminal/UI mono, IBM Plex Sans for UI sans,
# Instrument Serif for display italics, Nanum Gothic Coding as mono fallback.
fonts.packages = with pkgs; [
fonts.packages =
with pkgs;
[
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
font-awesome
ibm-plex
nanum-gothic-coding
] ++ lib.optional (lib.hasAttr "instrument-serif" pkgs) pkgs.instrument-serif;
]
++ lib.optional (lib.hasAttr "instrument-serif" pkgs) pkgs.instrument-serif;
}

View File

@@ -1,14 +1,19 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
hardware.graphics = {
enable = true;
enable32Bit = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
boot.initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
boot.initrd.kernelModules = [
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
boot.kernelParams = [
"nvidia-drm.modeset=1"
"nvidia-drm.fbdev=1"

20
modules/options.nix Normal file
View File

@@ -0,0 +1,20 @@
{
lib,
...
}:
{
# Shared, machine-agnostic configuration surface. Hosts enable optional
# feature modules by setting these booleans instead of editing import lists.
options.my = {
username = lib.mkOption {
type = lib.types.str;
default = "anish";
description = "Primary interactive user account.";
};
gaming.enable = lib.mkEnableOption "Steam, Gamemode and gaming tooling";
ai.local.enable = lib.mkEnableOption "local AI services (Ollama, ComfyUI, Open WebUI)";
};
}