Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Uncategorized
  3. My server now lives in a Git repo!

My server now lives in a Git repo!

Scheduled Pinned Locked Moved Uncategorized
nixosinfrastructureagitopsselfhostedlinux
15 Posts 6 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bbₜᵤₓᵢT bbₜᵤₓᵢ

    My server now lives in a Git repo! 📂✨ Just took the plunge and set up my first host completely declaratively. Infrastructure as Code (IaC) is a total game changer for keeping the digital engine room organized.

    #NixOS #InfrastructureAsCode #GitOps #SelfHosted #Linux #DevOps

    https://ui.burningboard.org/

    S This user is from outside of this forum
    S This user is from outside of this forum
    satobi
    wrote last edited by
    #5

    @tux
    Hi, its my first comment on mastodon ✌️

    Am i right that NixOS can use configuration files to set up the server or ist an IaC tool like Terraform?

    bbₜᵤₓᵢT 1 Reply Last reply
    1
    0
    • R AodeRelay shared this topic
    • S satobi

      @tux
      Hi, its my first comment on mastodon ✌️

      Am i right that NixOS can use configuration files to set up the server or ist an IaC tool like Terraform?

      bbₜᵤₓᵢT This user is from outside of this forum
      bbₜᵤₓᵢT This user is from outside of this forum
      bbₜᵤₓᵢ
      wrote last edited by
      #6

      @satobi

      Welcome to our instance!

      NixOS uses configuration files to describe the desired state of your entire system — packages, services, and settings — and then reproduces that state. So it’s not just running commands, but defining a complete declarative system setup.

      Terraform is also declarative, but focuses mainly on infrastructure like VMs, networks, or cloud resources — not the internal system configuration.

      👉 In short: NixOS manages system state, Terraform manages infrastructure — similar idea, different scope.

      S 1 Reply Last reply
      1
      0
      • bbₜᵤₓᵢT bbₜᵤₓᵢ

        @satobi

        Welcome to our instance!

        NixOS uses configuration files to describe the desired state of your entire system — packages, services, and settings — and then reproduces that state. So it’s not just running commands, but defining a complete declarative system setup.

        Terraform is also declarative, but focuses mainly on infrastructure like VMs, networks, or cloud resources — not the internal system configuration.

        👉 In short: NixOS manages system state, Terraform manages infrastructure — similar idea, different scope.

        S This user is from outside of this forum
        S This user is from outside of this forum
        satobi
        wrote last edited by
        #7

        @tux
        Thank you for your response.

        Pretty interesting never heared of NixOS.

        Does NixOS change wirh the configuration Files or can they just used at the beginning?

        Krutonium://K bbₜᵤₓᵢT 2 Replies Last reply
        1
        0
        • S satobi

          @tux
          Thank you for your response.

          Pretty interesting never heared of NixOS.

          Does NixOS change wirh the configuration Files or can they just used at the beginning?

          Krutonium://K This user is from outside of this forum
          Krutonium://K This user is from outside of this forum
          Krutonium://
          wrote last edited by
          #8

          @satobi @tux

          If you're doing it right, everything is in the configuration file. In fact, the system will take steps to prevent you from making changes to the system yourself - the settings for your services are symlinks to a directory owned by a service that is readonly even to root. It's designed to require you to use Nix, enforcing Code-as-Documentation.

          I think it's important to understand as well that there is 3 things you can call Nix.

          The Package Manager, The Language, and the OS.

          Each one can technically be used on it's own - many people use the language and package manager on Non-Nix OS's, like other Linux Distros and even MacOS, but they work best together.

          This bit is very off topic, but the end result of all this is quite neat:

          Everything is reproducible. The binaries and configuration files will always have the same hash, and the same files end up in the same places.

          This extends far enough out that the laptop I am typing to you on right now has a tmpfs for the root filesystem. The system mounts /nix to that root filesystem, and in a fraction of a second populates the entire filesystem and proceeds to boot.

          The only data that survives a reboot is /home and /nix.

          My Laptop's OS is, effectively, ephemeral. There is no sustained system state that survives a reboot that isn't also defined in my configuration.

          Also you can totally use Nix to do Infrastructure, it's just a little bit more involved.

          A 1 Reply Last reply
          0
          • bbₜᵤₓᵢT bbₜᵤₓᵢ

            @jimmyb

            I'm currently only using Git locally and simply push the Nix config to the server via SFTP. There are certainly smarter solutions out there. 🙃

            Martin GoyotE This user is from outside of this forum
            Martin GoyotE This user is from outside of this forum
            Martin Goyot
            wrote last edited by
            #9

            @tux @jimmyb how do you rebuild your OS then? You have a service rebuilding it automatically? Or are you logging into the server to issue a nixos-rebuild?

            bbₜᵤₓᵢT 1 Reply Last reply
            0
            • Krutonium://K Krutonium://

              @satobi @tux

              If you're doing it right, everything is in the configuration file. In fact, the system will take steps to prevent you from making changes to the system yourself - the settings for your services are symlinks to a directory owned by a service that is readonly even to root. It's designed to require you to use Nix, enforcing Code-as-Documentation.

              I think it's important to understand as well that there is 3 things you can call Nix.

              The Package Manager, The Language, and the OS.

              Each one can technically be used on it's own - many people use the language and package manager on Non-Nix OS's, like other Linux Distros and even MacOS, but they work best together.

              This bit is very off topic, but the end result of all this is quite neat:

              Everything is reproducible. The binaries and configuration files will always have the same hash, and the same files end up in the same places.

              This extends far enough out that the laptop I am typing to you on right now has a tmpfs for the root filesystem. The system mounts /nix to that root filesystem, and in a fraction of a second populates the entire filesystem and proceeds to boot.

              The only data that survives a reboot is /home and /nix.

              My Laptop's OS is, effectively, ephemeral. There is no sustained system state that survives a reboot that isn't also defined in my configuration.

              Also you can totally use Nix to do Infrastructure, it's just a little bit more involved.

              A This user is from outside of this forum
              A This user is from outside of this forum
              arthurspringer
              wrote last edited by
              #10

              @krutonium @satobi @tux how much more difficult is it to setup a server via nixos compared to ubuntu server? i just want to host a fileserver and maybe immich in the future

              bbₜᵤₓᵢT 1 Reply Last reply
              0
              • A arthurspringer

                @krutonium @satobi @tux how much more difficult is it to setup a server via nixos compared to ubuntu server? i just want to host a fileserver and maybe immich in the future

                bbₜᵤₓᵢT This user is from outside of this forum
                bbₜᵤₓᵢT This user is from outside of this forum
                bbₜᵤₓᵢ
                wrote last edited by
                #11

                @arthurspringer @krutonium @satobi

                I believe setting up NixOS is not much harder than setting up a regular server.

                I recently ordered a virtual machine with Ubuntu from Hetzner (or another provider) and ran the following script to get started:

                curl https://www.google.com/search?q=https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-25.11 bash 2>&1 | tee /tmp/infect.log

                https://github.com/elitak/nixos-infect

                Important: Make sure to add your public SSH key when ordering the VM in the provider’s web interface or add it manually.

                For the rest of the configuration, I recommend consulting an AI — that’s what I did as well.

                Once everything is set up, you can find the complete configuration in the file /etc/nixos/configuration.nix You can easily edit it directly on the server using Nano.

                Good luck!

                A 1 Reply Last reply
                1
                0
                • Martin GoyotE Martin Goyot

                  @tux @jimmyb how do you rebuild your OS then? You have a service rebuilding it automatically? Or are you logging into the server to issue a nixos-rebuild?

                  bbₜᵤₓᵢT This user is from outside of this forum
                  bbₜᵤₓᵢT This user is from outside of this forum
                  bbₜᵤₓᵢ
                  wrote last edited by
                  #12

                  @Erwyn @jimmyb

                  Yes, exactly. I just log in via SSH, run nixos-rebuild switch there, and then reboot.

                  1 Reply Last reply
                  1
                  0
                  • bbₜᵤₓᵢT bbₜᵤₓᵢ

                    @arthurspringer @krutonium @satobi

                    I believe setting up NixOS is not much harder than setting up a regular server.

                    I recently ordered a virtual machine with Ubuntu from Hetzner (or another provider) and ran the following script to get started:

                    curl https://www.google.com/search?q=https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-25.11 bash 2>&1 | tee /tmp/infect.log

                    https://github.com/elitak/nixos-infect

                    Important: Make sure to add your public SSH key when ordering the VM in the provider’s web interface or add it manually.

                    For the rest of the configuration, I recommend consulting an AI — that’s what I did as well.

                    Once everything is set up, you can find the complete configuration in the file /etc/nixos/configuration.nix You can easily edit it directly on the server using Nano.

                    Good luck!

                    A This user is from outside of this forum
                    A This user is from outside of this forum
                    arthurspringer
                    wrote last edited by
                    #13

                    @tux @krutonium @satobi oh nice, is this just for vps tho? i am gonna try and set up a homelab on a thinkcentre tiny, should i just go for a usb-stick there?

                    bbₜᵤₓᵢT 1 Reply Last reply
                    0
                    • A arthurspringer

                      @tux @krutonium @satobi oh nice, is this just for vps tho? i am gonna try and set up a homelab on a thinkcentre tiny, should i just go for a usb-stick there?

                      bbₜᵤₓᵢT This user is from outside of this forum
                      bbₜᵤₓᵢT This user is from outside of this forum
                      bbₜᵤₓᵢ
                      wrote last edited by
                      #14

                      It's even easier at home, at least if you have a keyboard and monitor connected to your server.

                      There is an ISO with a graphical installer.

                      https://nixos.org/download

                      1 Reply Last reply
                      0
                      • S satobi

                        @tux
                        Thank you for your response.

                        Pretty interesting never heared of NixOS.

                        Does NixOS change wirh the configuration Files or can they just used at the beginning?

                        bbₜᵤₓᵢT This user is from outside of this forum
                        bbₜᵤₓᵢT This user is from outside of this forum
                        bbₜᵤₓᵢ
                        wrote last edited by
                        #15

                        @satobi

                        The file /etc/nixos/configuration.nix always remains the same!
                        You can also create additional files, e.g., an eytra file for the web server config.

                        1 Reply Last reply
                        1
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        Powered by NodeBB Contributors
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups