Compare commits
10 Commits
9cc2ba3dae
...
multi-host
| Author | SHA1 | Date | |
|---|---|---|---|
| 231027cd5b | |||
| 19e2f737bc | |||
| 6440a4dc70 | |||
| c53829cbb3 | |||
| c9424ffd09 | |||
| a569683ea0 | |||
| 9a3f7807e1 | |||
| 1d7c4cebeb | |||
| ee386e1ad4 | |||
| bc828f7adf |
48
CLAUDE.md
Normal file
48
CLAUDE.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# NixOS Dotfiles
|
||||
|
||||
## Directory Layout
|
||||
|
||||
```
|
||||
flake.nix # entry point, defines hosts
|
||||
hosts/
|
||||
hivebrain/ # marvin's main machine
|
||||
nikita-nixos/ # nikita's machine
|
||||
home/
|
||||
packages-base.nix # universal packages every host gets (neovim, ripgrep, etc.)
|
||||
programs/ # installable programs (common.nix for simple packages, per-file for configured programs)
|
||||
rofi.nix # rofi config + packages
|
||||
symlinks.nix # home-manager symlinks
|
||||
tmux.nix # tmux config
|
||||
yazi.nix # yazi config
|
||||
zsh.nix # zsh config
|
||||
system/ # NixOS system-level modules
|
||||
```
|
||||
|
||||
## Adding a New Program
|
||||
|
||||
**For simple packages (no config):** Add the package to `home/programs/common.nix`'s `home.packages` list.
|
||||
|
||||
**For programs that need configuration** (session variables, extra options, dependencies): Create `home/programs/<name>.nix`:
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# configuration + packages
|
||||
}
|
||||
```
|
||||
|
||||
Then add the import to `hosts/<host>/home.nix`:
|
||||
|
||||
```nix
|
||||
../../home/programs/<name>.nix
|
||||
```
|
||||
|
||||
Example: `rustup.nix` needs config (session variables) so it gets its own file. Simple packages like `lazygit` go in `common.nix`.
|
||||
|
||||
## Rules
|
||||
|
||||
- `home/packages-base.nix` — shared baseline, imported by every host. Only add truly universal tools here (shell utilities, editors).
|
||||
- `home/programs/common.nix` — simple packages that just need to be installed (no extra config).
|
||||
- `home/programs/<name>.nix` — programs that need real configuration beyond just `home.packages`. Hosts opt in by importing.
|
||||
- `home/<tool>.nix` (tmux, zsh, rofi, etc.) — for programs that need configuration beyond just installing a package. Same opt-in pattern via host imports.
|
||||
- `system/` modules are NixOS system-level config (not home-manager). Add them to `hosts/<host>/default.nix`.
|
||||
@@ -1,2 +0,0 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
@@ -1,2 +0,0 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
@@ -2,12 +2,5 @@ return {
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
from libqtile import bar, extension, hook, layout, qtile, widget
|
||||
from libqtile.config import Click, Drag, Group, Key, KeyChord, Match, Screen
|
||||
from libqtile import bar, hook, layout, qtile, widget
|
||||
from libqtile.config import Click, Drag, Group, Key, Match, Screen
|
||||
from libqtile.lazy import lazy
|
||||
from libqtile.utils import guess_terminal
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
mod = "mod4"
|
||||
terminal = guess_terminal()
|
||||
|
||||
myTerm = "alacritty"
|
||||
terminal = "alacritty"
|
||||
|
||||
keys = [
|
||||
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
|
||||
@@ -60,6 +57,9 @@ keys = [
|
||||
lazy.spawn('sh -c "maim -s | xclip -selection clipboard -t image/png -i"'),
|
||||
desc="Screenshot"
|
||||
),
|
||||
Key([mod], "F6", lazy.spawn("wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+"), desc="Volume up 5%"),
|
||||
Key([mod], "F5", lazy.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), desc="Volume down 5%"),
|
||||
Key([mod], "F4", lazy.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), desc="Mute toggle"),
|
||||
]
|
||||
|
||||
# Add key bindings to switch VTs in Wayland.
|
||||
@@ -218,18 +218,18 @@ def make_top_bar(primary=False):
|
||||
widget.CPU(
|
||||
foreground = colors[4],
|
||||
padding = 8,
|
||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')},
|
||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(terminal + ' -e btop')},
|
||||
format="CPU: {load_percent}%",
|
||||
),
|
||||
make_sep(),
|
||||
widget.Memory(
|
||||
foreground = colors[8],
|
||||
padding = 8,
|
||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')},
|
||||
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(terminal + ' -e btop')},
|
||||
format = 'Mem: {MemUsed:.0f}{mm}',
|
||||
),
|
||||
make_sep(),
|
||||
widget.Volume(
|
||||
widget.PulseVolume(
|
||||
foreground = colors[7],
|
||||
padding = 8,
|
||||
fmt = 'Vol: {}',
|
||||
@@ -249,8 +249,8 @@ def make_top_bar(primary=False):
|
||||
|
||||
|
||||
screens = [
|
||||
Screen(top = make_top_bar()),
|
||||
Screen(top = make_top_bar(primary=True)),
|
||||
Screen(top = make_top_bar()),
|
||||
]
|
||||
|
||||
# Drag floating layouts.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = [ pkgs.blender ];
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
neovim
|
||||
nerd-fonts.jetbrains-mono
|
||||
ripgrep
|
||||
tea
|
||||
unzip
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
alacritty
|
||||
audacity
|
||||
blender
|
||||
blockbench
|
||||
claude-code
|
||||
fd
|
||||
filezilla
|
||||
fzf
|
||||
gcc
|
||||
godot_4
|
||||
imv
|
||||
jdk21
|
||||
jetbrains-toolbox
|
||||
lazygit
|
||||
lua-language-server
|
||||
mpv
|
||||
nil
|
||||
nixpkgs-fmt
|
||||
nodejs
|
||||
obsidian
|
||||
pkg-config
|
||||
rustup
|
||||
steam
|
||||
prismlauncher
|
||||
vesktop
|
||||
xclip
|
||||
xwallpaper
|
||||
yt-dlp
|
||||
];
|
||||
}
|
||||
39
home/programs/rustup.nix
Normal file
39
home/programs/rustup.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
rustup
|
||||
sqlx-cli
|
||||
openssl.dev
|
||||
|
||||
# Bevy / Wayland runtime deps
|
||||
wayland
|
||||
wayland-protocols
|
||||
libxkbcommon
|
||||
libGL
|
||||
vulkan-loader
|
||||
alsa-lib
|
||||
udev
|
||||
libx11
|
||||
libxcursor
|
||||
libxi
|
||||
libxrandr
|
||||
libxcb
|
||||
];
|
||||
|
||||
home.sessionVariables.PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
|
||||
# ponytail: global LD_LIBRARY_PATH so `cargo run` finds these without a shell.nix
|
||||
home.sessionVariables.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [
|
||||
wayland
|
||||
libxkbcommon
|
||||
libGL
|
||||
vulkan-loader
|
||||
alsa-lib
|
||||
udev
|
||||
libx11
|
||||
libxcursor
|
||||
libxi
|
||||
libxrandr
|
||||
libxcb
|
||||
]);
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
"drun"
|
||||
"run"
|
||||
"window"
|
||||
"ssh"
|
||||
];
|
||||
extraConfig = {
|
||||
show-icons = true;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -selection clipboard -i'
|
||||
|
||||
# Default layout on new session: main + right pane (~20%) + bottom pane (~15%)
|
||||
set-hook -g session-created 'split-window -h -l 20% -c "#{pane_current_path}" ; select-pane -t 0 ; split-window -v -l 15% -c "#{pane_current_path}" ; select-pane -t 0'
|
||||
set-hook -g session-created 'split-window -v -l 15% -c "#{pane_current_path}" ; select-pane -t 1 ; split-window -h -l 20% -c "#{pane_current_path}" ; select-pane -t 1'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
../../system/locale.nix
|
||||
../../system/fonts.nix
|
||||
../../system/nix.nix
|
||||
../../system/ssh.nix
|
||||
../../system/programs.nix
|
||||
../../system/packages.nix
|
||||
|
||||
@@ -19,8 +18,14 @@
|
||||
../../system/picom.nix
|
||||
../../system/display-managers/ly.nix
|
||||
../../system/users/marvin.nix
|
||||
../../system/clam.nix
|
||||
];
|
||||
|
||||
networking.hostName = "hivebrain";
|
||||
system.stateVersion = "26.05";
|
||||
|
||||
services.openssh.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
programs.steam.enable = true;
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
{
|
||||
imports = [
|
||||
../../home/zsh.nix
|
||||
../../home/fonts.nix
|
||||
../../home/rofi.nix
|
||||
../../home/yazi.nix
|
||||
../../home/symlinks.nix
|
||||
../../home/packages-base.nix
|
||||
../../home/packages-marvin.nix
|
||||
../../home/tmux.nix
|
||||
../../home/blender.nix
|
||||
../../home/packages-base.nix
|
||||
../../home/programs/common.nix
|
||||
../../home/programs/rustup.nix
|
||||
];
|
||||
|
||||
home.username = "marvin";
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
../../system/packages.nix
|
||||
|
||||
# nikita-only
|
||||
../../system/plasma.nix
|
||||
../../system/display-managers/sddm.nix
|
||||
../../system/users/nikita.nix
|
||||
];
|
||||
|
||||
networking.hostName = "nikita-nixos";
|
||||
system.stateVersion = "26.05";
|
||||
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
}
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
{
|
||||
imports = [
|
||||
../../home/zsh.nix
|
||||
../../home/fonts.nix
|
||||
../../home/yazi.nix
|
||||
../../home/symlinks.nix
|
||||
../../home/packages-base.nix
|
||||
../../home/blender.nix
|
||||
../../home/programs/common.nix
|
||||
];
|
||||
|
||||
home.username = "nikita";
|
||||
|
||||
13
system/clam.nix
Normal file
13
system/clam.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.clamav
|
||||
pkgs.clamtk
|
||||
];
|
||||
|
||||
services = {
|
||||
clamav.daemon.enable = true;
|
||||
clamav.updater.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.displayManager.sddm.enable = true;
|
||||
}
|
||||
@@ -2,4 +2,8 @@
|
||||
|
||||
{
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Steam LAN game transfer + Remote Play
|
||||
networking.firewall.allowedTCPPorts = [ 27036 27037 27040 ];
|
||||
networking.firewall.allowedUDPPorts = [ 27031 27036 ];
|
||||
}
|
||||
|
||||
@@ -3,4 +3,11 @@
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.firefox.enable = true;
|
||||
programs.zsh.enable = true;
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
environment.systemPackages = [ pkgs.ungoogled-chromium ];
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
{
|
||||
users.users.marvin = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = [ "wheel" "docker" ];
|
||||
shell = pkgs.zsh;
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
'';
|
||||
xrandrHeads = [
|
||||
{
|
||||
output = "HDMI-1";
|
||||
output = "DP-3";
|
||||
primary = true;
|
||||
monitorConfig = ''
|
||||
Option "Position" "0 0"
|
||||
'';
|
||||
}
|
||||
{
|
||||
output = "DP-1";
|
||||
primary = true;
|
||||
output = "HDMI-1";
|
||||
monitorConfig = ''
|
||||
Option "Position" "1920 0"
|
||||
Option "Position" "3440 0"
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user