Compare commits

..

No commits in common. "c7c2ab874fabe53fdb8d5651f97b8e96aed7ff58" and "c6bc9fb3aca863b7cb730c2072ebad3cb6fc8a38" have entirely different histories.

2 changed files with 16 additions and 95 deletions

View file

@ -1,81 +1,2 @@
# Serverraum-mit-Matratze Infrastructure
# infra
[![license](https://img.shields.io/badge/license-GPL%20v2-blue)](LICENSE)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
This is the Infrastructure Code for the "Serverraum mit Matratze" shared apartment.
## Table of Contents
- [Dependencies](#dependencies)
- [Updating Configuration](#updating-configuration)
- [Hosts](#hosts)
- [License](#license)
## Dependencies
To remotely Deploy Nix-Servers with Native Tools, you will need Access to the nixos-rebuild command.
You can either use a NixOS System.
Or you can Install the [Nix Package Manager](https://nixos.org/download/) and open a Nix-Shell with the Command available:
``` bash
nix-shell -p '(nixos{}).nixos-rebuild'
```
## Updating Configuration
So, you updated the Configuration on your Computer, how can you apply the Updated Config to the Server?
You'll need SSH-Access to the Server, with a User which can run Nix-Commands, and can escalate Privileges using sudo.
1. Don't forget to Configure your ssh Config! (See [Hosts](#hosts))
2. Stage the Changes if you created or deleted Files `git add .` (They will be ignored if you miss this step!)
3. Build and Switch the Config on the Target Server! (Example [mow0m](#mow0m)
``` bash
nixos-rebuild switch --flake .#mow0m --target-host master@mow0m --build-host master@mow0m --use-remote-sudo
```
You want to keep the Build-Host the Same as the Target-Host, because the Target will only accept Binarys with a trusted Signature. It is way easier, to just run the Build on the Same Machine then.
## Hosts
### mow0m
[Configuration](./systems/x86_64-linux/mow0m)
<table>
<tr>
<td>User</td>
<td>master@mow0m</td>
</tr>
<tr>
<td>Cpu</td>
<td>Intel(R) Core(TM) i5-6400 (4) @ 3.30 GHz</td>
</tr>
<tr>
<td>Ram</td>
<td>32GB</td>
</tr>
<tr>
<td>Build</td>
<td><pre lang="bash">nixos-rebuild switch --flake .#mow0m --target-host master@mow0m --build-host master@mow0m --use-remote-sudo</pre></td>
</tr>
<tr>
<td>SSH Config</td>
<td><pre lang="bash">
Host mow0m
HostName mow0m.lan
User master
Port 9553
IdentityFile ~/.ssh/master@mow0m</pre></td>
</tr>
</table>
## License
[GPL v2](../LICENSE)

30
flake.lock generated
View file

@ -127,11 +127,11 @@
]
},
"locked": {
"lastModified": 1746413188,
"narHash": "sha256-i6BoiQP0PasExESQHszC0reQHfO6D4aI2GzOwZMOI20=",
"lastModified": 1745256380,
"narHash": "sha256-hJH1S5Xy0K2J6eT22AMDIcQ07E8XYC1t7DnXUr2llEM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8a318641ac13d3bc0a53651feaee9560f9b2d89a",
"rev": "22b326b42bf42973d5e4fe1044591fb459e6aeac",
"type": "github"
},
"original": {
@ -182,11 +182,11 @@
]
},
"locked": {
"lastModified": 1746324578,
"narHash": "sha256-VUSIQ2W1Q3YgGvX3M4jPwIi3iIApdPHabhdrVjVgnwE=",
"lastModified": 1745114634,
"narHash": "sha256-gB63YTgfrX2zH2zFIruRrOrLltjSBoYm2L56yaGo5XM=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "9e7fd83ba3b25b6f03561a5b7f8ea74b70296816",
"rev": "92120cad3f2b7c1c326b6ca0b9beda171d6ee6a3",
"type": "github"
},
"original": {
@ -233,11 +233,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1746468201,
"narHash": "sha256-hSOSlrvMJwGr8hX/gc0mnhUf5UIClMDUAadfXlSXzfc=",
"lastModified": 1744633460,
"narHash": "sha256-fbWE4Xpw6eH0Q6in+ymNuDwTkqmFmtxcQEmtRuKDTTk=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "6aabf68429c0a414221d1790945babfb6a0bd068",
"rev": "9a049b4a421076d27fee3eec664a18b2066824cb",
"type": "github"
},
"original": {
@ -265,11 +265,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1746328495,
"narHash": "sha256-uKCfuDs7ZM3QpCE/jnfubTg459CnKnJG/LwqEVEdEiw=",
"lastModified": 1744932701,
"narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e",
"rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef",
"type": "github"
},
"original": {
@ -320,11 +320,11 @@
]
},
"locked": {
"lastModified": 1745310711,
"narHash": "sha256-ePyTpKEJTgX0gvgNQWd7tQYQ3glIkbqcW778RpHlqgA=",
"lastModified": 1744669848,
"narHash": "sha256-pXyanHLUzLNd3MX9vsWG+6Z2hTU8niyphWstYEP3/GU=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "5e3e92b16d6fdf9923425a8d4df7496b2434f39c",
"rev": "61154300d945f0b147b30d24ddcafa159148026a",
"type": "github"
},
"original": {