added manual secrets

This commit is contained in:
ari committed 2026-06-26 16:07:47 -04:00
1 parent 672657c111
commit d9cacefa0f
34 files changed
+1428 -10

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# modules/home/
The Home Manager layer. **Unlike the rest of the repo, these files are not NixOS modules** —
they are plain functions that return Home Manager attribute sets. `core/user.nix` imports
this directory and calls the exported builders to populate `home-manager.users.<name>`.
## Files
```
home/
├── default.nix # Exports makeRootUser and makeCommonUser; composes the modules below
├── programs.nix # programs.* — shell + CLI tooling (zsh, nushell, neovim, starship, …)
├── services.nix # services.* — gpg-agent with SSH support
├── git.nix # makeCommonGitConfigs — git/delta config + includes from gitconfigs/
├── fonts.nix # fontconfig default font families
└── gitconfigs/ # Raw .gitconfig fragments included by every user (aliases, …)
```
## Entry points
`default.nix` exports two builder functions, both consumed by `core/user.nix`:
- `makeRootUser { hostName }` — minimal root profile (jq, kubectl, btop, …) with a
`root@<hostName>` git identity.
- `makeCommonUser { name, fullName, email, extraGitConfigs ? [] }` — the full human profile:
dev packages, the shared shell/program config, and the user's git identity.
Both apply the shared `homeModule` (state version + shell aliases like `cat→bat`,
`ls→eza`, `du→dust`, `df→duf`), `programsModule`, `servicesModule`, and `fontsModule`.
## Notable details
- **Shells**: zsh is the login shell, with autosuggestions, syntax highlighting, and a
`notify-send` hook for long-running commands. Nushell, starship, carapace, zellij, and
tmux are all configured here.
- **Git** (`git.nix`): `makeCommonGitConfigs` auto-includes every file under `gitconfigs/`
plus any per-user `extraGitConfigs`. Uses delta for diffs.
- The standalone (non-NixOS) Home Manager path in `modules/lib.nix`
(`makeHomeManagerUsers`) also calls `makeCommonUser`.
## Conventions
- These are **functions, not modules** — there is no `options`/`config`/`lib.mkIf` here.
Keep that pattern; the NixOS module system is applied one level up in `core/user.nix`.
- Add new shared CLI programs to `programs.nix`, services to `services.nix`, and global
packages to the relevant `home.packages` list in `default.nix`.
+47
View File
@@ -0,0 +1,47 @@
# Guidelines — modules/home/
Conventions specific to the Home Manager layer. Read alongside the repo-root `GUIDELINES.md`.
---
## ⚠️ These are functions, not NixOS modules
The biggest gotcha in this directory: the files here are **plain Nix functions that return
attribute sets**, not `{ config, lib, ... }` modules. There is no `options`, no `config`
block, and no `lib.mkIf`.
- `default.nix` exports `makeRootUser` and `makeCommonUser`.
- `programs.nix`, `services.nix`, `git.nix`, `fonts.nix` each export a value/function that
`default.nix` composes.
- The NixOS/HM module system is applied **one level up**, in `modules/core/user.nix`, which
feeds the result into `home-manager.users.<name>`.
Do **not** convert these into module-style files or add `skyg.*` options here — that belongs
in `core/user.nix`.
## Where to add things
| You want to add… | Put it in |
|---|---|
| A shared CLI program (`programs.<x>`) | `programs.nix` |
| A user service (`services.<x>`) | `services.nix` |
| A package for all users | `home.packages` in `default.nix` (`makeCommonUser`) |
| A package for root only | `home.packages` in `makeRootUser` |
| A git alias / git config fragment | a new file in `gitconfigs/` (auto-included) |
| A default font family | `fonts.nix` |
## Things to keep consistent
- **Identity flows in, not hardcoded.** `makeCommonUser` receives `name`/`fullName`/`email`
from `skyg.user.*`. Don't hardcode a username or email here.
- **Root vs human user.** Keep root's profile minimal (admin/cluster tooling); put the full
toolchain in `makeCommonUser`.
- **`makeCommonUser` is reused** by both the NixOS path (`core/user.nix`) and the standalone
Home Manager path (`modules/lib.nix → makeHomeManagerUsers`). Changes affect both.
- **State version** comes from `skyg.home-manager.version`; don't pin a literal here.
## Validation
You cannot meaningfully build HM output without a full switch (which is forbidden — see root
`GUIDELINES.md`). Limit yourself to `nix-instantiate --parse` for syntax. The user validates
by running their switch command.
+20
View File
@@ -0,0 +1,20 @@
# modules/home/gitconfigs/
Raw git config fragments that are auto-included into every user's `~/.gitconfig`.
`modules/home/git.nix` reads every **non-directory** file in this folder and adds it as a
`git.includes` path, so any file dropped here is picked up automatically — no wiring needed.
## Files
```
gitconfigs/
└── alias.conf # [alias] block: pp, up, ca, cap, undo-commit, sync, clean-branches, …
```
## Conventions
- Each file is a standalone git config fragment (e.g. an `[alias]` section). Drop a new
`.conf` file here and it is included on the next switch.
- Keep these provider-agnostic and identity-free; user name/email come from
`skyg.user.{fullName,email}` via `makeCommonGitConfigs`.