Skip to content

goon/nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

577 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, powered by Hyprland, and held together by hopes, dreams and vibes.

Caution

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

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

Table of Contents

Screenshots

preview

Structure

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

Modules

  • modules/apps — Software Configurations
  • modules/core — Bedrock
  • modules/hardware — Hardware Configurations
  • modules/session — Environment Configurations

The Dendritic Module Engine

To heavily reduce boilerplate traditionally associated with mixing NixOS and Home Manager configurations a custom abstraction engine is used (lib.module).

Instead of dealing with deeply nested home-manager.sharedModules arrays, every module is automatically exposed with three root level blocks:

{ config, lib, pkgs, ... }:

lib.module config "moduleName" true {
  # 1. System Layer
  config = {
    services.example.enable = true;
  };

  # 2. Package Injection
  userPkgs = with pkgs; [
    example-package
  ];

  # 3. User Layer
  home = {
    programs.example = {
      enable = true;
      settings = { ... };
    };
  };
}

The config, home and userPkgs blocks are automatically parsed and natively wired into NixOS and Home Manager under the hood, ensuring that modules remain flat, organised and stripped of boilerplate.

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

Hosts are formed by combining the auto discovered modules with host specific overrides in hosts/<hostname>/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.

Profiles

To avoid manually enabling douzens of individual modules on every host, the configuration uses a high-level profile system defined in modules/profiles.nix.

Profiles bundle related modules together. For example, setting profile.session = true; in a host configuration automatically enables the entire desktop session as a cohesive module.

Globals

Global options are defined centrally in modules/globals.nix under the globals. namespace. They allow hosts to share common system settings and user preferences across both NixOS and Home Manager modules.

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 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

These instructions document the bootstrapping process for deploying to a new machine. It is not intended as a guide for others to install this configuration. Once again, this configuration is shared for reference and inspiration, NOT adoption.

Caution

The configuration expects the flake to live in $HOME/.nixos.

Your username and the location of the flake per host can be modified inside of hosts/vars.nix.

Forgetting to update these values will result in a broken configuration.

  1. Clone
   nix-shell -p git
   git clone --recursive https://github.com/goon/nixos ~/.nixos
   cd ~/.nixos

Note

The --recursive flag ensures the yaks quickshell submodule is pulled.

  1. Run the Bootstrap Script
   ./scripts/bootstrap

Credits

Huge thank you to the countless configurations made public that I copied, referenced, learnt from and that inspired me to take my config to the deepest pits of hell.

Both hlissner and fufexan's configurations heavily informed and inspired my own, and many more:

namishh — seniormatt — anotherhadi — vic — vimjoyer — mitchellh — gvolpe — librephoenix

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