slight reorg
This commit is contained in:
@@ -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; [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user