2022-06-07 00:25:33 +00:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
# SOPS configuration:
|
|
|
|
# docs: https://github.com/Mic92/sops-nix
|
|
|
|
#
|
|
|
|
# for each new user you want to edit sops files:
|
|
|
|
# create a private age key from ssh key:
|
|
|
|
# $ mkdir -p ~/.config/sops/age; ssh-to-age -private-key -i ~/.ssh/id_ed25519 > ~/.config/sops/age/keys.txt; chmod 600 ~/.config/sops/age/keys.txt
|
|
|
|
# if the private key was password protected, then first decrypt it:
|
|
|
|
# $ cp ~/.ssh/id_ed25519 /tmp/id_ed25519
|
|
|
|
# $ ssh-keygen -p -N "" -f /tmp/id_ed25519
|
|
|
|
#
|
|
|
|
# for each user you want to decrypt secrets:
|
|
|
|
# $ cat ~/.ssh/id_ed25519.pub | ssh-to-age
|
|
|
|
# add the result to .sops.yaml
|
|
|
|
# since we specify ssh pubkeys in the nix config, you can just grep for `ssh-ed25519` here and use those instead
|
|
|
|
#
|
2022-11-22 02:33:47 +00:00
|
|
|
# for each host you want to decrypt secrets:
|
2022-06-07 00:25:33 +00:00
|
|
|
# $ cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
|
|
|
|
# add the result to .sops.yaml
|
|
|
|
# $ sops updatekeys secrets/example.yaml
|
|
|
|
#
|
|
|
|
# to create a new secret:
|
|
|
|
# $ sops secrets/example.yaml
|
|
|
|
# control access below (sops.secret.<x>.owner = ...)
|
|
|
|
#
|
|
|
|
# to read a secret:
|
|
|
|
# $ cat /run/secrets/example_key
|
|
|
|
|
|
|
|
# sops.age.sshKeyPaths = [ "/home/colin/.ssh/id_ed25519_dec" ];
|
2022-09-23 01:28:03 +00:00
|
|
|
# This will add secrets.yaml to the nix store
|
2022-06-07 00:25:33 +00:00
|
|
|
# You can avoid this by adding a string to the full path instead, i.e.
|
|
|
|
# sops.defaultSopsFile = "/root/.sops/secrets/example.yaml";
|
2022-11-22 04:29:17 +00:00
|
|
|
sops.defaultSopsFile = ../../secrets/universal.yaml;
|
2022-10-23 13:48:39 +00:00
|
|
|
sops.gnupg.sshKeyPaths = []; # disable RSA key import
|
2022-06-07 00:25:33 +00:00
|
|
|
# This is using an age key that is expected to already be in the filesystem
|
|
|
|
# sops.age.keyFile = "/home/colin/.ssh/age.pub";
|
|
|
|
# sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
|
|
|
# This will generate a new key if the key specified above does not exist
|
|
|
|
# sops.age.generateKey = true;
|
|
|
|
# This is the actual specification of the secrets.
|
2022-06-10 00:41:03 +00:00
|
|
|
# sops.secrets.example_key = {
|
|
|
|
# owner = config.users.users.colin.name;
|
|
|
|
# };
|
2022-06-07 00:25:33 +00:00
|
|
|
# sops.secrets."myservice/my_subdir/my_secret" = {};
|
2022-12-26 08:09:58 +00:00
|
|
|
|
|
|
|
## universal secrets
|
2022-12-26 08:28:44 +00:00
|
|
|
# TODO: glob these?
|
|
|
|
|
2022-12-26 09:05:26 +00:00
|
|
|
sops.secrets."jackett_apikey" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
owner = config.users.users.colin.name;
|
|
|
|
};
|
2022-12-26 08:28:44 +00:00
|
|
|
sops.secrets."router_passwd" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
};
|
|
|
|
sops.secrets."wg_ovpnd_us_privkey" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
};
|
|
|
|
sops.secrets."wg_ovpnd_us-atl_privkey" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
};
|
|
|
|
sops.secrets."wg_ovpnd_us-mi_privkey" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
};
|
|
|
|
sops.secrets."wg_ovpnd_ukr_privkey" = {
|
|
|
|
sopsFile = ../../secrets/universal.yaml;
|
|
|
|
};
|
|
|
|
|
2022-12-26 09:29:04 +00:00
|
|
|
sops.secrets."snippets" = {
|
|
|
|
sopsFile = ../../secrets/universal/snippets.bin;
|
|
|
|
format = "binary";
|
|
|
|
owner = config.users.users.colin.name;
|
|
|
|
};
|
|
|
|
|
2022-12-26 08:28:44 +00:00
|
|
|
sops.secrets."bt/car" = {
|
|
|
|
sopsFile = ../../secrets/universal/bt/car.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
|
|
|
sops.secrets."bt/earbuds" = {
|
|
|
|
sopsFile = ../../secrets/universal/bt/earbuds.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
|
|
|
sops.secrets."bt/portable-speaker" = {
|
|
|
|
sopsFile = ../../secrets/universal/bt/portable-speaker.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2022-12-26 08:09:58 +00:00
|
|
|
|
|
|
|
sops.secrets."iwd/community-university.psk" = {
|
|
|
|
sopsFile = ../../secrets/universal/net/community-university.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
|
|
|
sops.secrets."iwd/friend-libertarian-dod.psk" = {
|
|
|
|
sopsFile = ../../secrets/universal/net/friend-libertarian-dod.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
|
|
|
sops.secrets."iwd/friend-rationalist-empathist.psk" = {
|
|
|
|
sopsFile = ../../secrets/universal/net/friend-rationalist-empathist.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2023-02-15 02:04:06 +00:00
|
|
|
sops.secrets."iwd/home-shared.psk" = {
|
2023-02-15 01:59:12 +00:00
|
|
|
sopsFile = ../../secrets/universal/net/home-shared.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2023-02-15 02:04:06 +00:00
|
|
|
sops.secrets."iwd/archive-2023-02-home-bedroom.psk" = {
|
2023-02-15 01:52:39 +00:00
|
|
|
sopsFile = ../../secrets/universal/net/archive/2023-02-home-bedroom.psk.bin;
|
2022-12-26 08:09:58 +00:00
|
|
|
format = "binary";
|
|
|
|
};
|
2023-02-15 02:04:06 +00:00
|
|
|
sops.secrets."iwd/archive-2023-02-home-shared-24G.psk" = {
|
2023-02-15 01:52:39 +00:00
|
|
|
sopsFile = ../../secrets/universal/net/archive/2023-02-home-shared-24G.psk.bin;
|
2022-12-26 08:09:58 +00:00
|
|
|
format = "binary";
|
|
|
|
};
|
2023-02-15 02:04:06 +00:00
|
|
|
sops.secrets."iwd/archive-2023-02-home-shared.psk" = {
|
2023-02-15 01:52:39 +00:00
|
|
|
sopsFile = ../../secrets/universal/net/archive/2023-02-home-shared.psk.bin;
|
2022-12-26 08:09:58 +00:00
|
|
|
format = "binary";
|
|
|
|
};
|
|
|
|
sops.secrets."iwd/iphone" = {
|
|
|
|
sopsFile = ../../secrets/universal/net/iphone.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2022-12-29 00:57:36 +00:00
|
|
|
sops.secrets."iwd/parents" = {
|
|
|
|
sopsFile = ../../secrets/universal/net/parents.psk.bin;
|
|
|
|
format = "binary";
|
|
|
|
};
|
2022-06-07 00:25:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|