This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/README.md

84 lines
2.3 KiB
Markdown
Raw Normal View History

2024-05-10 10:06:16 -05:00
# jahanson's homelab
2024-03-13 06:55:17 -05:00
[Repository Documentation](https://truxnell.github.io/nix-config/)
## Thank you Truxnell
Thank you for a lot of the groundwork you laid for the base nixos configuration and a lot of modules!
2024-03-13 06:55:17 -05:00
## Getting started
2024-03-15 04:11:01 -05:00
To Install
2024-05-10 10:06:16 -05:00
```sh
nixos-rebuild switch --flake github:jahanson/nix-config-tn#HOST
2024-03-15 04:11:01 -05:00
```
2024-03-13 06:55:17 -05:00
## Goals
- [ ] Learn nix
2024-05-10 10:06:16 -05:00
- [ ] Services I want to separate from my kubernetes cluster I will use Nix.
- [ ] Approval-based update automation for flakes.
2024-03-13 06:55:17 -05:00
- [ ] Expand usage to other shell environments such as WSL, etc
2024-04-11 04:42:26 -05:00
- [ ] keep it simple, use trusted boring tools
2024-03-13 06:55:17 -05:00
## TODO
2024-05-10 10:06:16 -05:00
- [ ] Forgejo Actions
2024-03-13 06:55:17 -05:00
- [ ] Bring over hosts
2024-05-10 10:06:16 -05:00
- [ ] git.hsn.dev
- [ ] Telperion (network services)
- [ ] Gandalf (NixNAS)
- [ ] Thinkpad T470
2024-04-11 04:42:26 -05:00
## Checklist
2024-05-10 10:06:16 -05:00
### Adding a new node
- Ensure secrets are grabbed from note and all sops re-encrypte with task sops:re-encrypt
- Add to relevant github action workflows
- Add to .github/settings.yaml for PR checks
2024-03-13 06:55:17 -05:00
## Applying configuration changes on a local machine can be done as follows:
```sh
cd ~/dotfiles
sudo nixos-rebuild switch --flake .
# This will automatically pick the configuration name based on the hostname
```
Applying configuration changes to a remote machine can be done as follows:
```sh
cd ~/dotfiles
nixos-rebuild switch --flake .#nameOfMachine --target-host machineToSshInto --use-remote-sudo
```
2024-03-24 02:50:38 -05:00
## Hacking at nix files
Eval config to see what keys are being set.
```bash
nix eval .#nixosConfigurations.rickenbacker.config.security.sudo.WheelNeedsPassword
nix eval .#nixosConfigurations.rickenbacker.config.mySystem.security.wheelNeedsPassword
```
2024-04-22 23:49:41 -05:00
And browsing whats at a certain level in options - or just use [nix-inspect](https://github.com/bluskript/nix-inspect) TUI
2024-03-31 05:40:11 -05:00
```bash
2024-05-10 10:06:16 -05:00
nix eval .#nixosConfigurations.rickenbacker.config.home-manager.users.jahanson --apply builtins.attrNames --json
2024-03-31 05:40:11 -05:00
```
2024-03-24 02:50:38 -05:00
Quickly run a flake to see what the next error message is as you hack.
```bash
nixos-rebuild dry-run --flake . --fast --impure
```
2024-03-13 06:55:17 -05:00
## Links & References
- [Misterio77/nix-starter-config](https://github.com/Misterio77/nix-starter-configs)
- [billimek/dotfiles](https://github.com/billimek/dotfiles/)
- [Erase your Darlings](https://grahamc.com/blog/erase-your-darlings/)
- [NixOS Flakes](https://www.tweag.io/blog/2020-07-31-nixos-flakes/)