diff --git a/justfile b/justfile index 24b9f13..d9a56b8 100644 --- a/justfile +++ b/justfile @@ -69,6 +69,10 @@ generate-age-from-ssh: get-public-age-key: nix shell nixpkgs#age -c age-keygen -y ~/.config/sops/age/keys.txt +# Get the public ssh key from the current user +get-public-ssh-key: + cat ~/.ssh/id_ed25519.pub + # Edit the SOPS secrets file edit-secrets: nix run nixpkgs#sops -- shared/secrets/secrets.yaml diff --git a/shared/modules/security/default.nix b/shared/modules/security/default.nix index c251b0f..1225fcd 100644 --- a/shared/modules/security/default.nix +++ b/shared/modules/security/default.nix @@ -1,6 +1,7 @@ { imports = [ ./sops.nix + ./ssh.nix ./yubikey.nix ]; diff --git a/shared/modules/security/ssh.nix b/shared/modules/security/ssh.nix new file mode 100644 index 0000000..5f016d8 --- /dev/null +++ b/shared/modules/security/ssh.nix @@ -0,0 +1,13 @@ +# /nix/store//etc/ssh/ssh_config +{ + programs.ssh.knownHosts = + let + domain = "dns.martials.no"; + in + { + desktop = { + extraHostNames = [ "desktop.${domain}" ]; + publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSzXyTuQyTrWsfORQbvgrqt/33+hfSUDXeMg6D1T2wz"; + }; + }; +} diff --git a/shared/modules/users.nix b/shared/modules/users.nix index a7991e5..89c45e2 100644 --- a/shared/modules/users.nix +++ b/shared/modules/users.nix @@ -5,7 +5,7 @@ in { users.users.${username} = { isNormalUser = true; - hashedPasswordFile = config.sops.secrets.password.path; + hashedPasswordFile = config.sops.secrets.password-hash.path; description = username; extraGroups = [ "networkmanager"