Skip to content

MathieuDR/nix

Repository files navigation

YSomic's NixOS Configuration

This repository contains a NixOS system configuration using the Flakes feature. It manages both system-level (NixOS) and user-level (Home Manager) configurations.

📁 Structure

.
├── configuration/       # Shared configurations between NixOS and Home Manager
│   ├── nixos/          # NixOS-specific configurations
│   └── home-manager/   # Home Manager-specific configurations
├── hosts/              # Host-specific NixOS configurations
│   ├── anchor/         # Configuration for 'anchor' machine
│   └── wanderer/       # Configuration for 'wanderer' machine (WIP)
├── home-manager/       # Host-specific Home Manager configurations
│   └── anchor/        # Configuration for the user on 'anchor'
├── modules/           # Custom NixOS and Home Manager modules
│   ├── nixos/        # NixOS-specific modules
│   ├── home-manager/ # Home Manager-specific modules
│   └── shared/       # Shared module definitions
├── pkgs/             # Custom package definitions
└── lib/              # Helper functions and documentation
    └── repl.md       # Guide for using the Nix REPL with this configuration

🚀 Features

  • Hyprland Wayland compositor setup with:
    • Waybar configuration
    • Custom lock screen (Hyprlock)
    • Automatic multi-monitor setup
  • Theme Integration with Catppuccin
  • Development Environment with:
    • NVIM & VSCode
    • Git configuration
    • Custom terminal setup (Kitty)
  • Gaming Support with Steam and Prismlauncher
  • Power management
  • Custom Scripts for:
    • Power management
    • Window management
    • Git operations
    • Screenshot capabilities
    • Listing all files, useful for AI

📝 Planned Improvements

See TODOs.md for a list of planned improvements and additions to this configuration, including:

  • Automatic garbage collection
  • Backup configuration
  • System maintenance
  • Security enhancements
  • And more...

These improvements are tracked and documented to maintain system health and add useful features over time.

🛠 Usage

Prerequisites

  1. NixOS installation with Flakes enabled
  2. Git

Development

For development and debugging, you can use the provided REPL setup:

  • Check out the REPL Guide for detailed usage instructions
  • Use the just -l command for common operations:
    just         # Show available commands
    just rebuild # Rebuild NixOS configuration
    just hm      # Rebuild Home Manager configuration

⚙️ Configuration

Adding a New Host

  1. Create a new directory under hosts/
  2. Copy and modify the hardware configuration
  3. Create host-specific configurations

Modifying Home Manager

User-specific configurations are managed in:

  • home-manager/anchor/ for the anchor machine
  • configuration/home-manager/ for shared configurations

Custom Modules

Create new modules in modules/ following the existing structure:

  • modules/nixos/ for NixOS modules
  • modules/home-manager/ for Home Manager modules
  • modules/shared/ for shared module definitions

🤝 Credits

This configuration is inspired by and borrows from:

🔍 Useful Resources

Bootstrapping

Work in progress

  • Create system agenix ssh key called /etc/HOSTNAME/agenix_HOSTNAME_system
    • Copy public key in data/secrets/secrets.nix
  • Create user ssh key called ~/.config/agenix/agenix_key
    • Since we don't have the user yet, we might need to move it around after first activation
    • Add it to public keys here
  • Rekey all secrets so that the keys can read em
  • Get keepass bootstrap for Google PW + download keepass
  • Be able to use rsa_id

WANDERER

  • Installed using gnome installer
  • Copied /etc/nixos/* configuration
  • Imported in configuration
  • Activate using flake
    • sudo nixos-rebuild switch --flake github:MathieuDR/nix#HOST --refresh
    • sudo home-manager switch --flake github:MathieuDR/nix#USER@HOST --refresh
  • Create system keys with just generate-keys
    • Use the CP argument to copy the public keys, ready to be added to the config
  • Syncthing
    • Gather device id syncthing generate
    • add it to configuration/home-manager/syncthing.nix
  • Firefox
    • Install firefox colour theme
    • User styles, sync from cloud
    • STG, import latest backup under ~/.config/<HOST>/firefox/STG.backup

About

All things nix

Resources

Stars

Watchers

Forks

Packages

No packages published