Skip to content

goon/nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

486 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goon/nixos



NixOS License Stars Commits

Another blazingly mid nix configuration with an overengineered dendritic architecture built on flakes and home manager with automatic module discovery, sane defaults, powered by Hyprland (or Mango), and held together by hopes, dreams and vibes.

Important

This is a personal configuration, shared for reference and inspiration NOT adoption.

  • This configuration is constantly evolving. It is prone to drastic and likely breaking changes.
  • Features may be partially implemented or entirely broken.
  • The README and documentation will often times be outdated.
  • I provide no guarantees of stability or support.

If you intend to use any aspect of my configuration, make sure you:

  1. Review the code thoroughly.
  2. Understand what each module does.
  3. Adapt it to your specific use case.

Table of Contents

Screenshots

preview

Structure

  • flake.nix & flake.lock — Define the entry points and locks dependencies.
  • hosts/ — Contains host specific configuration.
  • modules/ — Contains nix and home manager modules.
  • scripts/ — Contains various bash scripts.
  • wallpapers/ — Collection of wallpapers for your viewing pleasure.

Modules

  • modules/commons — Universal Configurations
  • modules/core — Device & Hardware Configurations
  • modules/extra — Software Configurations
  • modules/lib — Helper Scripts
  • modules/session — Window Managers & Shell

Modules follow a concern / context first structure. For example, the git.nix file contains the installation of git, home manager configurations for it, git shell aliases and related applications like lazygit and delta.

Every .nix file under modules/ is automatically discovered and imported by modules/lib/recursive.nix, preventing the need for manual imports. The importer skips private files prefixed with _ or ., and the /lib/ directory itself. Most modules follow a on by default format. To disable a feature or module on a given host, module.<name>.enable = false; can be set.

Hosts are formed by combining the auto discovered modules with host specific overrides in host/default.nix. Where the host file serves as a dendritic dashboard for enabling hardware support, selecting a window manager and documenting which modules are explicitly enabled or disabled.

Formatting

The code quality and formatting is enforced via treefmt-nix, utilising three tools.

  • nixfmt — The standard Nix formatter, ensuring consistent whitespace, line breaks and attribute ordering.
  • deadnix — Scans for unused let bindings, unreferenced function arguments and dead with statements.
  • statix — Analyses expressions for anti-patterns e.g. unused args, unnecessary with statements and deprecated idioms.

The formatter module at modules/lib/formatter.nix is passed through treefmt-nix's evalModule, which outputs a combined wrapper binary. The wrapper runs all three tools in sequence.

Deployment

Note

  • The configuration expects the repository to live in $HOME/.nixos
  • If your username and / or repoPath need to be updated, they can be updated in modules/globals.nix.
  • The --recursive flag ensures the yaks quickshell submodule is pulled.

Deployment Script

  1. Clone

    nix-shell -p git
    git clone --recursive https://github.com/goon/nixos ~/.nixos
    cd ~/.nixos
    
  2. Run the Bootstrap Script

    ./scripts/bootstrap
    

Manual Deployment

  1. Clone:

    nix-shell -p git
    git clone --recursive https://github.com/goon/nixos ~/.nixos
    cd ~/.nixos
    
  2. Generate Hardware Configuration:

    nixos-generate-config --show-hardware-config > hosts/desktop/hardware-configuration.nix
  3. Rebuild:

    sudo nixos-rebuild switch --flake .#desktop 
  4. Update:

    sudo nix flake update

Credits

Thank you to the countless Nix OS configurations that I copied learnt from.

namishh — seniormatt — fufexan — frost-pheonix — anotherhadi — vic — vimjoyer — bad3r — mitchellh — misterio77 — max-baz — gvolpe — librephoenix — sioodmy

Due to my dementia I may have missed many. Regardless, I am thankful.

License

This repository is licensed under the MIT LICENSE.

About

a blazingly mid flakes and home manager powered nixos configuration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors