NixOS is the endgame to Distro Hopping
Find a file
matt1432 248d04c2b0
All checks were successful
Discord / discord commits (push) Has been skipped
feat(nvim): neodev -> lazydev
2025-01-07 22:24:24 -05:00
.forgejo/workflows feat(servers): test github action 2024-01-11 17:22:35 -05:00
apps chore: update sources 2025-01-06 23:20:49 -05:00
configurations chore: update sources 2025-01-06 23:20:49 -05:00
devShells fix(node_modules): improve bumpNpmDeps and fix auto updates 2025-01-04 23:48:28 -05:00
homeManagerModules feat(nvim): neodev -> lazydev 2025-01-07 22:24:24 -05:00
inputs feat(ags4): add Kompass 2025-01-05 20:23:44 -05:00
lib refactor: some nix code cleanups 2025-01-06 14:41:55 -05:00
modules chore: update sources 2025-01-06 23:20:49 -05:00
nixFastChecks refactor: rename some flake attr directories 2024-12-16 15:51:41 -05:00
overlays chore: update sources 2025-01-04 03:23:45 -05:00
packages chore: update sources 2025-01-06 23:20:49 -05:00
results fix(cache): keep gc roots of nix-fast-build alive 2024-12-11 08:30:13 -05:00
scopedPackages fix(tuya): use overridePythonAttrs 2025-01-07 00:05:55 -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
flake.lock chore: update sources 2025-01-06 23:20:49 -05:00
flake.nix feat(ags4): add Kompass 2025-01-05 20:23:44 -05:00
LICENSE.md chore: add license 2024-01-18 11:01:09 -05:00
outputs.nix refactor: fit structure of main directories 2025-01-04 21:34:36 -05:00
README.md chore(docs): update todo list 2025-01-05 00:23:35 -05:00

My NixOS configs

TODO: add directory structure info and enforce it

- [x] every root folder in the repo represents a flake output except inputs
- [x] every root folder only has an optional `default.nix` and subfolders for each
      of its attrs
- [x] if there is non nix code, it will be in a `config` folder
- [x] every module should not do anything if imported
- [x] all nix files that represent a module should be `default.nix` (a nix file
     which is imported directly can be called anything alongside `default.nix`)
- [ ] redo docs

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. Its structure is based on a flake's outputs.

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

Flake Outputs

Output Description
nixosConfigurations devices' + ISO's configurations
nixOnDroidConfigurations.default Nix-On-Droid's configuration
packages Some custom packages not available in nixpkgs or modified from it
scopedPackages Some custom package scopes not available in nixpkgs or modified from it
apps Scripts ran from the flake defined here
homeManagerModules Modules made for home-manager
homeManagerModules Modules made for NixOS systems
formatter I format nix code with alejandra
devShells.default A dev shell to build an ISO from the live-image nixosConfiguration
devShells.ags A dev shell to have a NodeJS env when I enter my AGS's config directory

Flake Inputs

To allow use of the full nix language for my inputs, I use genflake. Therefore, the flake I edit is located at ./outputs.nix.

I also prefer using a more descriptive format for my inputs like so:

nixpkgs = {
  type = "github";
  owner = "NixOS";
  repo = "nixpkgs";

  # Branch name
  ref = "nixos-unstable";

  # Pin this input to a specific commit
  rev = "842d9d80cfd4560648c785f8a4e6f3b096790e19";
};

to make it more clear what is what in the flake URI

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