{
  "path": "/3mbhfupgzu22l",
  "site": "at://did:plc:tbzfsowmg4zj234pws47u3x6/site.standard.publication/3mb25gdgmj22r",
  "tags": [
    "nix",
    "NixOS",
    "Hetzner"
  ],
  "$type": "site.standard.document",
  "title": "Making sense of NixOS with nixos-anywhere - toolbox #2",
  "content": {
    "$type": "pub.leaflet.content",
    "pages": [
      {
        "id": "019b7f9e-d418-7660-9439-f6d3a902b5b3",
        "$type": "pub.leaflet.pages.linearDocument",
        "blocks": [
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": "Now, this might just be me, but I was trying to love nix & nixos for a while already but whenever I tired to use for my personal projects or as a operating system for my personal computer but then I always felt like it got in the way at times."
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": "On a personal computer I might spontaneously have to install proprietary software, like zoom, to get my work done and NixOS makes that a pain. I always went back to arch after a while but the thought of it's declarative beauty was still lingering in my mind."
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": "I recently heard more and more people using NixOS for their servers and production workloads and, thinking about it, that makes perfect sense. I will never ever need to install zoom or the like on a server. But I do care a lot about being in control of exactly what is installed on it, especially when running production workloads. Being able to define everything in a declarative configuration and check it into version control."
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "index": {
                    "byteEnd": 182,
                    "byteStart": 168
                  },
                  "features": [
                    {
                      "uri": "https://github.com/nix-community/nixos-anywhere",
                      "$type": "pub.leaflet.richtext.facet#link"
                    }
                  ]
                },
                {
                  "index": {
                    "byteEnd": 245,
                    "byteStart": 240
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#code"
                    }
                  ]
                }
              ],
              "plaintext": "The problem with that at first seemed to be that most cloud providers simply don't offer NixOS (yet) but that also appears to be a very solvable problem since there is nixos-anywhere. This tool turns any cloud VM into a NixOS machine using kexec. I tried it today and I am blown away by how well it works."
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "index": {
                    "byteEnd": 52,
                    "byteStart": 29
                  },
                  "features": [
                    {
                      "uri": "https://github.com/nix-community/nixos-anywhere-examples",
                      "$type": "pub.leaflet.richtext.facet#link"
                    }
                  ]
                }
              ],
              "plaintext": "I have followed the setup of nixos-anywhere-examples and turned a Hetzner Ubuntu machine into NixOS in just a few minutes and a single command"
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.code",
              "language": "shellscript",
              "plaintext": "nix run nixpkgs#nixos-anywhere -- --flake .generic --generate-hardware-config nixos-generate-config ./hardware-configuration.nix root@<your-ip>"
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": "And now all configuration files for this machine are on my local computer, I can edit them and check them into version control. And when I want to apply a change it's again just one command"
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.code",
              "language": "shellscript",
              "plaintext": "nix run nixpkgs#nixos-rebuild -- switch --flake .#generic --target-host root@<your-ip>"
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": ""
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "index": {
                    "byteEnd": 84,
                    "byteStart": 31
                  },
                  "features": [
                    {
                      "uri": "https://tangled.org/mariuskimmina.com/nix-hetzner-lab",
                      "$type": "pub.leaflet.richtext.facet#link"
                    }
                  ]
                }
              ],
              "plaintext": "You can find the config here: \nhttps://tangled.org/mariuskimmina.com/nix-hetzner-lab\n\nFor now it's just a minimal edit of the example repo but I have some plans for a project I want to host this way and to see how nix as IaC tool will hold up."
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": ""
            }
          },
          {
            "$type": "pub.leaflet.pages.linearDocument#block",
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [],
              "plaintext": "... maybe someday I will also get back to it for my personal computer once again ..."
            }
          }
        ]
      }
    ]
  },
  "bskyPostRef": {
    "cid": "bafyreifjkzu6pzrs42a5iazun6xfinbl4j6aaa2gk4tjpg3ud3wslzud4m",
    "uri": "at://did:plc:tbzfsowmg4zj234pws47u3x6/app.bsky.feed.post/3mbhfutkfxc2l",
    "commit": {
      "cid": "bafyreiec4zto5gwqecx5agu4oxnnah26bjl762o5xztvp6wkixgtlq3pvm",
      "rev": "3mbhfutmyom2k"
    },
    "validationStatus": "valid"
  },
  "description": "Using nix as an IaC tool",
  "publishedAt": "2026-01-02T17:22:48.455Z"
}