Add support for integrating into nix/nixos

This commit is contained in:
Eike Kettner
2020-01-19 22:53:58 +01:00
parent 2454f358b1
commit 23af8acff8
9 changed files with 929 additions and 5 deletions

View File

@ -80,6 +80,46 @@ docspell.joex {
}
```
## Nix Expressions
The directory `/nix` contains nix expressions to install docspell via
the nix package manager and to integrate it into NixOS.
### Testing NixOS Modules
The modules can be build by building the `configuration-test.nix` file
together with some nixpkgs version. For example:
``` shell
nixos-rebuild build-vm -I nixos-config=./configuration-test.nix \
-I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz
```
This will build all modules imported in `configuration-test.nix` and
create a virtual machine containing the system. After that completes,
the system configuration can be found behind the `./result/system`
symlink. So it is possible to look at the generated systemd config for
example:
``` shell
cat result/system/etc/systemd/system/docspell-joex.service
```
And with some more commands (there probably is an easier way…) the
config file can be checked:
``` shell
cat result/system/etc/systemd/system/docspell-joex.service | grep ExecStart | cut -d'=' -f2 | xargs cat | tail -n1 | awk '{print $NF}'| sed 's/.$//' | xargs cat | jq
```
To see the module in action, the vm can be started (the first line
sets more memory for the vm):
``` shell
export QEMU_OPTS="-m 2048"
./result/bin/run-docspelltest-vm
```
## ADRs
Some early information about certain details can be found in the few