49 lines
1 KiB
Markdown
49 lines
1 KiB
Markdown
## home-manager
|
|
https://github.com/nix-community/home-manager
|
|
|
|
For a systematic overview of Home Manager and its available options, please see
|
|
- the [Home Manager manual](https://nix-community.github.io/home-manager/index.html) and
|
|
- the [Home Manager configuration options](https://nix-community.github.io/home-manager/options.html).
|
|
|
|
|
|
## Install a new host
|
|
|
|
This installs nixos on host `somehost`:
|
|
```bash
|
|
nix-shell -p nixUnstable --run 'nixos-install --flake https://gitlab.jalr.de/jalr/nixos-configuration#somehost --no-channel-copy'
|
|
```
|
|
|
|
### setting up sops
|
|
Get the host key and convert it.
|
|
```bash
|
|
ssh-keyscan -t ed25519 $host | ssh-to-age
|
|
```
|
|
|
|
Then add the key to `.sops.yaml`
|
|
|
|
If the key changed, you might want to run
|
|
```bash
|
|
sops updatekeys hosts/$host/secrets.yaml
|
|
```
|
|
|
|
## nix repl
|
|
start an interactive environment for evaluating Nix expressions
|
|
|
|
```
|
|
$ nix repl
|
|
|
|
nix-repl> a=builtins.getFlake (toString ./.)
|
|
```
|
|
|
|
```
|
|
$ nix repl
|
|
|
|
nix-repl> :lf .#
|
|
```
|
|
|
|
|
|
## Import GPG public key
|
|
```
|
|
gpg --card-edit
|
|
gpg/card> fetch
|
|
```
|