Split configuration.nix and home.nix into per-domain modules

Break the two monolithic files into focused modules under system/
and home/ so each concern (boot, networking, xserver, picom, zsh,
git, rofi, etc.) lives in its own file. Clean up duplicates: drop
rofi from home.packages since programs.rofi.enable already installs
it, and move user-only apps (alacritty, obsidian, claude-code) from
environment.systemPackages to home.packages. Remove commented-out
boilerplate carried over from the install template.
This commit is contained in:
2026-06-28 21:02:48 +02:00
parent 7acb45c3a9
commit df0df6048a
21 changed files with 231 additions and 188 deletions

View File

@@ -1,121 +1,21 @@
{ config, lib, pkgs, ... }:
{ ... }:
{
imports =
[ # Include the results of the hardware scan.
imports = [
./hardware-configuration.nix
./system/boot.nix
./system/networking.nix
./system/locale.nix
./system/xserver.nix
./system/picom.nix
./system/display-manager.nix
./system/fonts.nix
./system/users.nix
./system/programs.nix
./system/packages.nix
./system/ssh.nix
./system/nix.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "hivebrain"; # Define your hostname.
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "de";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
# services.xserver.enable = true;
services.xserver = {
enable = true;
autoRepeatDelay = 200;
autoRepeatInterval = 35;
windowManager.qtile.enable = true;
displayManager.sessionCommands = ''
xwallpaper --zoom ~/nixos-dotfiles/Pictures/NixOsWallpaper.png
'';
xrandrHeads = [
{
output = "HDMI-1";
monitorConfig = ''
Option "Position" "0 0"
'';
}
{
output = "DP-1";
primary = true;
monitorConfig = ''
Option "Position" "1920 0"
'';
}
];
};
services.displayManager.ly.enable = true;
services.picom = {
enable = true;
backend = "xrender";
fade = true;
};
fonts.packages = with pkgs; [
jetbrains-mono
];
# Enable sound.
# services.pulseaudio.enable = true;
# OR
# services.pipewire = {
# enable = true;
# pulse.enable = true;
# };
nixpkgs.config.allowUnfree = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.marvin = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
shell = pkgs.zsh;
packages = with pkgs; [
tree
];
};
programs.firefox.enable = true;
programs.zsh.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [
vim
wget
alacritty
btop
obsidian
claude-code
jq # used by the Claude vault bootstrap.sh to parse settings.json
];
nix.settings.experimental-features = ["nix-command" "flakes"];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
system.stateVersion = "26.05";
}

View File

@@ -1,76 +1,17 @@
{ config, pkgs, lib, ... }:
{ ... }:
{
imports = [
./home/zsh.nix
./home/git.nix
./home/rofi.nix
./home/yazi.nix
./home/packages.nix
./home/symlinks.nix
./home/fonts.nix
];
home.username = "marvin";
home.homeDirectory = "/home/marvin";
home.stateVersion = "26.05";
programs = {
yazi.enable = true;
git = {
enable = true;
settings.user = {
name = "MDietermann";
email = "marvin.dietermann@hive-brain.de";
};
};
rofi = {
enable = true;
theme = "arthur";
font = "sans-serif";
package = pkgs.rofi;
modes = [
"drun"
"run"
"window"
"ssh"
];
extraConfig = {
show-icons = true;
};
};
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 10000;
history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history";
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
theme = "aussiegeek";
};
shellAliases = {
btw = "echo I use NixOS";
reload-nixos = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles#hivebrain";
};
};
};
home.file = lib.mapAttrs'
(name: _: lib.nameValuePair ".config/${name}" {
source = config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/nixos-dotfiles/config/${name}";
})
(lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./config));
home.packages = with pkgs; [
neovim
ripgrep
nil
nixpkgs-fmt
nodejs
gcc
rofi
xwallpaper
steam
unzip
];
}

5
home/fonts.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }:
{
fonts.fontconfig.enable = true;
}

11
home/git.nix Normal file
View File

@@ -0,0 +1,11 @@
{ ... }:
{
programs.git = {
enable = true;
settings.user = {
name = "MDietermann";
email = "marvin.dietermann@hive-brain.de";
};
};
}

21
home/packages.nix Normal file
View File

@@ -0,0 +1,21 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
alacritty
claude-code
gcc
lua-language-server
neovim
nerd-fonts.jetbrains-mono
nil
nixpkgs-fmt
nodejs
obsidian
ripgrep
rustup
steam
unzip
xwallpaper
];
}

19
home/rofi.nix Normal file
View File

@@ -0,0 +1,19 @@
{ pkgs, ... }:
{
programs.rofi = {
enable = true;
theme = "arthur";
font = "sans-serif";
package = pkgs.rofi;
modes = [
"drun"
"run"
"window"
"ssh"
];
extraConfig = {
show-icons = true;
};
};
}

10
home/symlinks.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, lib, ... }:
{
home.file = lib.mapAttrs'
(name: _: lib.nameValuePair ".config/${name}" {
source = config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/nixos-dotfiles/config/${name}";
})
(lib.filterAttrs (_: type: type == "directory") (builtins.readDir ../config));
}

5
home/yazi.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }:
{
programs.yazi.enable = true;
}

25
home/zsh.nix Normal file
View File

@@ -0,0 +1,25 @@
{ ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 10000;
history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history";
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
theme = "aussiegeek";
};
shellAliases = {
btw = "echo I use NixOS";
reload-nixos = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles#hivebrain";
};
};
}

6
system/boot.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

View File

@@ -0,0 +1,5 @@
{ ... }:
{
services.displayManager.ly.enable = true;
}

7
system/fonts.nix Normal file
View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
fonts.packages = with pkgs; [
jetbrains-mono
];
}

5
system/locale.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }:
{
time.timeZone = "Europe/Berlin";
}

6
system/networking.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
networking.hostName = "hivebrain";
networking.networkmanager.enable = true;
}

6
system/nix.nix Normal file
View File

@@ -0,0 +1,6 @@
{ ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config.allowUnfree = true;
}

10
system/packages.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vim
wget
btop
jq
];
}

9
system/picom.nix Normal file
View File

@@ -0,0 +1,9 @@
{ ... }:
{
services.picom = {
enable = true;
backend = "xrender";
fade = true;
};
}

7
system/programs.nix Normal file
View File

@@ -0,0 +1,7 @@
{ ... }:
{
programs.firefox.enable = true;
programs.zsh.enable = true;
programs.nix-ld.enable = true;
}

5
system/ssh.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }:
{
services.openssh.enable = true;
}

12
system/users.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
users.users.marvin = {
isNormalUser = true;
extraGroups = [ "wheel" ];
shell = pkgs.zsh;
packages = with pkgs; [
tree
];
};
}

28
system/xserver.nix Normal file
View File

@@ -0,0 +1,28 @@
{ ... }:
{
services.xserver = {
enable = true;
autoRepeatDelay = 200;
autoRepeatInterval = 35;
windowManager.qtile.enable = true;
displayManager.sessionCommands = ''
xwallpaper --zoom ~/nixos-dotfiles/Pictures/NixOsWallpaper.png
'';
xrandrHeads = [
{
output = "HDMI-1";
monitorConfig = ''
Option "Position" "0 0"
'';
}
{
output = "DP-1";
primary = true;
monitorConfig = ''
Option "Position" "1920 0"
'';
}
];
};
}