diff --git a/modules/hosts/janus.nix b/modules/hosts/janus.nix index f9ac553..34fa9f5 100644 --- a/modules/hosts/janus.nix +++ b/modules/hosts/janus.nix @@ -8,13 +8,13 @@ in modules = with inputs.self.modules; [ nixos.lxc nixos.sops - nixos.step-client + nixos.step-ssh-host inputs.home-manager.nixosModules.home-manager nixos."${username}" nixos.zsh nixos.docker { - step-client.hostname = hostname; + step-ssh-host.hostname = hostname; home-manager.users."${username}" = { imports = with inputs.self.modules.homeManager; [ diff --git a/modules/hosts/test-nix.nix b/modules/hosts/test-nix.nix index ecc8541..57c915f 100644 --- a/modules/hosts/test-nix.nix +++ b/modules/hosts/test-nix.nix @@ -8,7 +8,7 @@ in modules = with inputs.self.modules; [ nixos.lxc nixos.sops - nixos.step-client + nixos.step-ssh-host inputs.home-manager.nixosModules.home-manager nixos."${username}" nixos.zsh diff --git a/modules/programs/step-client.nix b/modules/programs/step-client.nix index 0cc3873..257a32a 100644 --- a/modules/programs/step-client.nix +++ b/modules/programs/step-client.nix @@ -7,9 +7,9 @@ in # # NixOS Module # - flake.modules.nixos.step-client = { config, pkgs, lib, ... }: + flake.modules.nixos.step-ssh-host = { config, pkgs, lib, ... }: let - cfg = config.step-client; + cfg = config.step-ssh-host; stepBin = lib.getExe pkgs.step-cli; rootCertPath = "/etc/step/certs/root_ca.crt"; provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path; @@ -18,7 +18,7 @@ in in { # NixOS Options - options.step-client = { + options.step-ssh-host = { hostname = lib.mkOption { type = lib.types.str; }; @@ -41,18 +41,15 @@ in # NixOS Config config = { ssh.certificates.enable = true; - home-manager.sharedModules = with inputs.self.modules; [ - homeManager.step-client - ]; - sops.secrets."janus/admin_jwk" = { owner = "root"; group = "root"; mode = "0400"; }; + networking.nameservers = [ "192.168.1.150" ]; + networking.dhcpcd.extraConfig = "nohook resolv.conf"; environment.etc."step/certs/root_ca.crt".source = cfg.rootCertFile; - environment.systemPackages = with pkgs; [ step-cli (writeShellScriptBin "ssh-host-cert-renew" '' @@ -66,13 +63,8 @@ in --principal "${cfg.hostname}.john-stream.com" \ "${cfg.hostname}" "${sshKeyPath}.pub" '') - (writeShellScriptBin "ssh-host-cert-check" '' - ssh-keygen -Lf ${sshCertPath} - '') + (writeShellScriptBin "ssh-host-cert-check" "${lib.getExe' pkgs.openssh "ssh-keygen"} -Lf ${sshCertPath}") ]; - networking.nameservers = [ "192.168.1.150" ]; - networking.dhcpcd.extraConfig = "nohook resolv.conf"; - }; };