Refactor: Simplify module structure and reorganize services

- Removed system/ directory, merged applications into users/geir.nix
- Simplified fonts.nix to bare minimum (users can add more)
- Moved transmission.nix to sleeper-service/services/ (machine-specific)
- Organized grey-area services into services/ directory
- Updated import paths and tested all configurations
- Added research documentation for deploy-rs and GNU Stow
This commit is contained in:
Geir Okkenhaug Jerstad 2025-06-07 12:11:20 +02:00
parent e976b14d19
commit 9837d82199
24 changed files with 832 additions and 959 deletions

View file

@ -13,17 +13,8 @@
# Common desktop packages
environment.systemPackages = with pkgs; [
# Basic desktop tools
firefox
alacritty
nautilus
# Media and graphics
vlc
gimp
# Utilities
gnome-tweaks
dconf-editor
];
# Flatpak support
services.flatpak.enable = true;
}

22
modules/desktop/fonts.nix Normal file
View file

@ -0,0 +1,22 @@
{ config, pkgs, ... }: {
# Minimal font configuration - users can add more fonts as needed
fonts.packages = with pkgs; [
# Essential system fonts
noto-fonts
noto-fonts-emoji
liberation_ttf
# One good monospace font for terminals/coding
nerd-fonts.jetbrains-mono
];
# Console configuration
console = {
font = "Lat2-Terminus16";
keyMap = "no";
};
# Internationalization
i18n.defaultLocale = "en_US.UTF-8";
time.timeZone = "Europe/Oslo";
}

View file

@ -1,51 +0,0 @@
# Network Configuration Modules
This directory contains networking configurations for all machines in the Home Lab.
## Structure
- **`common.nix`** - Shared networking settings used by all machines
- nftables firewall enabled
- SSH access with secure defaults
- Tailscale VPN for remote access
- Basic firewall rules (SSH port 22)
- **`network-<machine-name>.nix`** - Machine-specific networking configurations
- Import `common.nix` for shared settings
- Override or extend with machine-specific requirements
- Define hostname, hostId, and additional firewall ports
## Current Machines
### network-congenital-optimist.nix
- AMD Threadripper workstation
- ZFS hostId configuration (8425e349)
- Ready for additional service ports as needed
### network-sleeper-service.nix
- Xeon file server
- Headless server configuration
- Ready for additional file sharing service ports
## Usage
Each machine configuration imports its specific network module:
```nix
# In machines/<machine-name>/configuration.nix
imports = [
../../modules/network/network-<machine-name>.nix
# ... other imports
];
```
## Adding New Machines
1. Create `network-<new-machine>.nix` in this directory
2. Import `./common.nix` for shared settings
3. Add machine-specific configuration (hostname, hostId, ports)
4. Import the new file in the machine's `configuration.nix`
## Future Refactoring
The `common.nix` file can be extended to include more shared networking patterns as they emerge across machines. Consider moving repeated patterns here to reduce duplication.

View file

@ -1,37 +0,0 @@
{ config, pkgs, ... }:
let
# Import custom packages from the flake
homeLabPackages = import ../../packages { inherit pkgs; };
in {
# System applications and utilities
environment.systemPackages = with pkgs; [
# Home lab management tools
homeLabPackages.lab
# Terminal applications
kitty
terminator
rio
greetd.tuigreet
# System monitoring
glances
inxi
htop
bottom
systemctl-tui
# File and data tools
wget
curl
mc
# Desktop integration
dbus
wayland
xdg-utils
];
# Flatpak support
services.flatpak.enable = true;
}

View file

@ -1,36 +0,0 @@
{ config, pkgs, ... }: {
# Font configuration
fonts.packages = with pkgs; [
# Base fonts
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
liberation_ttf
dina-font
proggyfonts
# GitHub fonts
mona-sans
hubot-sans
inter-nerdfont
# Nerd Fonts (updated syntax for NixOS 25.05)
nerd-fonts.meslo-lg
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.hack
nerd-fonts.iosevka
nerd-fonts.iosevka-term
];
# Console configuration
console = {
font = "Lat2-Terminus16";
keyMap = "no";
};
# Internationalization
i18n.defaultLocale = "en_US.UTF-8";
time.timeZone = "Europe/Oslo";
}

View file

@ -1,24 +0,0 @@
{ config, pkgs, ... }:
{
# Transmission temporarily disabled due to build issues
# Will re-enable once package is stable
services.transmission = {
enable = false;
user = "sma"; # Using admin user for server processes
group = "users";
settings.rpc-port = 9091;
settings.rpc-bind-address = "0.0.0.0";
downloadDirPermissions = "770";
settings = {
download-dir = "/mnt/storage/downloads";
rpc-whitelist = "127.0.0.1,10.0.0.*,100.*.*.*";
rpc-host-whitelist = "sleeper-service,localhost";
};
};
# Ensure downloads directory exists even without Transmission
systemd.tmpfiles.rules = [
"d /mnt/storage/downloads 0755 sma users -"
];
}

View file

@ -1,7 +1,10 @@
# Primary User Configuration - geir
# Main user account for development and desktop use
{ config, pkgs, ... }:
let
# Import custom packages from the flake
homeLabPackages = import ../../packages { inherit pkgs; };
in
{
users.users.geir = {
description = "Geir Okkenhaug Jerstad - Primary User";
@ -31,20 +34,33 @@
# User-specific packages
packages = with pkgs; [
# Browsers & Communication
chromium
vivaldi
vivaldi-ffmpeg-codecs
nyxt
firefox
vesktop
# Terminal & Shell Enhancement
# Home lab management tools
homeLabPackages.lab
# Terminal applications & system monitoring
kitty
terminator
starship
fastfetch
hyfetch
nerdfetch
zellij
glances
htop
bottom
systemctl-tui
# Essential system tools
wget
curl
mc
# Browsers & Communication
firefox
chromium
vesktop
# Shell Enhancement & Fun
nerdfetch
neo-cowsay
fortune
clolcat
@ -53,42 +69,41 @@
ncpamixer
pavucontrol
# Creative & Productivity
gimp
obs-studio
koodo-reader
# Productivity
libreoffice
koodo-reader
# Development & System Management
neovim
vscode
git-credential-manager
github-cli
nodejs
nodePackages.npm
virt-manager
gnome-tweaks
# Themes & Appearance
beauty-line-icon-theme
# Emacs Integration
emacsPackages.vterm
# Media & Entertainment
celluloid
# Creative Tools (optional - remove if not needed)
gimp
obs-studio
# File Management
nautilus
file-roller
# Text Editors (alternatives to Emacs)
neovim
vscode
# Development Tools
git-credential-manager
github-cli
nodejs
nodePackages.npm
# Containers & Cloud
# Containers
podman-compose
podman-desktop
# Media
celluloid
# Emacs Integration
emacsPackages.vterm
# Desktop integration (moved from system)
dbus
wayland
xdg-utils
];
};