docs: clean up and remove TODOs
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
977cb08ae8
commit
a42f4091d0
6 changed files with 64 additions and 55 deletions
82
README.md
82
README.md
|
@ -1,16 +1,5 @@
|
||||||
# My NixOS configs
|
# 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
|
## AGS
|
||||||
|
|
||||||
You might find it weird that most of my config is written in TypeScript.
|
You might find it weird that most of my config is written in TypeScript.
|
||||||
|
@ -27,10 +16,22 @@ in TypeScript because it's the scripting language I am most comfortable with.
|
||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
This repo is the complete configuration of machines I own,
|
This repo is the complete configuration of machines I own running NixOS or Nix
|
||||||
running NixOS or Nix. Its structure is based on a flake's
|
and any other related smaller projects exposed by a Nix Flake.
|
||||||
|
|
||||||
|
Its main directory structure is based on a flake's
|
||||||
[outputs](https://wiki.nixos.org/wiki/Flakes#Output_schema).
|
[outputs](https://wiki.nixos.org/wiki/Flakes#Output_schema).
|
||||||
|
|
||||||
|
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
|
### Flake Location
|
||||||
|
|
||||||
This git repo will always be located at `$FLAKE` (`config.environment.variables.FLAKE`)
|
This git repo will always be located at `$FLAKE` (`config.environment.variables.FLAKE`)
|
||||||
|
@ -47,43 +48,22 @@ echo "$FLAKE" # /home/matt/.nix
|
||||||
sudo ln -sf /home/matt/.nix /etc/nixos
|
sudo ln -sf /home/matt/.nix /etc/nixos
|
||||||
```
|
```
|
||||||
|
|
||||||
### Flake Outputs
|
### Subdirectories
|
||||||
|
|
||||||
| Output | Description |
|
| Output / Directory | Description |
|
||||||
| ---------------------------------- | ----------- |
|
| -------------------- | ----------- |
|
||||||
| `nixosConfigurations` | [devices](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices)' + ISO's configurations |
|
| `apps` | [Misc scripts ran from the flake](./apps) |
|
||||||
| `nixOnDroidConfigurations.default` | [Nix-On-Droid](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices/android)'s configuration |
|
| `configurations` | [device, ISO and nix-on-droid configurations](./configurations) |
|
||||||
| `packages` | Some custom [packages](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/packages) not available in nixpkgs or modified from it |
|
| `devShells` | [Development shells for a bunch of projects and languages](./devShells) |
|
||||||
| `scopedPackages` | Some custom [package scopes](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/scopedPackages) not available in nixpkgs or modified from it |
|
| `homeManagerModules` | [Modules made for home-manager](./homeManagerModules) |
|
||||||
| `apps` | Scripts ran from the flake defined [here](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/apps) |
|
| `inputs` | [Pre-evaluated flake inputs](./inputs) |
|
||||||
| `homeManagerModules` | [Modules](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/homeManagerModules) made for home-manager |
|
| `lib` | [Custom Nix functions made easily available](./lib) |
|
||||||
| `homeManagerModules` | [Modules](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/modules) made for NixOS systems |
|
| `modules` | [Modules made for NixOS systems](./modules) |
|
||||||
| `formatter` | I format nix code with [alejandra](https://github.com/kamadorueda/alejandra) |
|
| `nixFastChecks` | [Attribute set of derivations exposed by this flake](./nixFastChecks) |
|
||||||
| `devShells.default` | A dev shell to build an ISO from the live-image nixosConfiguration |
|
| `overlays` | [Nixpkgs overlays](./overlays) |
|
||||||
| `devShells.ags` | A dev shell to have a NodeJS env when I enter my AGS's config directory |
|
| `packages` | [Some custom packages not available in nixpkgs or modified from it](./packages) |
|
||||||
|
| `results` | Directory where I neatly keep my result symlinks from `nixFastChecks` |
|
||||||
### Flake Inputs
|
| `scopedPackages` | [Some custom package scopes not available in nixpkgs or modified from it](./scopedPackages) |
|
||||||
|
|
||||||
To allow use of the full nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen).
|
|
||||||
Therefore, the flake I edit is located at `./outputs.nix`.
|
|
||||||
|
|
||||||
I also prefer using a more descriptive format for my inputs like so:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
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
|
### Secrets
|
||||||
|
|
||||||
|
@ -117,6 +97,4 @@ and this shell command:
|
||||||
nix eval --json --file ./.sops.nix | remarshal --if json --of yaml > .sops.yaml
|
nix eval --json --file ./.sops.nix | remarshal --if json --of yaml > .sops.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
TLDR: I
|
TLDR: I **[hate](https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell)** YAML
|
||||||
**[hate](https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell)**
|
|
||||||
YAML
|
|
||||||
|
|
22
inputs/README.md
Normal file
22
inputs/README.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Inputs
|
||||||
|
|
||||||
|
To allow use of the full nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen).
|
||||||
|
Therefore, the flake I edit is located at `$FLAKE/_outputs.nix`.
|
||||||
|
|
||||||
|
I also prefer using a more descriptive format for my inputs like so:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
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
|
|
@ -1,4 +1,3 @@
|
||||||
# TODO: add README
|
|
||||||
let
|
let
|
||||||
inherit (import ./lib.nix) mkInput mkHyprDep mkSrc;
|
inherit (import ./lib.nix) mkInput mkHyprDep mkSrc;
|
||||||
inherit (builtins) listToAttrs map removeAttrs;
|
inherit (builtins) listToAttrs map removeAttrs;
|
||||||
|
|
2
justfile
2
justfile
|
@ -1,7 +1,7 @@
|
||||||
default:
|
default:
|
||||||
@just --list
|
@just --list
|
||||||
|
|
||||||
docs args:
|
docs:
|
||||||
nix run "$FLAKE"#gen-docs
|
nix run "$FLAKE"#gen-docs
|
||||||
|
|
||||||
genflake:
|
genflake:
|
||||||
|
|
11
lib/README.md
Normal file
11
lib/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Lib
|
||||||
|
|
||||||
|
This directory contains Nix functions separated by what type or program they are associated with.
|
||||||
|
|
||||||
|
| Attribute Set | Description |
|
||||||
|
| ------------- | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `attrs` | [Misc functions dealing with attribute sets](./attrs) |
|
||||||
|
| `flake` | [Helper functions for top level flake outputs](./flake) |
|
||||||
|
| `hypr` | [Helper functions to configure hyprland in a cleaner way](./hypr) |
|
||||||
|
| `pkgs` | [Misc functions dealing with packages](./pkgs) |
|
||||||
|
| `strings` | [Misc functions dealing with strings](./strings) |
|
|
@ -1,4 +1,3 @@
|
||||||
# TODO: add README and document functions
|
|
||||||
{
|
{
|
||||||
perSystem,
|
perSystem,
|
||||||
inputs,
|
inputs,
|
||||||
|
|
Loading…
Add table
Reference in a new issue