{ user ? throw "user argument is required", home ? throw "home argument is required", }: { config, inputs, system, lib, ... }: let hmConfig = config.home-manager.users.${user}; selfPkgs = inputs.self.packages.${system}; in { home-manager.users.${user} = { sops.secrets = { "ssh/personal/key" = { sopsFile = ../../../../../../../secrets/personal/secrets.yaml; key = "ssh/key"; path = "${home}/.ssh/ssh_personal_ed25519_key"; }; "ssh/personal/pass" = { sopsFile = ../../../../../../../secrets/personal/secrets.yaml; key = "ssh/pass"; }; "ssh/sas/ed25519/key" = { sopsFile = ../../../../../../../secrets/sas/secrets.yaml; key = "ssh/ed25519/key"; path = "${home}/.ssh/ssh_sas_ed25519_key"; }; "ssh/sas/ed25519/pass" = { sopsFile = ../../../../../../../secrets/sas/secrets.yaml; key = "ssh/ed25519/pass"; }; "ssh/sas/rsa/key" = { sopsFile = ../../../../../../../secrets/sas/secrets.yaml; key = "ssh/rsa/key"; path = "${home}/.ssh/ssh_sas_rsa_key"; }; "ssh/sas/rsa/pass" = { sopsFile = ../../../../../../../secrets/sas/secrets.yaml; key = "ssh/rsa/pass"; }; }; programs = { ssh = { matchBlocks = { "karaolidis.com" = { hostname = "karaolidis.com"; user = "nick"; identityFile = "${home}/.ssh/ssh_personal_ed25519_key"; }; "cldlgn.fyi.sas.com" = { inherit user; hostname = "cldlgn.fyi.sas.com"; identityFile = "${home}/.ssh/ssh_sas_ed25519_key"; }; }; userKnownHostsFiles = with selfPkgs; lib.lists.optionals config.sas.build.private [ ssh-known-hosts-sas-cldlgn ]; }; clipbook.bookmarks = { "Personal SSH Key Passphrase".source = hmConfig.sops.secrets."ssh/personal/pass".path; "SAS SSH ED25519 Key Passphrase".source = hmConfig.sops.secrets."ssh/sas/ed25519/pass".path; "SAS SSH RSA Key Passphrase".source = hmConfig.sops.secrets."ssh/sas/rsa/pass".path; }; }; }; }