Reorganise sops.
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./grub.nix
|
./grub.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
|
./sops.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./system.nix
|
./system.nix
|
||||||
./tty.nix
|
./tty.nix
|
||||||
|
|||||||
19
modules/core/sops.nix
Normal file
19
modules/core/sops.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
secretsPath = builtins.toString inputs.mysecrets;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sops = {
|
||||||
|
defaultSopsFile = "${secretsPath}/secrets.yaml";
|
||||||
|
age = {
|
||||||
|
sshKeyPaths = [
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
];
|
||||||
|
keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
|
generateKey = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5,6 +5,11 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
sops.secrets = {
|
||||||
|
"users_password/beastie" = {
|
||||||
|
neededForUsers = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
users = {
|
users = {
|
||||||
users = {
|
users = {
|
||||||
${username} = {
|
${username} = {
|
||||||
@@ -18,7 +23,7 @@
|
|||||||
"video"
|
"video"
|
||||||
];
|
];
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
config.sops.secrets."ssh_keys/beastie_priv".path
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
|
||||||
];
|
];
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,23 +1,9 @@
|
|||||||
{
|
{
|
||||||
inputs,
|
|
||||||
username,
|
username,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
secretsPath = builtins.toString inputs.mysecrets;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
sops = {
|
sops.secrets = {
|
||||||
defaultSopsFile = "${secretsPath}/secrets.yaml";
|
|
||||||
age = {
|
|
||||||
sshKeyPaths = [
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
];
|
|
||||||
keyFile = "/var/lib/sops-nix/key.txt";
|
|
||||||
generateKey = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
secrets = {
|
|
||||||
"users_password/beastie" = {
|
"users_password/beastie" = {
|
||||||
neededForUsers = true;
|
neededForUsers = true;
|
||||||
};
|
};
|
||||||
@@ -72,5 +58,4 @@ in
|
|||||||
path = "/home/${username}/.ssh/id_ed25519_wol.priv";
|
path = "/home/${username}/.ssh/id_ed25519_wol.priv";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user