Skip to content

Ladas552/Nix-Is-Unbreakable

Repository files navigation

nix

What is this?

This is my multi host, modular Nix config. It declares configs for different programs using Nix language, such as:

I also declare configuration as packages that you can try with nix run github:Ladas552/Nix-Is-Unbreakable#app, replace app with:

Overview of things to note

Hosts

  • 2 NixOS hosts with Nvidia and Intel, and AMD APU on laptops. Both on ZFS
  • Nix-On-Droid on phone, even if unmantained, it still works
  • NixOS-WSL for Windows partition
  • NixVM for testing, you shouldn't use it unless testing breaking changes
  • NixIso for my portable NixOS image

Modular

Config is modular in a way that depending on host, the changes for programs can change. Like For FullHD screen and 4K screen - font size is 13 and 11 respectively. This is dependent on meta attribute, which is inherited by all modules, even standalone ones.

Which makes my Nix Packages interchangeable depending on the host they are running under. meta is declared in flake.nix as a boilerplate and in each individual host as a specialty.

Also, you don't need to add imports to hosts, just custom.helix.enable = true; to download the package and a config for any individual host. More info on this structure in Vimjoyer's Video

Overlays

I declare overlays in Overlays file. They change and add stuff to the main nixpkgs, like adding custom prefixes to scripts, or defining neovim-nightly.

Docs

I write comments on things, that might explain certain ways of doing things, or leave not working options in comments for people to find. This is to not look up one thing twice, and just look at the nix file itself.

Also, I have Norg document, containing notes and TODO for the config, and folder /docs for containing more specific instructions.

Directory structure

flowchart TD
    flake[flake] --> A[docs]
    flake --> C[homeModules]
    flake --> F[hosts]
    flake --> N[nixosModules]
    flake --> R[overlays]
    flake --> T[pkgs]
    flake --> V[secrets]

    A -->|norg files with information| B[storage]
    C -->|directories containing config files| D[pkgs]
    C -->|importing all home-manager modules| E[default.nix]
    F --> G[all-my-hosts]
    G -->|custom iso for reinstalling| H[NixIso]
    G -->|nix-on-droid config| I[NixMux]
    G -->|acer laptop| J[NixPort]
    G -->|soon to be server| K[NixToks]
    G -->|experimenting host| L[NixVM]
    G -->|wsl for windows| M[NixWSL]
    N -->|importing all NixOS modules| O[default.nix]
    N -->|graphical sessions and WMs| P[Desktops]
    N -->|all other modules| Q[other modules]
    R -->|overlaying nixpkgs and applying patches| S[patches]
    T -->|scripts and neovim configs| U[derivations]
    V -->|try to decrypt it| W{secrets.yaml}
Loading

Name

Yes, it is a JoJo's reference

Credits

I take a lot of things from the internet and different configs too. So I credit people in comments to snippets that I stole.

If you want to check every person that I stole things from, go to my List of configs

Also for that one guy who switched to codeberg

Also, thanks to everyone in nix-community for being so awesome, wouldn't be there without ya