stuff
This commit is contained in:
parent
975d396b48
commit
351938ba05
3 changed files with 52 additions and 4 deletions
49
README.md
Normal file
49
README.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# dotnix
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
You need to prepare a couple things before installation due to the way secrets are managed.
|
||||||
|
|
||||||
|
### Prepare secrets repo
|
||||||
|
|
||||||
|
1. Ensure all required dependencies are present
|
||||||
|
```sh
|
||||||
|
# If you're already using Nix you can simply run this
|
||||||
|
nix-shell -p sops age
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Initialize your secrets repo. You can do this anywhere on your system except this repository.
|
||||||
|
```sh
|
||||||
|
mkdir secrets
|
||||||
|
cd secrets
|
||||||
|
git init
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create your gitignore. You want this to make sure that you do not accidentally push your private key.
|
||||||
|
```sh
|
||||||
|
echo "keys.txt" > .gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Generate your private key.
|
||||||
|
```sh
|
||||||
|
age-keygen -o ./keys.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Create your sops configuration file
|
||||||
|
```sh
|
||||||
|
cat <<EOF > .sops.yaml
|
||||||
|
keys:
|
||||||
|
- &master $(age-keygen -y ./keys.txt)
|
||||||
|
creation_rules:
|
||||||
|
- path_regex: .*\.(yaml|json|env|ini)$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *master
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
?. Update the submodule to use your repo
|
||||||
|
```sh
|
||||||
|
git submodule set-url -- secrets <ssh uri to your repository>
|
||||||
|
```
|
||||||
|
|
3
build.sh
3
build.sh
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
nix build .#nixosConfigurations.puter.config.system.build.toplevel "$@"
|
|
|
@ -65,7 +65,9 @@ args() {
|
||||||
DOTNIX_DO_ONLY_BUILD=1
|
DOTNIX_DO_ONLY_BUILD=1
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
|
"-k" | "--key")
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
>&2 echo "Unrecognized argument '$1'. Run with --help to view accepted arguments."
|
>&2 echo "Unrecognized argument '$1'. Run with --help to view accepted arguments."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue