diff --git a/docs/hosts.org b/docs/hosts.org index d59d3c4..fb04691 100644 --- a/docs/hosts.org +++ b/docs/hosts.org @@ -13,6 +13,16 @@ You can decrypt it later with: #+begin_src bash gpg -d id_.gpg > id_ #+end_src +** Deploy the ssh keypair +You can use scp: +#+begin_src bash +scp id_ @:.ssh/id_ +scp id_.pub @:.ssh/id_.pub +#+end_src +Create a symbolic link for the host key (so we can use uniform naming in other parts): +#+begin_src bash +ln -s ~/.ssh/id_ ~/.ssh/id_ed25519 +#+end_src ** Add the public key to secrets.nix In the [[file:../secrets/secrets.nix][agenix secrets file]] add the public key, and give access to the necessary secrets. Remember to rekey the secrets afterwards: diff --git a/docs/install.org b/docs/install.org index 3572a49..0ee4f15 100644 --- a/docs/install.org +++ b/docs/install.org @@ -102,8 +102,14 @@ sudo nixos-install --impure --root /mnt --flake '.#reykjavik' #+begin_src bash cp ~/.ssh/id_ /mnt/home/marc/.ssh/id_ #+end_src -* Set up the user +* Initialization +Steps after reboot +** Set up the user You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user: #+BEGIN_SRC bash passwd marc #+END_SRC +** Log into tailscale +#+begin_src bash +sudo tailscale up +#+end_src diff --git a/hosts/reykjavik/default.nix b/hosts/reykjavik/default.nix index 437ca92..933593d 100644 --- a/hosts/reykjavik/default.nix +++ b/hosts/reykjavik/default.nix @@ -63,15 +63,6 @@ in system.pass.enable = true; system.sshfs.enable = true; - # - Server ---------------------------------- - # server.consul = { - # enable = true; - # agent-token = config.age.secrets."consul.d/agent-token-reykjavik.json".path; - # }; - # server.nomad = { - # enable = true; - # }; - # - Desktop ---------------------------------- desktop = { inherit wallpaper; diff --git a/hosts/thingvellir/default.nix b/hosts/thingvellir/default.nix index 9a5a4a9..226594d 100644 --- a/hosts/thingvellir/default.nix +++ b/hosts/thingvellir/default.nix @@ -41,6 +41,15 @@ with lib; system.ssh.enable = true; system.sshfs.enable = true; + # - Server ---------------------------------- + server.consul = { + enable = true; + agent-token = config.age.secrets."consul.d/agent-token-thingvellir.json".path; + }; + server.nomad = { + enable = true; + }; + # - Editors and development ------------------ dev.git.userName = "marc"; dev.git.userEmail = "marc@sastre.cat"; diff --git a/modules/secrets.nix b/modules/secrets.nix index 55fa4ca..8ccfbd7 100644 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -27,6 +27,12 @@ in group = "consul"; mode = "644"; }; + "consul.d/agent-token-thingvellir.json" = { + file = ../secrets/consul.d/agent-token-thingvellir.json.age; + owner = "consul"; + group = "consul"; + mode = "644"; + }; } // # Nomad ------------------------------- lib.optionalAttrs nomadCfg.enable {