From a04b0301dfde1ba7647113c35fca87299d93555b Mon Sep 17 00:00:00 2001 From: pauljako Date: Wed, 25 Dec 2024 12:16:02 +0100 Subject: [PATCH] fix(post): hopefully finally fixed inline code --- ...5-12-24-installing-nixos-on-a-vps.markdown | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/_posts/2025-12-24-installing-nixos-on-a-vps.markdown b/_posts/2025-12-24-installing-nixos-on-a-vps.markdown index 5c96527..a364340 100644 --- a/_posts/2025-12-24-installing-nixos-on-a-vps.markdown +++ b/_posts/2025-12-24-installing-nixos-on-a-vps.markdown @@ -2,11 +2,11 @@ layout: post title: "Installing NixOS on a VPS" date: 2024-12-24 22:34:23 +0100 -categories: nixos, vps +categories: nixos vps --- ## Introduction Hello everyone, -I recently bought a new VPS. However the Provider I bought it at ([IONOS](https://ionos.com)) does not provide NixOS images. +I recently bought a new VPS. However the provider I bought it at ([IONOS](https://ionos.com)) does not provide NixOS images. At first I thought that Debian will be fine for me, but I quickly noticed, that NixOS is just way easier to maintain and reproduce. Especially on servers. So I quickly looked into ways of installing NixOS and I discovered two Methods: @@ -19,15 +19,22 @@ So I quickly looked into ways of installing NixOS and I discovered two Methods: ## Installing NixOS NixOS-Infect is pretty simple: First, add your public ssh key to the root user like this: -```echo "" >> /root/.ssh/authorized_keys```. +```bash +echo "" >> /root/.ssh/authorized_keys +``` After that just run the shell script by running the following: -```curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos- bash -x```. +```bash +curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos- bash -x +``` + At the time of writing the latest NixOS version is 24.11, so I entered the following: -```curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-24.11 bash -x```. +```bash +curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-24.11 bash -x +``` The script will automatically reboot your server and after it finished startup, You can login as the root user using the SSH-key you set up before. ## Configuring afterwards After installation you can use the VPS like a normal NixOS machine and deploy a new configuration using flakes or the /etc/nixos/configuration.nix file. I would highly recommend creating a new user and removing the SSH-key from the root user. Additionally I also installed things like docker and tailscale to make maintaining easier. -#### Thank you for reading this blog post. I hope, that I helped you out and you learned something new. Stay tuned for the next blog post. It will come soon! +#### Thank you for reading this blog post. I wish you Merry Christmas and I hope, that I helped you out. Hopefully we will see us soon