Commit graph

77 commits

Author SHA1 Message Date
Geir Okkenhaug Jerstad
fc26b3f7f2 Fix lib import in hardware-co.nix 2025-06-12 21:18:20 +02:00
Geir Okkenhaug Jerstad
253b05b45e Renamed hardware and disk configuration files for congenital-optimist 2025-06-12 21:17:44 +02:00
Geir Okkenhaug Jerstad
1a4e7fd3f6 made script for steam on xwayland satelite 2025-06-12 17:37:12 +02:00
Geir Okkenhaug Jerstad
fc1482494f steam xwayland 2025-06-12 15:20:48 +02:00
Geir Okkenhaug Jerstad
1b915a7610 feat: implement NFS with NFSv4 ID mapping across home lab
- Add NFSv4 ID mapping configuration using services.nfs.idmapd.settings
- Configure consistent domain 'home.lab' for ID mapping across all machines
- Update sleeper-service NFS server with proper security (root_squash, all_squash)
- Create reusable NFS client module (modules/services/nfs-client.nix)
- Deploy NFS client configuration to grey-area and congenital-optimist
- Maintain consistent media group GID (993) across all machines
- Support both local (10.0.0.0/24) and Tailscale (100.64.0.0/10) networks
- Test and verify NFS connectivity and ID mapping functionality

Resolves permission management issues and enables secure file sharing
across the home lab infrastructure.
2025-06-11 10:45:08 +02:00
Geir Okkenhaug Jerstad
edcf3220a0 testing idmap for nfs 2025-06-11 10:33:07 +02:00
Geir Okkenhaug Jerstad
c3d1333538 Fix NFS configuration: Remove ZFS mount point conflict with tmpfiles
- Remove /mnt/storage/media from systemd.tmpfiles.rules (it's a ZFS dataset mount point)
- Add ExecStartPost to set proper permissions on ZFS-mounted media directory
- Update NFS research documentation with ZFS integration best practices
- Add section explaining ZFS mount point vs tmpfiles.rules conflicts

This resolves the potential conflict where tmpfiles tries to create a directory
that ZFS wants to use as a mount point for the storage/media dataset.
2025-06-11 10:12:51 +02:00
Geir Okkenhaug Jerstad
3f93a85469 testing fix for nfs shares 2025-06-11 09:51:36 +02:00
Geir Okkenhaug Jerstad
e440585a8c typo 2025-06-11 09:36:29 +02:00
Geir Okkenhaug Jerstad
967ba38411 Implement media group for NFS permission management
- Create shared media-group.nix module with fixed GID (993)
- Add both geir and sma users to media group for shared NFS access
- Update NFS server configuration to use root:media ownership with 0775 permissions
- Convert all media services to use media group instead of users group:
  - Jellyfin, Calibre-web, Audiobookshelf, Transmission
- Enable group write access to all NFS shares (/mnt/storage/*)
- Maintain security with root ownership while allowing group collaboration

This resolves NFS permission issues by providing consistent group-based access
control across all media services and storage directories.
2025-06-11 09:33:24 +02:00
Geir Okkenhaug Jerstad
2276dd59cd added starship to sma user 2025-06-11 09:21:19 +02:00
Geir Okkenhaug Jerstad
2a25c42063 fixed ssh forwarding to git.geokkjer.eu 2025-06-10 23:03:23 +02:00
Geir Okkenhaug Jerstad
f6eb588ccd Update instruction file with corrected Git SSH configuration
- Change port from 1337 to 2222
- Update user from forgejo to git for SSH compatibility
- Fix URL and remote configuration examples
2025-06-10 22:43:49 +02:00
Geir Okkenhaug Jerstad
1f222f2997 Change Git SSH port from 1337 to 2222
- Port 1337 appears to be blocked by VPS provider
- Port 2222 is more commonly allowed for SSH services
- Update both reverse-proxy and Forgejo configurations
- This should resolve the SSH timeout issues
2025-06-10 22:42:13 +02:00
Geir Okkenhaug Jerstad
f2c9eed794 Fix Forgejo SSH user configuration
- Set explicit git user for Forgejo service
- Add SSH_USER configuration for proper SSH handling
- Ensure compatibility with system SSH server
2025-06-10 22:40:01 +02:00
Geir Okkenhaug Jerstad
1fd6de2551 remember to import the fonts also 2025-06-10 21:59:00 +02:00
Geir Okkenhaug Jerstad
aea88565bd moar fonts 2025-06-10 21:51:41 +02:00
Geir Okkenhaug Jerstad
8029d93a84 added niri 2025-06-10 20:33:54 +02:00
Geir Okkenhaug Jerstad
cdbce471ba updated README 2025-06-10 11:08:43 +02:00
Geir Okkenhaug Jerstad
8884c42cf2 Consolidate CLI tools and fix git aliases
- Consolidated 25+ common CLI tools into modules/common/base.nix
- Added modern rust-based tools (eza, bat, ripgrep, etc.) system-wide
- Removed duplicated packages from user and machine configs
- Added consistent shell aliases for modern CLI tools
- Fixed gpa alias to properly push to all remotes
- Removed duplicate git-push-all alias from geir.nix
- Added comprehensive documentation in CLI_TOOLS_CONSOLIDATION.md

Benefits:
- Single source of truth for common CLI tools
- Reduced duplication across 7+ configuration files
- Improved git workflow with flexible multi-remote pushing
- Better maintainability and consistency
2025-06-08 09:28:10 +00:00
Geir Okkenhaug Jerstad
73c3ac9386 fixed typo 2025-06-08 08:31:16 +00:00
Geir Okkenhaug Jerstad
cd43292cfd feat: add NixOS logo to README and assets
- Add nixos_logo.svg to assets/ directory with optimized viewBox
- Integrate logo into README header with centered layout
- Add inline logos in Technology Stack and Configuration Philosophy sections
- Include footer logo for consistent branding
- Enhance visual identity and professional presentation

The logo uses SVG format for crisp display at all resolutions and
includes gradient styling consistent with NixOS branding.
2025-06-08 08:29:39 +00:00
Geir Okkenhaug Jerstad
b781252847 Add congenital-optimist support to lab tool
- Add congenital-optimist as local deployment target
- Use direct nixos-rebuild for local deployment (no SSH)
- Update all machine arrays and help text to include 4th machine
- Optimize deployment handling for local vs remote machines
2025-06-07 18:06:25 +00:00
Geir Okkenhaug Jerstad
7ac9c0fc98 fix(tools): remove duplicate update-all command from lab tool
Clean up redundant command case that was accidentally left in during
the addition of the update command functionality.
2025-06-07 17:50:51 +00:00
Geir Okkenhaug Jerstad
1b97799701 feat(tools): add update command to lab tool
- Add update_all_machines function to deploy to all remote machines
- Support all deployment modes: boot, test, switch
- Provide detailed progress feedback and error reporting
- Update help text with new command and examples

Usage: lab update [mode]
Example: lab update switch  # Update all machines immediately
2025-06-07 17:49:47 +00:00
Geir Okkenhaug Jerstad
7a43630bc6 feat: infrastructure updates and documentation improvements
- Update Forgejo service configuration on grey-area
- Refine reverse-proxy network configuration
- Add README_new.md with enhanced documentation structure
- Update instruction.md with latest workflow guidelines
- Enhance plan.md with additional deployment considerations
- Complete PR template restructuring for professional tone

These changes improve service reliability and documentation clarity
while maintaining infrastructure consistency across all machines.
2025-06-07 17:45:47 +00:00
Geir Okkenhaug Jerstad
fed1c5a1f8 docs: update templates and documentation to professional tone
- Add git commit message template with comprehensive guidelines
- Update PR template to remove emojis and casual language
- Rewrite README.md with professional, technical approach
- Update BRANCHING_STRATEGY.md to match new tone
- Backup original README as README_old.md

Templates now align with infrastructure documentation standards
and provide clear guidance for contributions.
2025-06-07 17:39:39 +00:00
Geir Okkenhaug Jerstad
7aafd4cdd8 docs: Add Forgejo Git configuration instructions
- Correct SSH URL format: forgejo@git.geokkjer.eu:1337
- Document SSH port forwarding setup (1337 -> grey-area:22)
- Add remote configuration examples
- Clarify primary vs backup repository roles
2025-06-07 16:46:09 +00:00
Geir Okkenhaug Jerstad
c8bee48ee3 Update plan.md: GNU Stow + literate Emacs approach, deploy-rs migration planning
- Phase 4: Restructured to use GNU Stow for regular dotfiles + literate programming for Emacs only
- Added comprehensive package structure for Stow deployment
- Elevated deploy-rs migration to high priority with detailed configuration examples
- Updated status to reflect 4/4 machines fully operational with complete service stack
- Added recent critical issue resolution documentation
- Updated next phase priorities to reflect new dotfiles approach
2025-06-07 16:44:11 +00:00
Geir Okkenhaug Jerstad
4a57978f45 fixed nfs 2025-06-07 16:33:34 +00:00
Geir Okkenhaug Jerstad
9bfddf14ce treying to get nfs to work 2025-06-07 15:29:28 +00:00
Geir Okkenhaug Jerstad
2d3728f28b feat: create shared extraHosts module with Tailscale IPs
- Create modules/network/extraHosts.nix with Tailscale IP mappings
- Replace hardcoded networking.extraHosts in all machine configs
- Add extraHosts module import to all machines
- Enable Tailscale service by default in the module
- Use Tailscale mesh network IPs for reliable connectivity
2025-06-07 15:07:17 +00:00
Geir Okkenhaug Jerstad
fa2b84cf65 fix: resolve sma user definition conflict between modules
- Remove duplicate sma user definition from incus.nix module
- The sma user is properly defined in modules/users/sma.nix with incus-admin group
- This resolves the isNormalUser/isSystemUser assertion failure blocking congenital-optimist rebuild
- Clean up grey-area configuration and modularize services
- Update SSH keys with correct IP addresses for grey-area and reverse-proxy
2025-06-07 16:58:22 +02:00
Geir Okkenhaug Jerstad
a35d9ff420 Implement SSH forwarding for Forgejo Git access
- Add nginx stream configuration on reverse-proxy to forward port 2222 to apps:22
- Update firewall rules to allow port 2222 for Git SSH access
- Configure Forgejo to use SSH_PORT = 2222 for Git operations
- Add comprehensive SSH forwarding research documentation
- Enable Git operations via git@git.geokkjer.eu:2222

Phase 1 implementation using nginx stream module complete.
Ready for testing and potential Phase 2 migration to HAProxy.
2025-06-07 15:21:11 +02:00
Geir Okkenhaug Jerstad
1e75db5f15 Update testing methodology: Add git staging before flake check
This ensures Nix can access all files during testing, preventing
path not found errors when testing configurations.
2025-06-07 12:11:49 +02:00
Geir Okkenhaug Jerstad
9837d82199 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
2025-06-07 12:11:20 +02:00
Geir Okkenhaug Jerstad
e976b14d19 refactor: Move network configurations to machine directories
- Move network-congenital-optimist.nix to machines/congenital-optimist/
- Move network-sleeper-service.nix to machines/sleeper-service/
- Update import paths in machine configurations
- Clean up modules/network/common.nix to remove SSH duplication
- Consolidate SSH configuration in modules/security/ssh-keys.nix
- Remove machine-specific networking from shared common module

This improves dependency tracking by co-locating machine-specific
network configurations with their respective machines.
2025-06-06 18:08:45 +02:00
Geir Okkenhaug Jerstad
fff47629f2 small update moved some files to logical place 2025-06-06 18:01:26 +02:00
Geir Okkenhaug Jerstad
e69fd5856f some small notes 2025-06-06 12:22:53 +02:00
Geir Okkenhaug Jerstad
29de5db430 feat: Document lab command deployment tool implementation
Some checks failed
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Has been cancelled
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Has been cancelled
- Add comprehensive documentation for home-lab-tools package
- Document lab command capabilities and usage examples
- Record technical implementation details and benefits
- Include deployment workflow and infrastructure integration
- Add to deployment status & accomplishments section
- Document conflict resolution and system integration process
2025-06-06 12:18:26 +02:00
Geir Okkenhaug Jerstad
7c650856f2 feat: Complete sleeper-service deployment with ZFS and network fixes
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions
 Major deployment milestone achieved:

**sleeper-service Configuration:**
- Successfully deployed flake-based NixOS on Intel Xeon file server
- Resolved ZFS mounting conflicts causing boot failures
- Implemented ZFS native mounting (/mnt/storage, /mnt/storage/media)
- Added Pi-hole DNS integration (10.0.0.14) for package resolution
- Configured systemd-networkd with static IP (10.0.0.8)
- System boots cleanly in ~1 minute with ZFS auto-mounting

**Infrastructure Updates:**
- SSH key management deployed and operational
- Network configuration with multi-tier DNS (Pi-hole, router, Google)
- NFS server configuration for network storage
- Data preservation verified: 903GB ZFS pool intact

**Technical Solutions:**
- Added nomodeset kernel parameter for graphics compatibility
- Disabled NVIDIA drivers for headless server operation
- Removed conflicting ZFS entries from hardware-configuration.nix
- Established remote deployment workflow via rsync + SSH

**Documentation:**
- Updated plan.md with deployment status and lessons learned
- Added deployment commands and troubleshooting notes
- Documented ZFS native mounting migration process

**Data Verified:**
- Films: 184GB, Series: 612GB, Audiobooks: 94GB, Music: 9.1GB, Books: 3.5GB
- Storage pool: 903GB used, 896GB available
- All media accessible via proper ZFS auto-mounting

This represents the first successful multi-machine flake deployment in the home lab infrastructure migration.
2025-06-06 11:21:12 +02:00
Geir Okkenhaug Jerstad
10a4f8df56 trying to get fileserver to use flake config
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions
2025-06-05 17:35:45 +02:00
Geir Okkenhaug Jerstad
c392df4a93 Add ZFS support to sleeper-service
- Replace ext4 with ZFS pool 'filepool' for enhanced data integrity
- Add ZFS auto-scrub and TRIM services for file server
- Configure proper ZFS datasets: root, nix, var, storage
- Add networking hostId (a1b2c3d4) required for ZFS
- Update NFS and Transmission to use ZFS mount points
- Change file ownership to 'sma' user for server configuration
- Add comprehensive ZFS setup documentation

Ready for deployment with proper file server storage backend.
2025-06-05 17:16:32 +02:00
Geir Okkenhaug Jerstad
715911cc62 fix: remove geir user from sleeper-service (server-only configuration)
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions
- Remove geir user module from sleeper-service configuration
- Servers should only use sma user to avoid pulling desktop packages
- Update instruction.md with user configuration strategy:
  - Desktop machines: geir user (includes desktop packages)
  - Server machines: sma user ONLY (minimal server config)
- This prevents servers from importing browsers and GUI applications

This change reduces server footprint and follows separation of concerns
between desktop workstations and headless servers.
2025-06-05 17:09:25 +02:00
Geir Okkenhaug Jerstad
88638827c3 fix: temporarily disable Transmission due to build issues
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions
- Disable Transmission service due to compilation errors in unstable
- Keep download directory creation for future re-enablement
- Remove Transmission firewall port (9091) from sleeper-service
- Focus on deploying NFS server functionality first

This allows sleeper-service deployment to proceed with NFS services
while Transmission package issues are resolved upstream.
2025-06-05 17:04:29 +02:00
Geir Okkenhaug Jerstad
de9c028072 Add reverse-proxy configuration with DMZ-specific security
Some checks are pending
🏠 Home Lab CI/CD Pipeline / 🔍 Validate Configuration (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🔨 Build Configurations (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔒 Security Audit (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📚 Documentation & Modules (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 🔄 Update Dependencies (push) Waiting to run
🏠 Home Lab CI/CD Pipeline / 🚀 Deploy Configuration (push) Blocked by required conditions
🏠 Home Lab CI/CD Pipeline / 📢 Notify Results (push) Blocked by required conditions
- Create reverse-proxy machine configuration for VPS edge server
- Configure SSH access only via Tailscale (100.96.189.104)
- Implement strict DMZ firewall rules (HTTP/HTTPS only externally)
- Add enhanced fail2ban settings for DMZ environment
- Include sma user with SSH key management
- Configure Nginx reverse proxy with Let's Encrypt SSL
- Add reverse-proxy to flake.nix nixosConfigurations

Security features:
- SSH only accessible through Tailscale interface
- Aggressive fail2ban settings (24h ban, 3 max retries)
- Firewall rejects all non-essential traffic
- No common network config to avoid security conflicts
2025-06-05 16:48:45 +02:00
Geir Okkenhaug Jerstad
304e868e09 Add reverse-proxy configuration with DMZ-specific security
- Create reverse-proxy machine configuration for VPS edge server
- Configure SSH access only via Tailscale (100.96.189.104)
- Implement strict DMZ firewall rules (HTTP/HTTPS only externally)
- Add enhanced fail2ban settings for DMZ environment
- Include sma user with SSH key management
- Configure Nginx reverse proxy with Let's Encrypt SSL
- Add reverse-proxy to flake.nix nixosConfigurations

Security features:
- SSH only accessible through Tailscale interface
- Aggressive fail2ban settings (24h ban, 3 max retries)
- Firewall rejects all non-essential traffic
- No common network config to avoid security conflicts
2025-06-05 16:47:52 +02:00
Geir Okkenhaug Jerstad
2530b918ca fix: resolve configuration conflicts
- Fixed networking defaultGateway interface specification for sleeper-service
- Resolved shell alias conflict between geir and sma users
- Changed sma aliases from 'lab' to 'homelab' to avoid conflict
2025-06-05 16:33:29 +02:00
Geir Okkenhaug Jerstad
6fe8cdb790 feat: add NFS server and Transmission service to sleeper-service
- Created modules/services/nfs.nix for network file sharing
- Updated sleeper-service configuration with NFS and Transmission
- Fixed SSH key management to use direct key configuration
- Updated hardware-configuration to use sleeper-service hostname
- Added firewall ports for Transmission RPC (9091)
2025-06-05 16:31:09 +02:00
Geir Okkenhaug Jerstad
77e6b9a501 feat: Implement two-key SSH management strategy
- Add modules/security/ssh-keys.nix for centralized SSH key management
- Generate role-specific SSH keys with geir@geokkjer.eu email:
  - Admin key (geir@geokkjer.eu-admin) for sma user server access
  - Development key (geir@geokkjer.eu-dev) for geir user and git services
- Update SSH client config with role-based host patterns
- Configure users/geir.nix and users/sma.nix with appropriate key access
- Add SSH key setup to both machine configurations
- Create scripts/setup-ssh-keys.sh for key generation automation
- Update plan.md with completed SSH security implementation

Security benefits:
- Principle of least privilege (separate admin vs dev access)
- Limited blast radius if keys are compromised
- Clear usage patterns: ssh admin-sleeper vs ssh geir@sleeper-service.home
- Maintains compatibility with existing services during transition
2025-06-05 16:25:33 +02:00