flake.lock: update mysecrets
hosts/dunamis/sops.nix: make it more composable Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
@ -1,4 +1,12 @@
|
||||
{inputs, ...}: {
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
s = inputs.mysecrets;
|
||||
hostname = config.networking.hostName;
|
||||
sopsFile = "${s}/hosts/${hostname}.yaml";
|
||||
in {
|
||||
imports = with inputs; [
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
@ -9,7 +17,7 @@
|
||||
keyFile = "/var/lib/sops-nix/key.txt";
|
||||
generateKey = true;
|
||||
};
|
||||
defaultSopsFile = "${toString inputs.mysecrets}/secrets.yaml";
|
||||
defaultSopsFile = "${s}/common.yaml";
|
||||
secrets = {
|
||||
"user-password-hashed".neededForUsers = true;
|
||||
"ssh-config" = {
|
||||
@ -17,12 +25,14 @@
|
||||
mode = "0400";
|
||||
owner = "user";
|
||||
};
|
||||
"ssh-dunamis-user" = {
|
||||
"ssh-${hostname}-user" = {
|
||||
inherit sopsFile;
|
||||
path = "/home/user/.ssh/id_ed25519";
|
||||
mode = "0400";
|
||||
owner = "user";
|
||||
};
|
||||
"ssh-dunamis-user.pub" = {
|
||||
"ssh-${hostname}-user.pub" = {
|
||||
inherit sopsFile;
|
||||
path = "/home/user/.ssh/id_ed25519.pub";
|
||||
mode = "0400";
|
||||
owner = "user";
|
||||
|
Reference in New Issue
Block a user