{ inputs, ... }: let username = "john"; hostname = "janus"; in { flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem { modules = with inputs.self.modules; [ nixos.lxc nixos.mysops nixos.step-ssh-host nixos.step-client nixos.step-ca inputs.home-manager.nixosModules.home-manager nixos."${username}" nixos.docker nixos.login-text nixos.mtls ({ lib, pkgs, ... }: { networking.hostName = hostname; sops.defaultSopsFile = ./secrets.yaml; step-ssh-host = { hostname = hostname; extraPrincipals = [ "192.168.1.244" "fded:fb16:653e:25da:be24:11ff:fea0:753f" ]; }; step-ca = { rootCertPath = ./root_ca.crt; intermediateCertPath = ./intermediate_ca.crt; dnsNames = [ "${hostname}.john-stream.com" "192.168.1.244" ]; secrets = { sopsFile = ./secrets.yaml; caPassword = "janus/ca_password"; intermediateKey = "janus/intermediate_ca_key"; sshHostCaKey = "janus/ssh_host_ca_key"; sshUserCaKey = "janus/ssh_user_ca_key"; adminProvisionerEncryptedKey = "janus/admin_provisioner_encrypted_key"; }; }; mtls = { enable = true; subject = hostname; san = [ "${hostname}.john-stream.com" "192.168.1.244" ]; }; users.users."${username}" = { shell = lib.mkForce ( lib.getExe inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.jsl-zsh ); }; # users.users."${username}".openssh.authorizedKeys.keys = [ # "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOkGLo4N/L3RYvaIZ1FmePlxa1HK0fMciZxKtRhN58F root@janus" # ]; home-manager.users."${username}" = { imports = with inputs.self.modules.homeManager; [ mysops step-client ]; docker.enable = true; }; }) ]; }; }