NixOS is the endgame to Distro Hopping
Find a file
matt1432 f696f043a4
All checks were successful
Discord / discord commits (push) Has been skipped
docs: update package READMEs
2025-02-18 16:28:20 -05:00
.forgejo/workflows feat(servers): test github action 2024-01-11 17:22:35 -05:00
apps feat(gen-docs): add metadata of all scoped packages 2025-02-18 13:48:19 -05:00
configurations chore: update sources 2025-02-17 17:12:03 -05:00
devShells docs: add generated overlays readme 2025-01-21 17:05:47 -05:00
homeManagerModules fix(nvim): set correct path for headless markdown preview 2025-02-18 02:27:01 -05:00
inputs docs: clean up and remove TODOs 2025-02-18 02:41:02 -05:00
lib docs: clean up and remove TODOs 2025-02-18 02:41:02 -05:00
modules chore: update sources 2025-02-17 17:12:03 -05:00
nixFastChecks feat: disable cache-apt because it causes lag 2025-01-11 17:08:38 -05:00
overlays chore: update sources 2025-02-17 17:12:03 -05:00
packages docs: update package READMEs 2025-02-18 16:28:20 -05:00
results fix(cache): keep gc roots of nix-fast-build alive 2024-12-11 08:30:13 -05:00
scopedPackages docs: update package READMEs 2025-02-18 16:28:20 -05:00
.gitattributes feat(git): remove generated files from git diff 2024-11-15 14:03:43 -05:00
.gitignore fix(cache): keep gc roots of nix-fast-build alive 2024-12-11 08:30:13 -05:00
_outputs.nix refactor: move all inputs to 2025-01-27 18:16:37 -05:00
flake.lock chore: update sources 2025-02-17 17:12:03 -05:00
flake.nix chore: update sources 2025-02-14 14:45:54 -05:00
justfile docs: clean up and remove TODOs 2025-02-18 02:41:02 -05:00
LICENSE.md chore: add license 2024-01-18 11:01:09 -05:00
README.md docs: clean up and remove TODOs 2025-02-18 02:41:02 -05:00

My NixOS configs

AGS

You might find it weird that most of my config is written in TypeScript. That's because all my desktops run AGS for UI. Click on this to see my configuration.

I'm also a victim of Stockholm syndrome at this point and make my scripts in TypeScript because it's the scripting language I am most comfortable with.

About

General

This repo is the complete configuration of machines I own running NixOS or Nix and any other related smaller projects exposed by a Nix Flake.

Its main directory structure is based on a flake's outputs.

I try to follow a few rules to better organise my Nix code:

  • Every main subdirectory only has an optional default.nix and subfolders for each of its attributes.
  • Inside a subdirectory, if there is non nix code, it will be in a config folder.
  • Every module should not do anything if imported. An enable option should be toggled for it to have any effect.
  • Any nix file that represents a module should be named default.nix (a nix file which is imported directly can be called anything else alongside default.nix)

Flake Location

This git repo will always be located at $FLAKE (config.environment.variables.FLAKE) and symlinked to /etc/nixos to have everything where NixOS tools expect things to be.

ie.

sudo rm -r /etc/nixos

echo "$FLAKE" # /home/matt/.nix

sudo ln -sf /home/matt/.nix /etc/nixos

Subdirectories

Output / Directory Description
apps Misc scripts ran from the flake
configurations device, ISO and nix-on-droid configurations
devShells Development shells for a bunch of projects and languages
homeManagerModules Modules made for home-manager
inputs Pre-evaluated flake inputs
lib Custom Nix functions made easily available
modules Modules made for NixOS systems
nixFastChecks Attribute set of derivations exposed by this flake
overlays Nixpkgs overlays
packages Some custom packages not available in nixpkgs or modified from it
results Directory where I neatly keep my result symlinks from nixFastChecks
scopedPackages Some custom package scopes not available in nixpkgs or modified from it

Secrets

All my secrets are in a private git repo that makes use of sops-nix. I generate .sops.yaml from .sops.nix:

let
  wim = "somekey";
  binto = "somekey2";
in {
  creation_rules = [
    {
      path_regex = "secrets/[^/]+\\.(yaml|json|env|ini)$";
      key_groups = [
        {
          age = [wim binto];
        }
      ];
    }
  ];
}

which is then converted to .sops.yaml using remarshal and this shell command:

nix eval --json --file ./.sops.nix | remarshal --if json --of yaml > .sops.yaml

TLDR: I hate YAML