Home Gen509 @ 2025-05-03-15:04 by jonas@comfy-station
This commit is contained in:
parent
9310353fd2
commit
587f734ac1
@ -1,7 +1,6 @@
|
||||
{config, ...}: rec {
|
||||
imports = [
|
||||
../modules/home/borg.nix
|
||||
../modules/home/ssh.nix
|
||||
../modules/home/yubikey.nix
|
||||
];
|
||||
|
||||
@ -29,6 +28,11 @@
|
||||
hive.waybar.enable = true;
|
||||
hive.wlogout.enable = true;
|
||||
hive.wofi.enable = true;
|
||||
hive.ssh = {
|
||||
enable = true;
|
||||
sopsFile = ../secrets/jonas/ssh.yaml;
|
||||
keys = ["borg" "passgit"];
|
||||
};
|
||||
hive.zsh.enable = true;
|
||||
hive.nix-scripts.enable = true;
|
||||
hive.doom.enable = true;
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
./home/firefox.nix
|
||||
./home/kdeconnect.nix
|
||||
./home/plasma.nix
|
||||
./home/ssh.nix
|
||||
./home/wallpaper.nix
|
||||
];
|
||||
}
|
||||
|
||||
@ -1,20 +1,46 @@
|
||||
{config, ...}: let
|
||||
sshKeys = name: {
|
||||
"ssh/id_${name}" = {
|
||||
sopsFile = ../../secrets/jonas/ssh.yaml;
|
||||
key = "keys/${name}";
|
||||
path = "${config.home.homeDirectory}/.ssh/id_${name}";
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.ssh;
|
||||
in {
|
||||
options.hive.ssh = {
|
||||
enable = lib.mkEnableOption "SSH keys and config";
|
||||
keys = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.str);
|
||||
default = [];
|
||||
description = ''
|
||||
A list of SSH key names. Each one results in a id_<name> file in .ssh
|
||||
'';
|
||||
};
|
||||
sopsFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the sops file containing the SSH keys.
|
||||
Requires a config key. And for each private key names in <keys> an keys.<name> entry.
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
sops.secrets =
|
||||
{
|
||||
"ssh/config" = {
|
||||
sopsFile = ../../secrets/jonas/ssh.yaml;
|
||||
key = "config";
|
||||
path = "${config.home.homeDirectory}/.ssh/config";
|
||||
};
|
||||
}
|
||||
// (sshKeys "borg")
|
||||
// (sshKeys "passgit");
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sops.secrets =
|
||||
{
|
||||
"ssh/config" = {
|
||||
inherit (cfg) sopsFile;
|
||||
key = "config";
|
||||
path = "${config.home.homeDirectory}/.ssh/config";
|
||||
};
|
||||
}
|
||||
// builtins.listToAttrs (map (name: {
|
||||
name = "ssh/id_${name}";
|
||||
value = {
|
||||
inherit (cfg) sopsFile;
|
||||
key = "keys/${name}";
|
||||
path = "${config.home.homeDirectory}/.ssh/id_${name}";
|
||||
};
|
||||
})
|
||||
cfg.keys);
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user