NixOS is the endgame to Distro Hopping
Find a file
matt1432 44bd294bf0
All checks were successful
Discord / discord commits (push) Has been skipped
feat(jelly): use official skipintro button and change style
2024-11-11 05:33:32 -05:00
.forgejo/workflows feat(servers): test github action 2024-01-11 17:22:35 -05:00
apps chore: update flake.lock 2024-11-06 21:46:40 -05:00
checks refactor: rename checks and move files out of flake dir 2024-08-05 16:40:32 -04:00
common feat(netd nvim): switch to omnisharp and add linter 2024-10-31 23:13:02 -04:00
devices feat(jelly): use official skipintro button and change style 2024-11-11 05:33:32 -05:00
homeManagerModules feat(firefox): switch to official nix wiki 2024-10-09 11:16:55 -04:00
legacyPackages chore: update flake.lock 2024-11-10 15:18:31 -05:00
lib fix: add overlays for self.packages 2024-10-21 01:39:41 -04:00
nixosModules chore(hypr): allow deletion of build files in dev script 2024-11-10 17:18:19 -05:00
overlays chore: update flake.lock 2024-10-27 22:07:14 -04:00
packages fix(gsr): separate binaries to fix cap problem 2024-11-04 20:36:49 -05:00
.gitignore feat(agsV2): add lockscreen 2024-10-22 00:14:39 -04:00
flake.lock fix(hypr): pin at working rev 2024-11-10 16:57:31 -05:00
flake.nix fix(hypr): pin at working rev 2024-11-10 16:57:31 -05:00
inputs.nix fix(hypr): pin at working rev 2024-11-10 16:57:31 -05:00
LICENSE.md chore: add license 2024-01-18 11:01:09 -05:00
outputs.nix fix: add overlays for self.packages 2024-10-21 01:39:41 -04:00
README.md refactor(flake): rename flake.in.nix to outputs.nix 2024-08-05 20:51:11 -04: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. 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
legacyPackages 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