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:
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Nix build results
|
||||||
|
result
|
||||||
|
result-*
|
||||||
|
|
||||||
|
# home-manager backup files (backupFileExtension = "backup")
|
||||||
|
*.backup
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv/
|
||||||
35
README.md
35
README.md
@@ -24,10 +24,22 @@ rebuild switch # zsh helper: sudo nixos-rebuild switch --flake ~/NixOS-Configs
|
|||||||
## Adding a new host (e.g. a laptop)
|
## Adding a new host (e.g. a laptop)
|
||||||
|
|
||||||
1. Create `hosts/<name>/` with `default.nix`, `hardware-configuration.nix`, and
|
1. Create `hosts/<name>/` with `default.nix`, `hardware-configuration.nix`, and
|
||||||
(optionally) `disko.nix`; import the shared modules (`modules/core`,
|
(optionally) `disko.nix`. Shared modules (`modules/core`, `modules/graphical`,
|
||||||
`modules/graphical`, `modules/apps`).
|
`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`.
|
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
|
```nix
|
||||||
home-manager.users.anish.volt.monitors = [
|
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
|
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
|
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
67
flake.lock
generated
@@ -51,7 +51,9 @@
|
|||||||
"comfy-ui": {
|
"comfy-ui": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1787851822,
|
"lastModified": 1787851822,
|
||||||
@@ -186,7 +188,9 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1788044418,
|
"lastModified": 1788044418,
|
||||||
@@ -205,16 +209,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766902085,
|
"lastModified": 1787962033,
|
||||||
"narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=",
|
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4",
|
"rev": "c5c4a43b0e8056328ec4529f735cabdb8f1942bb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-26.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -250,56 +254,13 @@
|
|||||||
"type": "github"
|
"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": {
|
"pi": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"bun2nix": "bun2nix",
|
"bun2nix": "bun2nix",
|
||||||
"jail-nix": "jail-nix",
|
"jail-nix": "jail-nix",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -324,7 +285,7 @@
|
|||||||
"herdr": "herdr",
|
"herdr": "herdr",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"pi": "pi"
|
"pi": "pi"
|
||||||
}
|
}
|
||||||
|
|||||||
26
flake.nix
26
flake.nix
@@ -4,7 +4,10 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
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 = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-26.05";
|
url = "github:nix-community/home-manager/release-26.05";
|
||||||
@@ -23,9 +26,9 @@
|
|||||||
|
|
||||||
comfy-ui = {
|
comfy-ui = {
|
||||||
url = "github:utensils/comfyui-nix";
|
url = "github:utensils/comfyui-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
herdr = {
|
herdr = {
|
||||||
url = "github:herdrdev/herdr";
|
url = "github:herdrdev/herdr";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
|
|
||||||
pi = {
|
pi = {
|
||||||
url = "github:lukasl-dev/pi.nix";
|
url = "github:lukasl-dev/pi.nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,26 +50,18 @@
|
|||||||
./modules/graphical
|
./modules/graphical
|
||||||
./modules/apps
|
./modules/apps
|
||||||
inputs.home-manager.nixosModules.home-manager
|
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 = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; };
|
||||||
backupFileExtension = "backup";
|
backupFileExtension = "backup";
|
||||||
users.anish = import ./home;
|
users.${config.my.username} = import ./home;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -80,6 +76,8 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formatter.${system} = inputs.nixpkgs.legacyPackages.${system}.nixfmt;
|
||||||
|
|
||||||
devShells.${system}.default =
|
devShells.${system}.default =
|
||||||
let
|
let
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
xdg.configFile."brave/policies/managed/policies.json".text = builtins.toJSON bravePolicies;
|
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;
|
xdg.configFile."chromium/policies/managed/policies.json".text = builtins.toJSON bravePolicies;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
herdrPkg = if (inputs ? herdr && inputs.herdr ? packages && inputs.herdr.packages ? ${pkgs.stdenv.hostPlatform.system})
|
herdrPkg =
|
||||||
then inputs.herdr.packages.${pkgs.stdenv.hostPlatform.system}.default
|
if
|
||||||
else (pkgs.herdr or null);
|
(
|
||||||
|
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);
|
herdrPicker = pkgs.writeShellScriptBin "herdr-picker" (builtins.readFile ./scripts/herdr-picker.sh);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.packages = (if herdrPkg != null then [ herdrPkg ] else []) ++ [
|
home.packages = (if herdrPkg != null then [ herdrPkg ] else [ ]) ++ [
|
||||||
herdrPicker
|
herdrPicker
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Deterministic Silicon Volt wallpaper: rendered from SVG at build time,
|
# Deterministic Silicon Volt wallpaper: rendered from SVG at build time,
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
mkLua = lib.generators.mkLuaInline;
|
mkLua = lib.generators.mkLuaInline;
|
||||||
@@ -8,13 +13,14 @@ in
|
|||||||
# Per-host monitor configuration.
|
# Per-host monitor configuration.
|
||||||
#
|
#
|
||||||
# Hosts declare their displays once, in hosts/<host>/default.nix, via:
|
# 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 +
|
# and the setting flows into Hyprland here. The default (empty output +
|
||||||
# preferred mode) works on any machine with any display.
|
# preferred mode) works on any machine with any display.
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
options.volt.monitors = lib.mkOption {
|
options.volt.monitors = lib.mkOption {
|
||||||
description = "Hyprland monitor rules for this host";
|
description = "Hyprland monitor rules for this host";
|
||||||
type = lib.types.listOf (lib.types.submodule {
|
type = lib.types.listOf (
|
||||||
|
lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
output = lib.mkOption {
|
output = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
@@ -40,15 +46,29 @@ in
|
|||||||
description = "Optional per-monitor VRR setting (0/1/on-demand).";
|
description = "Optional per-monitor VRR setting (0/1/on-demand).";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
default = [
|
default = [
|
||||||
{ output = ""; mode = "preferred"; position = "auto"; scale = "auto"; }
|
{
|
||||||
|
output = "";
|
||||||
|
mode = "preferred";
|
||||||
|
position = "auto";
|
||||||
|
scale = "auto";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
wayland.windowManager.hyprland.settings.monitor = map (m:
|
wayland.windowManager.hyprland.settings.monitor = map (
|
||||||
{ inherit (m) output mode position scale; }
|
m:
|
||||||
|
{
|
||||||
|
inherit (m)
|
||||||
|
output
|
||||||
|
mode
|
||||||
|
position
|
||||||
|
scale
|
||||||
|
;
|
||||||
|
}
|
||||||
// (lib.optionalAttrs (m.vrr != null) { inherit (m) vrr; })
|
// (lib.optionalAttrs (m.vrr != null) { inherit (m) vrr; })
|
||||||
) config.volt.monitors;
|
) config.volt.monitors;
|
||||||
|
|
||||||
@@ -61,9 +81,15 @@ in
|
|||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# 1. Variables & Modifiers (Rendered as Lua local variables)
|
# 1. Variables & Modifiers (Rendered as Lua local variables)
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
mainMod = { _var = "SUPER"; };
|
mainMod = {
|
||||||
terminal = { _var = "foot"; };
|
_var = "SUPER";
|
||||||
browser = { _var = "brave"; };
|
};
|
||||||
|
terminal = {
|
||||||
|
_var = "foot";
|
||||||
|
};
|
||||||
|
browser = {
|
||||||
|
_var = "brave";
|
||||||
|
};
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
# 2. Monitors (hl.monitor) - declared per-host via volt.monitors
|
# 2. Monitors (hl.monitor) - declared per-host via volt.monitors
|
||||||
@@ -74,8 +100,18 @@ in
|
|||||||
# 3. Environment Variables (hl.env)
|
# 3. Environment Variables (hl.env)
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
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 = {
|
col = {
|
||||||
# Silicon Volt: electric lime gradient on focus, glass gray at rest
|
# Silicon Volt: electric lime gradient on focus, glass gray at rest
|
||||||
active_border = {
|
active_border = {
|
||||||
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
|
colors = [
|
||||||
|
"rgba(cffc00ee)"
|
||||||
|
"rgba(e3ff66ee)"
|
||||||
|
];
|
||||||
angle = 45;
|
angle = 45;
|
||||||
};
|
};
|
||||||
inactive_border = "rgba(ffffff14)";
|
inactive_border = "rgba(ffffff14)";
|
||||||
@@ -127,7 +166,10 @@ in
|
|||||||
|
|
||||||
col = {
|
col = {
|
||||||
border_active = {
|
border_active = {
|
||||||
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
|
colors = [
|
||||||
|
"rgba(cffc00ee)"
|
||||||
|
"rgba(e3ff66ee)"
|
||||||
|
];
|
||||||
angle = 45;
|
angle = 45;
|
||||||
};
|
};
|
||||||
border_inactive = "rgba(ffffff14)";
|
border_inactive = "rgba(ffffff14)";
|
||||||
@@ -184,19 +226,59 @@ in
|
|||||||
"myBezier"
|
"myBezier"
|
||||||
{
|
{
|
||||||
type = "bezier";
|
type = "bezier";
|
||||||
points = [ [ 0.05 0.9 ] [ 0.1 1.05 ] ];
|
points = [
|
||||||
|
[
|
||||||
|
0.05
|
||||||
|
0.9
|
||||||
|
]
|
||||||
|
[
|
||||||
|
0.1
|
||||||
|
1.05
|
||||||
|
]
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
animation = [
|
animation = [
|
||||||
{ leaf = "windows"; enabled = true; speed = 7; bezier = "myBezier"; }
|
{
|
||||||
{ leaf = "windowsOut"; enabled = true; speed = 7; bezier = "default"; style = "popin 80%"; }
|
leaf = "windows";
|
||||||
{ leaf = "border"; enabled = true; speed = 10; bezier = "default"; }
|
enabled = true;
|
||||||
{ leaf = "borderangle"; enabled = true; speed = 8; bezier = "default"; }
|
speed = 7;
|
||||||
{ leaf = "fade"; enabled = true; speed = 7; bezier = "default"; }
|
bezier = "myBezier";
|
||||||
{ leaf = "workspaces"; enabled = true; speed = 6; bezier = "default"; }
|
}
|
||||||
|
{
|
||||||
|
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 = [
|
_args = [
|
||||||
"hyprland.start"
|
"hyprland.start"
|
||||||
(mkLua ''function()
|
(mkLua ''
|
||||||
|
function()
|
||||||
hl.exec_cmd("qs")
|
hl.exec_cmd("qs")
|
||||||
hl.exec_cmd("hyprpaper")
|
hl.exec_cmd("hyprpaper")
|
||||||
hl.exec_cmd("mako")
|
hl.exec_cmd("mako")
|
||||||
@@ -223,48 +306,178 @@ in
|
|||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
bind = [
|
bind = [
|
||||||
# Launchers & Window Controls
|
# Launchers & Window Controls
|
||||||
{ _args = [ (mkLua "mainMod .. \" + Q\"") (mkLua "hl.dsp.exec_cmd(terminal)") ]; }
|
{
|
||||||
{ _args = [ (mkLua "mainMod .. \" + C\"") (mkLua "hl.dsp.window.close()") ]; }
|
_args = [
|
||||||
{ _args = [ (mkLua "mainMod .. \" + SPACE\"") (mkLua "hl.dsp.exec_cmd(\"rofi -show combi -show-icons\")") ]; }
|
(mkLua "mainMod .. \" + Q\"")
|
||||||
{ _args = [ (mkLua "mainMod .. \" + N\"") (mkLua "hl.dsp.exec_cmd(\"swaync-client -t -sw\")") ]; }
|
(mkLua "hl.dsp.exec_cmd(terminal)")
|
||||||
{ _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 = [
|
||||||
{ _args = [ (mkLua "mainMod .. \" + F\"") (mkLua "hl.dsp.window.fullscreen({ fullscreen = 0 })") ]; }
|
(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
|
# 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 = [
|
||||||
{ _args = [ (mkLua "mainMod .. \" + k\"") (mkLua "hl.dsp.focus({ direction = \"up\" })") ]; }
|
(mkLua "mainMod .. \" + h\"")
|
||||||
{ _args = [ (mkLua "mainMod .. \" + j\"") (mkLua "hl.dsp.focus({ direction = \"down\" })") ]; }
|
(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
|
# 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
|
# 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 = [
|
||||||
{ _args = [ (mkLua "mainMod .. \" + SHIFT + k\"") (mkLua "hl.dsp.window.move({ direction = \"up\" })") ]; }
|
(mkLua "mainMod .. \" + SHIFT + h\"")
|
||||||
{ _args = [ (mkLua "mainMod .. \" + SHIFT + j\"") (mkLua "hl.dsp.window.move({ direction = \"down\" })") ]; }
|
(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
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
# Move/resize windows with mouse and dragging
|
||||||
{
|
{
|
||||||
@@ -294,28 +507,40 @@ in
|
|||||||
_args = [
|
_args = [
|
||||||
"XF86AudioLowerVolume"
|
"XF86AudioLowerVolume"
|
||||||
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-volume @DEFAULT_SINK@ -5%\")")
|
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-volume @DEFAULT_SINK@ -5%\")")
|
||||||
{ repeating = true; locked = true; }
|
{
|
||||||
|
repeating = true;
|
||||||
|
locked = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
_args = [
|
_args = [
|
||||||
"XF86AudioMute"
|
"XF86AudioMute"
|
||||||
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-mute @DEFAULT_SINK@ toggle\")")
|
(mkLua "hl.dsp.exec_cmd(\"pactl -- set-sink-mute @DEFAULT_SINK@ toggle\")")
|
||||||
{ repeating = true; locked = true; }
|
{
|
||||||
|
repeating = true;
|
||||||
|
locked = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
_args = [
|
_args = [
|
||||||
"XF86MonBrightnessUp"
|
"XF86MonBrightnessUp"
|
||||||
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%+\")")
|
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%+\")")
|
||||||
{ repeating = true; locked = true; }
|
{
|
||||||
|
repeating = true;
|
||||||
|
locked = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
_args = [
|
_args = [
|
||||||
"XF86MonBrightnessDown"
|
"XF86MonBrightnessDown"
|
||||||
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%-\")")
|
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%-\")")
|
||||||
{ repeating = true; locked = true; }
|
{
|
||||||
|
repeating = true;
|
||||||
|
locked = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,17 +607,23 @@ in
|
|||||||
window_rule = [
|
window_rule = [
|
||||||
{
|
{
|
||||||
name = "signal-messaging";
|
name = "signal-messaging";
|
||||||
match = { class = "Signal"; };
|
match = {
|
||||||
|
class = "Signal";
|
||||||
|
};
|
||||||
workspace = "special:messaging";
|
workspace = "special:messaging";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "vesktop-messaging";
|
name = "vesktop-messaging";
|
||||||
match = { class = "vesktop"; };
|
match = {
|
||||||
|
class = "vesktop";
|
||||||
|
};
|
||||||
workspace = "special:messaging";
|
workspace = "special:messaging";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "ghidra-tile";
|
name = "ghidra-tile";
|
||||||
match = { class = "ghidra-Ghidra"; };
|
match = {
|
||||||
|
class = "ghidra-Ghidra";
|
||||||
|
};
|
||||||
float = false;
|
float = false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
{ pkgs, inputs, ... }:
|
{ pkgs, inputs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
quickshellPkg = if (inputs ? quickshell && inputs.quickshell ? packages && inputs.quickshell.packages ? ${pkgs.stdenv.hostPlatform.system})
|
quickshellPkg =
|
||||||
then inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default
|
if
|
||||||
else (pkgs.quickshell or pkgs.qt6.qtbase);
|
(
|
||||||
|
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
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
treesitterParsers = pkgs.symlinkJoin {
|
treesitterParsers = pkgs.symlinkJoin {
|
||||||
@@ -61,7 +66,9 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
extraWrapperArgs = [
|
extraWrapperArgs = [
|
||||||
"--set" "NVIM_TREESITTER_PARSERS" "${treesitterParsers}"
|
"--set"
|
||||||
|
"NVIM_TREESITTER_PARSERS"
|
||||||
|
"${treesitterParsers}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
let
|
let
|
||||||
# Rofi script-mode indexer: exposes every executable user script
|
# Rofi script-mode indexer: exposes every executable user script
|
||||||
# (shell, python, whatever) so the launcher finds "everything".
|
# (shell, python, whatever) so the launcher finds "everything".
|
||||||
rofiScripts = pkgs.writeShellScriptBin "rofi-scripts"
|
rofiScripts = pkgs.writeShellScriptBin "rofi-scripts" (builtins.readFile ./rofi/rofi-scripts.sh);
|
||||||
(builtins.readFile ./rofi/rofi-scripts.sh);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.rofi = {
|
programs.rofi = {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ rebuild () {
|
|||||||
shift 2>/dev/null || true
|
shift 2>/dev/null || true
|
||||||
|
|
||||||
local config_dir="${FLAKE_CONFIG:-$HOME/NixOS-Configs}"
|
local config_dir="${FLAKE_CONFIG:-$HOME/NixOS-Configs}"
|
||||||
local host="hades"
|
local host="${REBUILD_HOST:-$(hostname)}"
|
||||||
local target="$config_dir#$host"
|
local target="$config_dir#$host"
|
||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
|
|||||||
@@ -11,18 +11,21 @@
|
|||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
./disko.nix
|
./disko.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./display-configuration.nix
|
|
||||||
../../modules/hardware/nvidia.nix
|
../../modules/hardware/nvidia.nix
|
||||||
../../modules/apps/gaming.nix
|
|
||||||
../../modules/apps/local_ai.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "hades";
|
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)
|
# 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
|
# Samsung Odyssey Ark - matched by description so it survives port changes
|
||||||
output = "desc:Samsung Electric Company Odyssey Ark H1AK500000";
|
output = "desc:Samsung Electric Company Odyssey Ark H1AK500000";
|
||||||
@@ -44,7 +47,7 @@
|
|||||||
|
|
||||||
# Ensure /games directory is accessible by default user
|
# Ensure /games directory is accessible by default user
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /games 0755 anish users -"
|
"d /games 0755 ${config.my.username} users -"
|
||||||
];
|
];
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
@@ -58,7 +61,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
mangohud
|
|
||||||
nvtopPackages.nvidia
|
nvtopPackages.nvidia
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "vfat";
|
format = "vfat";
|
||||||
mountpoint = "/boot";
|
mountpoint = "/boot";
|
||||||
mountOptions = [ "fmask=0077" "dmask=0077" ];
|
mountOptions = [
|
||||||
|
"fmask=0077"
|
||||||
|
"dmask=0077"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
root = {
|
root = {
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Host-specific display configurations can be placed here if needed.
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,27 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(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.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Browser is configured and managed via Home Manager (home/brave.nix)
|
|
||||||
}
|
|
||||||
@@ -3,9 +3,10 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./terminal.nix
|
./terminal.nix
|
||||||
./browser.nix
|
|
||||||
./communication.nix
|
./communication.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
./virt.nix
|
./virt.nix
|
||||||
|
./gaming.nix
|
||||||
|
./local-ai.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
{ pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config = lib.mkIf config.my.gaming.enable {
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = false;
|
remotePlay.openFirewall = false;
|
||||||
@@ -12,4 +18,5 @@
|
|||||||
mangohud
|
mangohud
|
||||||
gamemode
|
gamemode
|
||||||
];
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
45
modules/apps/local-ai.nix
Normal file
45
modules/apps/local-ai.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -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
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
|
||||||
users.users.anish.extraGroups = [
|
users.users.${config.my.username}.extraGroups = [
|
||||||
"libvirtd"
|
"libvirtd"
|
||||||
"kvm"
|
"kvm"
|
||||||
"incus-admin"
|
"incus-admin"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../options.nix
|
||||||
./system.nix
|
./system.nix
|
||||||
./users.nix
|
./users.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
|
|||||||
@@ -36,12 +36,16 @@
|
|||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
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 = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
unstable = import inputs.nixpkgs-unstable {
|
unstable = import inputs.nixpkgs-unstable {
|
||||||
inherit (prev) system;
|
system = final.stdenv.hostPlatform.system;
|
||||||
inherit (prev) config;
|
config = final.config;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
inputs.antigravity.overlays.default
|
||||||
|
inputs.comfy-ui.overlays.default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
programs.zsh = {
|
programs.zsh.enable = true;
|
||||||
enable = true;
|
|
||||||
loginShellInit = ''
|
|
||||||
if [ -z "$DISPLAY" ] && [ "$TTY" = "/dev/tty1" ]; then
|
|
||||||
exec start-hyprland
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.anish = {
|
users.users.${config.my.username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Main Account";
|
description = "Main Account";
|
||||||
extraGroups = [ "wheel" "networkmanager" "video" "audio" "gaming" "llm" ];
|
extraGroups = [
|
||||||
|
"wheel"
|
||||||
|
"networkmanager"
|
||||||
|
"video"
|
||||||
|
"audio"
|
||||||
|
"gaming"
|
||||||
|
"llm"
|
||||||
|
];
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
# ssh-ed25519 AAAAA.... add my key here to enable ssh from another computer
|
# ssh-ed25519 AAAAA.... add my key here to enable ssh from another computer
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{ pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.hyprland = {
|
programs.hyprland = {
|
||||||
@@ -6,16 +11,25 @@
|
|||||||
xwayland.enable = true;
|
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.
|
# Boot straight into Hyprland from the first virtual console on any machine.
|
||||||
# No display manager required; tty2-6 remain available as plain shells.
|
# 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 = ''
|
environment.loginShellInit = ''
|
||||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
exec ${pkgs.hyprland}/bin/Hyprland
|
exec start-hyprland
|
||||||
fi
|
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.
|
# Machine-agnostic Wayland session variables.
|
||||||
# GPU/vendor specific variables live with their hardware module (e.g. modules/hardware/nvidia.nix).
|
# GPU/vendor specific variables live with their hardware module (e.g. modules/hardware/nvidia.nix).
|
||||||
environment.sessionVariables = {
|
environment.sessionVariables = {
|
||||||
@@ -31,11 +45,14 @@
|
|||||||
# Fonts used across the desktop shell (Silicon Volt theme):
|
# Fonts used across the desktop shell (Silicon Volt theme):
|
||||||
# JetBrains Mono for terminal/UI mono, IBM Plex Sans for UI sans,
|
# JetBrains Mono for terminal/UI mono, IBM Plex Sans for UI sans,
|
||||||
# Instrument Serif for display italics, Nanum Gothic Coding as mono fallback.
|
# 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.jetbrains-mono
|
||||||
nerd-fonts.fira-code
|
nerd-fonts.fira-code
|
||||||
font-awesome
|
font-awesome
|
||||||
ibm-plex
|
ibm-plex
|
||||||
nanum-gothic-coding
|
nanum-gothic-coding
|
||||||
] ++ lib.optional (lib.hasAttr "instrument-serif" pkgs) pkgs.instrument-serif;
|
]
|
||||||
|
++ lib.optional (lib.hasAttr "instrument-serif" pkgs) pkgs.instrument-serif;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
hardware.graphics = {
|
|
||||||
enable = true;
|
|
||||||
enable32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
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 = [
|
boot.kernelParams = [
|
||||||
"nvidia-drm.modeset=1"
|
"nvidia-drm.modeset=1"
|
||||||
"nvidia-drm.fbdev=1"
|
"nvidia-drm.fbdev=1"
|
||||||
|
|||||||
20
modules/options.nix
Normal file
20
modules/options.nix
Normal 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)";
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user