dotfiles/README.md

78 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2023-02-20 23:08:47 +02:00
# Tudor's Dotfiles / Nix configuration
2015-12-08 20:30:45 +02:00
2023-02-20 23:08:47 +02:00
This is my Nix configuration, which works both for NixOS and for Nix
2020-11-09 18:04:40 +02:00
2023-02-20 23:08:47 +02:00
Acknowledgements to https://github.com/mrkuz/nixos for heavily inspiring the layout of this config.
2023-06-04 14:10:32 +03:00
> **Warning**
> The configuration codified here was made to be used by me and only me.
> While I am publishing them to help others to learn Nix and dotfile management,
> copying them verbatim will likely produce an unusable system.
## Installation
### NixOS
First, provision a machine with NixOS.
Then:
Desktop:
1. Clone this repo somewhere on the machine.
2. `nix run .#nixos-rebuild -- boot --flake .#<hostname> --use-remote-sudo`
Remote server:
1. `nix run .#deploy-rs -- .#<hostname>`
2023-06-04 14:10:32 +03:00
### Any other Linux distro for sane people
2024-03-12 14:27:15 +02:00
The companion distro for this config is [My Build of Fedora Silverblue](https://github.com/tudurom/my-os).
It is made with [BlueBuild](https://blue-build.org). The desktop-oriented configs in this repo
are meant to be used with this Fedora build only.
1. Provision a system with the [ISO](https://github.com/tudurom/my-os/releases/tag/auto-iso).
2023-06-04 14:10:32 +03:00
2. Install Nix (my installer of choice is [nix-installer][nix-installer]).
3. Clone this repo somewhere on the machine
4. `nix run .#home-manager -- switch --flake .#tudor`
2023-06-04 14:10:32 +03:00
2023-06-04 19:00:45 +03:00
## Considerations for WSL
### Dependencies
The WSL setup assumes that you have 1Password and npiperelay [npiperelay] installed.
[npiperelay]: https://github.com/jstarks/npiperelay
2023-06-04 19:00:45 +03:00
You can install npiperelay with winget:
```powershell
winget install npiperelay
```
### Installing the thing
Assuming you have Nix set up on some other machine, clone this repo and run:
```bash
nix build .#nixosConfigurations.wsl2.config.system.build.installer
```
This will build the distro tarball in `./result/tarball/`. You can then import it in WSL:
```powershell
# Create the directory that will store the distro's disk image
New-Item -ItemType Directory c:\WSL\NixOS
# Import the tarball as a distro in WSL
wsl --import NixOS c:\WSL\NixOS .\result\tarball\<whatever>.tar.gz
# Boot it!
wsl -d NixOS
```
2023-06-04 14:10:32 +03:00
## Considerations for encrypting secrets
Secrets are encrypted and used through [agenix][agenix]. When provisioning a new machine, make sure to
take its host public key and rekey secrets accordingly.
2023-06-04 19:00:45 +03:00
[nix-installer]: https://github.com/DeterminateSystems/nix-installer
2023-11-27 00:29:10 +02:00
[agenix]: https://github.com/ryantm/agenix/