EI6RKRFQK7NXVUAD675ZYCC6VS5LMDKLYFW3IP35LZ37XPCSLCXQC MQT74AV47PUYNCX27OMFK6BFN7PP4DX46JAACN2EPRYXUXV7EL3AC RTBMBSBABSGTRICJ4AWBKWO3JJHBRKV6FGOMYPDD7X6SS6X35ZIQC 3JJNSJEGODVFHBIC2AOLOB3JZSFPPQBENWFLKHTSOGH7YGVW6GTQC VS6GXDU54DGMQJW7OCOZZCVEGE6F5SWXTW7NCDJUH67JN5MQQESQC ZBZAKBTWMFRBVZ66JMLA22M3JRULPIH7G7OBU2AT3AHHEA3E4KOQC 5G7WRBMWKG6DMCOHE6WQHTYZACUHO2UPBZRWN72CFH7P45NN5E7QC XA6QTEAO2EHEC7GWKSI7WBAYCFF2DZN7KOWU4K2GTQVJW5A6YHEQC QOY7D3GZ3WF7HAMEHAW2CIUB5TDQCFE3YDZEO23R5MFQEBN635WAC AHAA7UNL2RRXP7KERGVCC42GB564WS5BYSSFEOXW3EKVMB2UVEOAC ONJIY3TNGUJSQ4HRL2AIMDKYWYFICVZAHRU2GVY7LZ7ULWPY7NWQC SCB7IK7YNYAR3WTV2XYGPYCGCUW2GPJSWAA5S2ZGCYSZ5AZKXIDAC OQK4D36NJRFZWVHESTH4NHVYME62YBJSMR4J5K7B36YDERGFS5VAC { config, lib, ... }: letinherit (lib) enabled mkIf types;in {options.openssh = {enable = lib.mkEnableOption "openssh";idFile = lib.mkOption {type = types.path;example = "/run/agenix/id";description = "Path to the secret SSH id file";};};config = mkIf config.openssh.enable {age.secrets.id.rekeyFile = config.openssh.idFile;services.openssh = enabled {hostKeys = [{type = "ed25519";path = config.age.secrets.id.path;}];settings = {PasswordAuthentication = false;KbdInteractiveAuthentication = false;AcceptEnv = [ "SHELLS" "COLORTERM" ];};};};}
letcommonModule ={ pkgs, ... }:letidentityPath = "/home/jam/.ssh/id";in{environment.systemPackages = [ pkgs.mosh ];sshConfig = ''strictHostKeyChecking accept-newidentitiesOnly yesMatch *COLORTERM=truecolorTERM=xterm-256colorcontrolMaster autocontrolPersist 60mserverAliveCount 2serverAliveInterval 60IdentityFile ${identityPath}'';};in{config.flake.modules.hjem.ssh = {};config.flake.modules.nixos.ssh = {};config.flake.modules.darwin.ssh = {};config.flake.modules.nixos.openssh ={ config, lib, ... }:letinherit (lib)mkIfmkEnableOption;in{options.openssh = {enable = mkEnableOption "openssh";};config = mkIf config.openssh.enable {services.openssh = {enable = true;hostKeys = [{type = "ed25519";path = config.age.secrets.id.path;}];settings = {PasswordAuthentication = false;KbdInteractiveAuthentication = false;AcceptEnv = ["SHELLS""COLORTERM"];};};};};config.flake.modules.darwin.openssh ={ config, lib, ... }:letinherit (lib)mkIfmkEnableOption;in{options.openssh = {enable = mkEnableOption "openssh";};config = mkIf config.openssh.enable {services.openssh.enable = true;};};}
keys = {jam = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA7WV4+7uhIWQVHEN/2K0jJPTaZ/HbG3W8OKSpzmPBI4 jam";plum = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBH1S3dhOYCCltqrseHc3YZFHc9XU90PsvDo7frzUGrr root@plum";pear = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL2/Pg/5ohT3Dacnzjw9pvkeoQ1hEFwG5l1vRkr3v2sQ root@pear";kiwi = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIElcSHxI64xqUUKEY83tKyzEH+fYT5JCWn3qCqtw16af root@kiwi";date = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzfoVKZDyiyyMiX1JRFaaTELspG25MlLNq0kI2AANTa root@date";yuzu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDLlddona4PlORWd+QpR/7F5H46/Dic9vV23/YSrZl0 root@yuzu";};
commonModule ={ lib, ... }:letkeys = {jam = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA7WV4+7uhIWQVHEN/2K0jJPTaZ/HbG3W8OKSpzmPBI4 jam";plum = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBH1S3dhOYCCltqrseHc3YZFHc9XU90PsvDo7frzUGrr root@plum";pear = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL2/Pg/5ohT3Dacnzjw9pvkeoQ1hEFwG5l1vRkr3v2sQ root@pear";kiwi = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIElcSHxI64xqUUKEY83tKyzEH+fYT5JCWn3qCqtw16af root@kiwi";date = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzfoVKZDyiyyMiX1JRFaaTELspG25MlLNq0kI2AANTa root@date";yuzu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFDLlddona4PlORWd+QpR/7F5H46/Dic9vV23/YSrZl0 root@yuzu";};in{options.flake.keys = lib.mkOption {type = with lib.types; attrsOf anything;default = { };description = "SSH public keys";};config.flake.keys = keys // {admins = [ keys.jam ];all = builtins.attrValues keys;};};
config.flake.keys = keys // {admins = [ keys.jam ];all = builtins.attrValues keys;};
config.flake.modules.nixos.keys = commonModule;config.flake.modules.darwin.keys = commonModule;
letinherit (lib) enabled;in{}identityFile = identityPath;};};})];controlMaster = "auto";controlPersist = "60m";serverAliveCountMax = 2;serverAliveInterval = 60;environment.shellAliases.mosh = "mosh --no-init";programs.mosh = enabled {openFirewall = true;};home-manager.sharedModules = [(homeArgs: letidentityPath = if config.isLinux then"${homeArgs.config.home.homeDirectory}/.ssh/id"else"${config.users.users.${config.system.primaryUser}.home}/.ssh/id";in {programs.ssh = enabled {enableDefaultConfig = false;extraConfig = ''strictHostKeyChecking accept-newidentitiesOnly yes'';matchBlocks."*" = {setEnv.COLORTERM = "truecolor";setEnv.TERM = "xterm-256color";{ lib, config, ... }: