No description
Find a file
2025-05-12 21:15:49 +02:00
modules/nixos Migrate mow0m to new Repo 2025-05-05 20:39:01 +02:00
systems/x86_64-linux/mow0m Added Ohybke Keys 2025-05-10 11:18:56 +02:00
.gitignore Initial commit 2025-05-04 23:36:22 +02:00
flake.lock Updated Systems 2025-05-06 01:18:13 +02:00
flake.nix Migrate mow0m to new Repo 2025-05-05 20:39:01 +02:00
LICENSE Initial commit 2025-05-04 23:36:22 +02:00
README.md Updated Deployment Guide 2025-05-12 21:15:49 +02:00

Serverraum-mit-Matratze Infrastructure

license standard-readme compliant

This is the Infrastructure Code for the "Serverraum mit Matratze" shared apartment.

Table of Contents

Requirements

Requirements to do Remote Deployment using NixOS native Tools.

tab NixOS System (Dev System)

  1. SSH-Access to Target-Host with Sudo Privileges.
  2. Don't forget to Configure your ssh Config! (See Hosts)
  3. This Configuration git clone https://git.kb-one.de/Serverraum-mit-Matratze/infra

tab Non NixOS System with Nix Package Manager (Dev System)

  1. SSH-Access to Target-Host with Sudo Privileges.
  2. Don't forget to Configure your ssh Config! (See Hosts)
  3. This Configuration git clone https://git.kb-one.de/Serverraum-mit-Matratze/infra
  4. nixos-rebuild Command nix-shell -p '(nixos{}).nixos-rebuild'

Remote Deployment

So, you updated the Configuration on your Computer, how can you deploy it to the Server?

Don't forget to stage Added or Deleted Files! git add . (They will be ignored if you miss this step!)

Now Rebuild the System (on the Server) and Deploy it Remotely to the Server (Example mow0m):

nixos-rebuild switch --flake .#mow0m --build-host master@mow0m --target-host master@mow0m --use-remote-sudo 

nixos-rebuild switch will rebuild a NixOS Configuration and Switch to it immediately, by restarting affected Services.

--flake . specifies the Directory of flake.nix with the NixOS System Configuration.

#mow0m tells it to Build the NixOS-System with the Hostname mow0m of the Flake. (See Hosts)

--build-host master@mow0m specifies the SSH-Connection to the Build-Host. We will build on the Target Host, to avoid messing with Signatures of the Nix-Store.

--target-host master@mow0m specifies the SSH-Connection to the Target-Host to deploy the Configuration to.

--use-remote-sudo this will redirect the Sudo-Prompt on the Target-Host to your Command-Prompt.

Hosts

mow0m

Configuration

User master@mow0m
Cpu Intel(R) Core(TM) i5-6400 (4) @ 3.30 GHz
Ram 32GB
Build
nixos-rebuild switch --flake .#mow0m --target-host master@mow0m --build-host master@mow0m --use-remote-sudo
SSH Config
Host mow0m
        HostName mow0m.lan
        User master
        Port 9553
        IdentityFile ~/.ssh/master@mow0m
Host remoteunlock-mow0m
        HostName mow0m.lan
        User root
        Port 2550
        IdentityFile ~/.ssh/remoteunlock-mow0m

License

GPL v2