refactor: use michaotic username throughout, add cli/kitty/zsh configs and docs
This commit is contained in:
parent
1f960a53a5
commit
5c14cf0539
17 changed files with 509 additions and 36 deletions
63
docs/structure.md
Normal file
63
docs/structure.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# structure
|
||||
|
||||
how the config is organized.
|
||||
|
||||
## top-level
|
||||
|
||||
```
|
||||
nix-config/
|
||||
├── flake.nix # entry point - dispatches to hosts
|
||||
├── home/ # home-manager (user space)
|
||||
├── hosts/ # system-level configs
|
||||
├── secrets/ # sops-nix encrypted files
|
||||
└── docs/ # this folder
|
||||
```
|
||||
|
||||
## flake.nix flow
|
||||
|
||||
```
|
||||
flake.nix
|
||||
├── nixosConfigurations
|
||||
│ ├── muscari → hosts/muscari/ + home/
|
||||
│ └── rosemary → hosts/rosemary/ + home/
|
||||
└── darwinConfigurations
|
||||
└── poppy → hosts/poppy/ + home/
|
||||
```
|
||||
|
||||
## home/ vs hosts/
|
||||
|
||||
| what | where | why |
|
||||
|------|-------|-----|
|
||||
| shell config | `home/` | same on all machines |
|
||||
| terminal emulator | `home/` | gui apps belong here |
|
||||
| system packages | `hosts/<name>/` | os-specific |
|
||||
| networking | `hosts/<name>/` | per-host |
|
||||
| hostname | `hosts/<name>/` | obviously |
|
||||
|
||||
## adding things
|
||||
|
||||
**new package for all hosts:**
|
||||
→ add to `home/cli.nix` in `home.packages`
|
||||
|
||||
**new package for one host:**
|
||||
→ add to `hosts/<name>/default.nix` in `environment.systemPackages`
|
||||
|
||||
**new alias for all hosts:**
|
||||
→ add to `home/zsh.nix` in `programs.zsh.shellAliases`
|
||||
|
||||
**new alias for one host:**
|
||||
→ add to `hosts/<name>/default.nix` in `home-manager.users.mikl.programs.zsh.shellAliases`
|
||||
|
||||
## host-specific imports
|
||||
|
||||
poppy imports `home/kitty.nix` because it has a screen. muscari doesn't.
|
||||
|
||||
```nix
|
||||
# hosts/poppy/default.nix
|
||||
home-manager.users.mikl = {
|
||||
imports = [ ../../home/kitty.nix ];
|
||||
programs.zsh.shellAliases = {
|
||||
switch = "darwin-rebuild switch --flake .#poppy";
|
||||
};
|
||||
};
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue