69 Commits

Author SHA1 Message Date
3734af5388 [nixpkgs] 24.05 -> 24.11
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 5m52s
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 7m30s
2024-12-13 03:56:56 +01:00
4367161e5f [docs] add local persistent microvm usage 2024-12-13 03:36:45 +01:00
49435d68ff [nix] output vm packages for each host
this now runs any host as microvm. it removes shared directories for
microvms so no manuall setup is needed (expect you want persistence).
i took it from c3d2, thanks guys for the inspiration <3
https://gitea.c3d2.de/c3d2/nix-config/src/branch/master/packages.nix
2024-12-13 03:36:44 +01:00
b2f8b308cb [nixpkgs] update microvm 2024-12-13 03:36:41 +01:00
a292b01365 [microvms] fix #39 Microvms are not persistent 2024-12-13 03:36:17 +01:00
d6a615cc35 [nix] fix devshell 2024-12-13 03:36:17 +01:00
37a6a1dffb [doc] add basic microvm documentation 2024-12-13 03:36:17 +01:00
f853a47eb9 [docs] add vmWithDisko documentation 2024-12-13 03:36:17 +01:00
7dbbaf08af [fanny] setup disko drive layout 2024-12-13 03:36:17 +01:00
046c11234f [fanny] init 2024-12-13 03:36:17 +01:00
bcfba8daf5 [machines] switch PulseAudio to Pipewire
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 9m34s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 9m42s
2024-12-03 00:50:44 +01:00
2a97e2424f [lucia] rm deprecated boot.loader.raspberryPi
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 4m7s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 4m6s
needs to be fixed still according to https://github.com/NixOS/nixpkgs/pull/241534
2024-12-03 00:45:07 +01:00
533b496bde [machines] remove sound.enable = true; 2024-12-03 00:31:54 +01:00
27c402152f [nixpkgs] 24.05 -> 24.11
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m31s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 2m52s
2024-12-03 00:14:13 +01:00
551b07375b [docs] WIP add host creation using disko
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 6m16s
2024-12-03 00:08:42 +01:00
42f83603df [bakunin] ignore hardware conf till we generated proper one
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m29s
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 4m17s
2024-11-26 14:08:13 +01:00
c0207dad33 [nixpkgs] fix typo
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m50s
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m26s
2024-11-26 13:22:52 +01:00
f61ea6ce5c [bakunin] add disko device
Some checks failed
Evaluate Hydra Jobs / eval-hydra-jobs (push) Failing after 1m4s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Failing after 50s
2024-11-26 13:14:36 +01:00
cfdbb58663 [bakunin] init 2024-11-26 13:02:44 +01:00
b39a9398f0 [microvm] fix typo
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m25s
2024-11-26 12:58:45 +01:00
ad2edf017a [nixpkgs] update
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m36s
2024-11-23 12:54:59 +01:00
f922105b2f [durruti] disable ep3bs
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m48s
its not used yet anyways
2024-11-23 12:51:03 +01:00
e759346756 [durruti] disable autoupdate
microvms get updated by the host
2024-11-23 12:50:36 +01:00
e5e3433df0 [microvm] automatic update from master every 20mins
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m47s
2024-11-23 12:30:29 +01:00
c54d27bceb [microvm] update flake from master
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m55s
2024-11-21 16:40:56 +01:00
9a3135d339 [readme] rm durruti ip
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m57s
2024-11-21 16:19:03 +01:00
054076e683 Merge remote-tracking branch 'origin' into documentation
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m20s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m51s
2024-11-21 16:09:04 +01:00
d212728676 [microvm] differentiate between stable and unstable nixpkgs
Some checks failed
Evaluate Hydra Jobs / eval-hydra-jobs (push) Has been cancelled
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Failing after 14m32s
2024-11-21 16:07:42 +01:00
28bf68098c [microvm] Fix conditionals within module
finally i hope....
2024-11-21 16:07:42 +01:00
2961a96860 [microvm] mv mkIf down one layer 2024-11-21 16:07:42 +01:00
7d825731bd [docs] update microvm docu 2024-11-21 16:07:42 +01:00
3fe5b8da20 [microvm] separate enableHostBridge from deployHosts 2024-11-21 16:07:42 +01:00
1bafdec4ab [microvm] fix errors within module
still checking if list is empty does not work as expected -.-
2024-11-21 16:07:42 +01:00
7b1bce6dc8 [microvm] fix type 2024-11-21 16:07:42 +01:00
02c1e307ed [microvm] fix comparision 2024-11-21 16:07:42 +01:00
26cc4b245e [microvm] add microvm deployment option to host 2024-11-21 16:07:42 +01:00
d6d449d1d8 [doc] add basic microvm documentation 2024-11-21 16:07:42 +01:00
af881b8996 [docs] fix docs app exec format error 2024-11-21 16:07:42 +01:00
d2e97448f7 [microvm] differentiate between stable and unstable nixpkgs
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m47s
2024-11-21 15:59:00 +01:00
84fef37dc7 [microvm] Fix conditionals within module
finally i hope....
2024-11-21 15:59:00 +01:00
bdd13a204f [microvm] mv mkIf down one layer 2024-11-21 15:59:00 +01:00
d0ed65d13a [docs] update microvm docu 2024-11-21 15:59:00 +01:00
873a4f3831 [microvm] separate enableHostBridge from deployHosts 2024-11-21 15:59:00 +01:00
64dbe6bb84 [microvm] fix errors within module
still checking if list is empty does not work as expected -.-
2024-11-21 15:59:00 +01:00
ca8e0cffda [microvm] fix type 2024-11-21 15:59:00 +01:00
1dc140ad9f [microvm] fix comparision 2024-11-21 15:59:00 +01:00
3f4c7350c2 [microvm] add microvm deployment option to host 2024-11-21 15:59:00 +01:00
efffa450d4 [microvm] share read only nix store
this reduces build times drastically
2024-11-21 15:59:00 +01:00
dbdf817d79 [doc] add basic microvm documentation 2024-11-21 15:59:00 +01:00
2cdfe8c999 [docs] fix docs app exec format error 2024-11-21 15:59:00 +01:00
03f03e86e4 [microvm] put vm creation into function 2024-11-21 15:59:00 +01:00
1aeb1c2ab9 [microvm] rm duplicate option 2024-11-21 15:59:00 +01:00
d012f7cb5a [microvm] split module files 2024-11-21 15:59:00 +01:00
5498418d06 [microvm] setup network, allow adding bridge interface to host 2024-11-21 15:59:00 +01:00
ee7ee52c3f [durruti] make durruti microvm
Networking still needs to be done but the vm boots using ```nix run .\#nixosConfigurations.durruti.config.microvm.declaredRunner```
2024-11-21 15:59:00 +01:00
f91e515ce2 [nixpkgs] add microvm.nix 2024-11-21 15:59:00 +01:00
370d975dbb [durruti] add docs.malobeo.org to host_config
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 4m7s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 4m7s
2024-11-19 15:23:07 +01:00
048e0653a5 [durruti] serve docs on port 9000
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m45s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m35s
2024-11-19 15:17:28 +01:00
b9cddb0bae [microvm] share read only nix store
this reduces build times drastically
2024-11-19 15:10:13 +01:00
05087d9fa6 [durruti] WIP add documentation.nix 2024-11-19 14:11:54 +01:00
ahtlon
47d386d81a Fix docs about updating keys 2024-11-19 14:11:54 +01:00
ahtlon
3f469c09f0 Add documentation describing how to add keys to sops 2024-11-19 14:11:54 +01:00
65f9fda381 [sops] updatekeys for ahtlon 2024-11-19 14:11:54 +01:00
ahtlon
73e3742af5 Add atlan's sops and ssh pubkeys 2024-11-19 14:11:54 +01:00
a71061e24e Merge pull request 'Add atlan's sops and ssh pubkeys' (#27) from sops into master
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m51s
Reviewed-on: #27
2024-11-14 18:36:21 +01:00
ahtlon
b3d74f5f39 Fix docs about updating keys
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m5s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m33s
2024-11-14 18:31:36 +01:00
ahtlon
3cb8423485 Add documentation describing how to add keys to sops 2024-11-14 17:56:56 +01:00
88dad0193b [sops] updatekeys for ahtlon
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m14s
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 3m18s
2024-11-14 14:03:42 +01:00
ahtlon
2a66f7ae29 Add atlan's sops and ssh pubkeys
All checks were successful
Evaluate Hydra Jobs / eval-hydra-jobs (push) Successful in 2m52s
Evaluate Hydra Jobs / eval-hydra-jobs (pull_request) Successful in 3m1s
2024-11-13 20:58:58 +01:00
27 changed files with 970 additions and 301 deletions

View File

@@ -8,7 +8,7 @@ the file structure is based on this [blog post](https://samleathers.com/posts/20
#### durruti #### durruti
- nixos-container running on dedicated hetzner server - nixos-container running on dedicated hetzner server
- login via ```ssh -p 222 malobeo@5.9.153.217``` - login via ```ssh -p 222 malobeo@dynamicdiscord.de```
- if rebuild switch fails due to biglock do ```mount -o remount,rw /nix/var/nix/db``` - if rebuild switch fails due to biglock do ```mount -o remount,rw /nix/var/nix/db```
- currently is running tasklist in detached tmux session - currently is running tasklist in detached tmux session
- [x] make module with systemd service out of that - [x] make module with systemd service out of that

View File

@@ -12,6 +12,8 @@
- [musik](./projekte/musik.md) - [musik](./projekte/musik.md)
- [TODO](./todo.md) - [TODO](./todo.md)
- [How-to]() - [How-to]()
- [Create New Host](./anleitung/create.md)
- [Sops](./anleitung/sops.md)
- [Updates](./anleitung/updates.md) - [Updates](./anleitung/updates.md)
- [Rollbacks](./anleitung/rollback.md) - [Rollbacks](./anleitung/rollback.md)
- [MicroVM](./anleitung/microvm.md) - [MicroVM](./anleitung/microvm.md)

View File

@@ -0,0 +1,66 @@
# Create host with disko-install
How to use disko-install is described here: https://github.com/nix-community/disko/blob/master/docs/disko-install.md
---
Here are the exact steps to get bakunin running:
First create machines/hostname/configuration.nix
Add hosts nixosConfiguration in machines/configurations.nix
Boot nixos installer on the Machine.
``` bash
# establish network connection
wpa_passphrase "network" "password" > wpa.conf
wpa_supplicant -B -i wlp3s0 -c wpa.conf
ping 8.8.8.8
# if that works continue
# generate a base hardware config
nixos-generate-config --root /tmp/config --no-filesystems
# get the infra repo
nix-shell -p git
git clone https://git.dynamicdiscord.de/kalipso/infrastructure
cd infrastructure
# add the new generated hardware config (and import in hosts configuration.nix)
cp /tmp/config/etc/nixos/hardware-configuration.nix machines/bakunin/
# check which harddrive we want to install the system on
lsblk #choose harddrive, in this case /dev/sda
# run nixos-install on that harddrive
sudo nix --extra-experimental-features flakes --extra-experimental-features nix-command run 'github:nix-community/disko/latest#disko-install' -- --flake .#bakunin --disk main /dev/sda
# this failed with out of memory
# running again showed: no disk left on device
# it seems the usb stick i used for flashing is way to small
# it is only
# with a bigger one (more than 8 gig i guess) it should work
# instead the disko-install tool i try the old method - first partitioning using disko and then installing the system
# for that i needed to adjust ./machines/modules/disko/btrfs-laptop.nix and set the disk to "/dev/sda"
sudo nix --extra-experimental-features "flakes nix-command" run 'github:nix-community/disko/latest' -- --mode format --flake .#bakunin
# failed with no space left on device.
# problem is lots of data is written to the local /nix/store which is mounted on tmpfs in ram
# it seems that a workaround could be modifying the bootable stick to contain a swap partition to extend tmpfs storage
```
# Testing Disko
Testing disko partitioning is working quite well. Just run the following and check the datasets in the vm:
```bash
nix run -L .\#nixosConfigurations.fanny.config.system.build.vmWithDisko
```
Only problem is that encryption is not working, so it needs to be commented out. For testing host fanny the following parts in ```./machines/modules/disko/fanny.nix``` need to be commented out(for both pools!):
```nix
datasets = {
encrypted = {
options = {
encryption = "aes-256-gcm"; #THIS ONE
keyformat = "passphrase"; #THIS ONE
keylocation = "file:///tmp/root.key"; #THIS ONE
};
# use this to read the key during boot
postCreateHook = '' #THIS ONE
zfs set keylocation="prompt" "zroot/$name"; #THIS ONE
''; #THIS ONE
```

View File

@@ -12,16 +12,48 @@ Use durruti as orientation:
"10.0.0.5" is the IP assigned to its tap interface. "10.0.0.5" is the IP assigned to its tap interface.
### Testing MicroVMs locally ### Testing MicroVMs locally
MicroVMs can be built and run easily on your local host. MicroVMs can be built and run easily on your local host, but they are not persistent!
For durruti this is done by: For durruti for example this is done by:
``` bash ``` bash
sudo nix run .\#nixosConfigurations.durruti.config.microvm.declaredRunner nix run .\#durruti-vm
```
### Testing persistent microvms
In order to test persistent microvms locally we need to create them using the ```microvm``` command.
This is necessary to be able to mount persistent /etc and /var volumes on those hosts.
Do the following:
```bash
# go into our repo and start the default dev shell (or us direnv)
nix develop .#
# create a microvm on your host (on the example of durruti)
sudo microvm -c durruti -f git+file:///home/username/path/to/infrastructure/repo
# start the vm
sudo systemctl start microvm@durruti.serivce
# this may fail, if so we most probably need to create /var /etc manually, then restart
sudo mkdir /var/lib/microvms/durruti/{var, etc}
# now you can for example get the rsa host key from /var/lib/microvms/durruti/etc/ssh/
# alternatively u can run the vm in interactive mode (maybe stop the microvm@durruti.service first)
microvm -r durruti
# after u made changes to the microvm update and restart the vm
microvm -uR durruti
# deleting the vm again:
sudo systemctl stop microvm@durruti.service
sudo systemctl stop microvm-virtiofsd@durruti.service
sudo rm -rf /var/lib/microvms/durruti
``` ```
It seems to be necessary to run this as root so that the according tap interface can be created.
To be able to ping the VM or give Internet Access to the VM your host needs to be setup as described below.
### Host Setup ### Host Setup
#### Network Bridge
To provide network access to the VMs a bridge interface needs to be created on your host. To provide network access to the VMs a bridge interface needs to be created on your host.
For that: For that:
- Add the infrastructure flake as input to your hosts flake - Add the infrastructure flake as input to your hosts flake
@@ -37,3 +69,13 @@ networking.nat = {
externalInterface = "eth0"; #change to your interface name externalInterface = "eth0"; #change to your interface name
}; };
``` ```
#### Auto Deploy VMs
By default no MicroVMs will be initialized on the host - this should be done using the microvm commandline tool.
But since we want to always deploy certain VMs it can be configured using the ```malobeo.microvm.deployHosts``` option.
VMs configured using this option will be initialized and autostarted at boot.
Updating still needs to be done imperative, or by enabling autoupdates.nix
The following example would init and autostart durruti and gitea:
``` nix
malobeo.microvm.deployHosts = [ "durruti" "gitea" ];
```

25
doc/src/anleitung/sops.md Normal file
View File

@@ -0,0 +1,25 @@
# Sops
## How to add admin keys
- Git:
- Generate gpg key
- Add public key to `./machines/secrets/keys/users/`
- Write the fingerprint of the gpg key in `.sops.yaml` under `keys:` in the format `- &admin_$USER $FINGERPRINT`
- Age:
- Generate age key for Sops:
```
$ mkdir -p ~/.config/sops/age
$ age-keygen -o ~/.config/sops/age/keys.txt
```
or to convert an ssh ed25519 key to an age key
```
$ mkdir -p ~/.config/sops/age
$ nix-shell -p ssh-to-age --run "ssh-to-age -private-key -i ~/.ssh/id_ed25519 > ~/.config/sops/age/keys.txt"
```
- Get public key using `$ age-keygen -y ~/.config/sops/age/keys.txt`
- Write public key in `.sops.yaml` under `keys:` in the format `- &admin_$USER $PUBKEY`
- Write `- *admin_$USER` under the apropriate `key_grups:` of the secrets the user should have access to
- `cd machines/` and reencrypt existing secrets for the new key with `sops updatekeys $path/to/secrets.yaml`

113
flake.lock generated
View File

@@ -1,5 +1,26 @@
{ {
"nodes": { "nodes": {
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730135292,
"narHash": "sha256-CI27qHAbc3/tIe8sb37kiHNaeCqGxNimckCMj0lW5kg=",
"owner": "nix-community",
"repo": "disko",
"rev": "ab58501b2341bc5e0fc88f2f5983a679b075ddf5",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "latest",
"repo": "disko",
"type": "github"
}
},
"ep3-bs": { "ep3-bs": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -26,11 +47,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1731533236,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -46,16 +67,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726989464, "lastModified": 1733951536,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "narHash": "sha256-Zb5ZCa7Xj+0gy5XVXINTSr71fCfAv+IKtmIXNrykT54=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", "rev": "1318c3f3b068cdcea922fa7c1a0a1f0c96c22f5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05", "ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -88,11 +109,11 @@
"spectrum": "spectrum" "spectrum": "spectrum"
}, },
"locked": { "locked": {
"lastModified": 1731240174, "lastModified": 1734041466,
"narHash": "sha256-HYu+bPoV3UILhwc4Ar5iQ7aF+DuQWHXl4mljN6Bwq6A=", "narHash": "sha256-51bhaMe8BZuNAStUHvo07nDO72wmw8PAqkSYH4U31Yo=",
"owner": "astro", "owner": "astro",
"repo": "microvm.nix", "repo": "microvm.nix",
"rev": "dd89404e1885b8d7033106f3898eaef8db660cb2", "rev": "3910e65c3d92c82ea41ab295c66df4c0b4f9e7b3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -103,11 +124,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1729386149, "lastModified": 1733620091,
"narHash": "sha256-hUP9oxmnOmNnKcDOf5Y55HQ+NnoT0+bLWHLQWLLw9Ks=", "narHash": "sha256-5WoMeCkaXqTZwwCNLRzyLxEJn8ISwjx4cNqLgqKwg9s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "cce4521b6df014e79a7b7afc58c703ed683c916e", "rev": "f4dc9a6c02e5e14d91d158522f69f6ab4194eb5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -124,11 +145,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1729472750, "lastModified": 1733965598,
"narHash": "sha256-s93LPHi5BN7I2xSGNAFWiYb8WRsPvT1LE9ZjZBrpFlg=", "narHash": "sha256-0tlZU8xfQGPcBOdXZee7P3vJLyPjTrXw7WbIgXD34gM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "7c60ba4bc8d6aa2ba3e5b0f6ceb9fc07bc261565", "rev": "d162ffdf0a30f3d19e67df5091d6744ab8b9229f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -139,11 +160,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1730919458, "lastModified": 1733861262,
"narHash": "sha256-yMO0T0QJlmT/x4HEyvrCyigGrdYfIXX3e5gWqB64wLg=", "narHash": "sha256-+jjPup/ByS0LEVIrBbt7FnGugJgLeG9oc+ivFASYn2U=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "e1cc1f6483393634aee94514186d21a4871e78d7", "rev": "cf737e2eba82b603f54f71b10cb8fd09d22ce3f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -169,29 +190,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1730602179,
"narHash": "sha256-efgLzQAWSzJuCLiCaQUCDu4NudNlHdg2NzGLX5GYaEY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3c2f1c4ca372622cb2f9de8016c9a0b1cbd0f37c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1730785428, "lastModified": 1733759999,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", "rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -203,22 +208,23 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1730883749, "lastModified": 1733808091,
"narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=", "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dba414932936fde69f0606b4f1d87c5bc0003ede", "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko",
"ep3-bs": "ep3-bs", "ep3-bs": "ep3-bs",
"home-manager": "home-manager", "home-manager": "home-manager",
"mfsync": "mfsync", "mfsync": "mfsync",
@@ -236,15 +242,14 @@
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ]
"nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1731047660, "lastModified": 1733965552,
"narHash": "sha256-iyp51lPWEQz4c5VH9bVbAuBcFP4crETU2QJYh5V0NYA=", "narHash": "sha256-GZ4YtqkfyTjJFVCub5yAFWsHknG1nS/zfk7MuHht4Fs=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "60e1bce1999f126e3b16ef45f89f72f0c3f8d16f", "rev": "2d73fc6ac4eba4b9a83d3cb8275096fbb7ab4004",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -256,11 +261,11 @@
"spectrum": { "spectrum": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1729945407, "lastModified": 1733308308,
"narHash": "sha256-iGNMamNOAnVTETnIVqDWd6fl74J8fLEi1ejdZiNjEtY=", "narHash": "sha256-+RcbMAjSxV1wW5UpS9abIG1lFZC8bITPiFIKNnE7RLs=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "f1d94ee7029af18637dbd5fdf4749621533693fa", "rev": "80c9e9830d460c944c8f730065f18bb733bc7ee2",
"revCount": 764, "revCount": 792,
"type": "git", "type": "git",
"url": "https://spectrum-os.org/git/spectrum" "url": "https://spectrum-os.org/git/spectrum"
}, },
@@ -390,11 +395,11 @@
"systems": "systems_4" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1731533236,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -3,13 +3,15 @@
inputs = { inputs = {
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
mfsync.url = "github:k4lipso/mfsync"; mfsync.url = "github:k4lipso/mfsync";
microvm.url = "github:astro/microvm.nix"; microvm.url = "github:astro/microvm.nix";
microvm.inputs.nixpkgs.follows = "nixpkgs"; microvm.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs";
utils = { utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
@@ -31,7 +33,7 @@
}; };
home-manager= { home-manager= {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-24.11";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
}; };

View File

@@ -5,6 +5,7 @@
keys: keys:
- &admin_kalipso c4639370c41133a738f643a591ddbc4c3387f1fb - &admin_kalipso c4639370c41133a738f643a591ddbc4c3387f1fb
- &admin_kalipso_dsktp aef8d6c7e4761fc297cda833df13aebb1011b5d4 - &admin_kalipso_dsktp aef8d6c7e4761fc297cda833df13aebb1011b5d4
- &admin_atlan age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
- &machine_moderatio 3b7027ab1933c4c5e0eb935f8f9b3c058aa6d4c2 - &machine_moderatio 3b7027ab1933c4c5e0eb935f8f9b3c058aa6d4c2
- &machine_lucia 3474196f3adf27cfb70f8f56bcd52d1ed55033db - &machine_lucia 3474196f3adf27cfb70f8f56bcd52d1ed55033db
- &machine_durruti 4095412245b6efc14cf92ca25911def5a4218567 - &machine_durruti 4095412245b6efc14cf92ca25911def5a4218567
@@ -15,15 +16,21 @@ creation_rules:
- *admin_kalipso - *admin_kalipso
- *admin_kalipso_dsktp - *admin_kalipso_dsktp
- *machine_moderatio - *machine_moderatio
age:
- *admin_atlan
- path_regex: lucia/secrets.yaml$ - path_regex: lucia/secrets.yaml$
key_groups: key_groups:
- pgp: - pgp:
- *admin_kalipso - *admin_kalipso
- *admin_kalipso_dsktp - *admin_kalipso_dsktp
- *machine_lucia - *machine_lucia
age:
- *admin_atlan
- path_regex: durruti/secrets.yaml$ - path_regex: durruti/secrets.yaml$
key_groups: key_groups:
- pgp: - pgp:
- *admin_kalipso - *admin_kalipso
- *admin_kalipso_dsktp - *admin_kalipso_dsktp
- *machine_durruti - *machine_durruti
age:
- *admin_atlan

View File

@@ -0,0 +1,83 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
#./hardware-configuration.nix
../modules/xserver.nix
../modules/malobeo_user.nix
../modules/sshd.nix
../modules/minimal_tools.nix
../modules/autoupdate.nix
];
malobeo.autoUpdate = {
enable = true;
url = "https://hydra.dynamicdiscord.de";
project = "malobeo";
jobset = "infrastructure";
cacheurl = "https://cache.dynamicdiscord.de";
};
boot.loader.systemd-boot.enable = true;
hardware.sane.enable = true; #scanner support
nix.settings.experimental-features = [ "nix-command" "flakes" ];
users.users.malobeo = {
packages = with pkgs; [
firefox
thunderbird
telegram-desktop
tor-browser-bundle-bin
keepassxc
libreoffice
gimp
inkscape
okular
element-desktop
chromium
mpv
vlc
simple-scan
];
};
services.tor = {
enable = true;
client.enable = true;
};
services.printing.enable = true;
services.printing.drivers = [
(pkgs.writeTextDir "share/cups/model/brother5350.ppd" (builtins.readFile ../modules/BR5350_2_GPL.ppd))
pkgs.gutenprint
pkgs.gutenprintBin
pkgs.brlaser
pkgs.brgenml1lpr
pkgs.brgenml1cupswrapper
];
# needed for printing drivers
nixpkgs.config.allowUnfree = true;
services.acpid.enable = true;
networking.hostName = "bakunin";
networking.networkmanager.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
systemWide = true;
};
time.timeZone = "Europe/Berlin";
system.stateVersion = "23.05"; # Do.. Not.. Change..
}

View File

@@ -0,0 +1,49 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices = {
root = {
device = "/dev/disk/by-uuid/35ae4fa2-1076-42ae-a04c-1752126b2aaf";
preLVM = true;
allowDiscards = true;
};
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/fe34ee57-9397-4311-94f2-a4fc0a3ef09c";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/402B-2026";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b4a28946-dcc4-437d-a1b9-08d36f4b6b27"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -45,7 +45,32 @@ let
inputs.microvm.nixosModules.microvm inputs.microvm.nixosModules.microvm
{ {
microvm = { microvm = {
hypervisor = "qemu"; hypervisor = "cloud-hypervisor";
mem = 2560;
shares = [
{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "store";
proto = "virtiofs";
socket = "store.socket";
}
{
source = "/var/lib/microvms/${hostName}/etc";
mountPoint = "/etc";
tag = "etc";
proto = "virtiofs";
socket = "etc.socket";
}
{
source = "/var/lib/microvms/${hostName}/var";
mountPoint = "/var";
tag = "var";
proto = "virtiofs";
socket = "var.socket";
}
];
interfaces = [ interfaces = [
{ {
type = "tap"; type = "tap";
@@ -78,9 +103,31 @@ in
]; ];
}; };
bakunin = nixosSystem {
system = "x86_64-linux";
specialArgs.inputs = inputs;
modules = defaultModules ++ [
./bakunin/configuration.nix
inputs.disko.nixosModules.disko
./modules/disko/btrfs-laptop.nix
];
};
fanny = nixosSystem {
system = "x86_64-linux";
specialArgs.inputs = inputs;
modules = defaultModules ++ [
./fanny/configuration.nix
inputs.disko.nixosModules.disko
./modules/disko/fanny.nix
];
};
durruti = nixosSystem { durruti = nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs.inputs = inputs; specialArgs.inputs = inputs;
specialArgs.self = self;
modules = makeMicroVM "durruti" "10.0.0.5" [ modules = makeMicroVM "durruti" "10.0.0.5" [
./durruti/configuration.nix ./durruti/configuration.nix
]; ];
@@ -94,12 +141,4 @@ in
./lucia/hardware_configuration.nix ./lucia/hardware_configuration.nix
]; ];
}; };
gitea = nixosSystem {
system = "x86_64-linux";
specialArgs.inputs = inputs;
modules = makeMicroVM "gitea" "10.0.0.6" [
./gitea/configuration.nix
];
};
} }

View File

@@ -22,55 +22,16 @@ with lib;
imports = [ imports = [
inputs.ep3-bs.nixosModules.ep3-bs inputs.ep3-bs.nixosModules.ep3-bs
inputs.tasklist.nixosModules.malobeo-tasklist inputs.tasklist.nixosModules.malobeo-tasklist
./documentation.nix
../modules/malobeo_user.nix ../modules/malobeo_user.nix
../modules/sshd.nix ../modules/sshd.nix
../modules/minimal_tools.nix ../modules/minimal_tools.nix
../modules/autoupdate.nix
]; ];
malobeo.autoUpdate = {
enable = true;
url = "https://hydra.dynamicdiscord.de";
project = "malobeo";
jobset = "infrastructure";
cacheurl = "https://cache.dynamicdiscord.de";
};
services.malobeo-tasklist.enable = true; services.malobeo-tasklist.enable = true;
services.ep3-bs = {
enable = true;
in_production = true;
favicon = ./circle-a.png;
logo = ./malobeo.png;
mail = {
type = "smtp-tls";
address = "dynamicdiscorddresden@systemli.org";
host = "mail.systemli.org";
user = "dynamicdiscorddresden@systemli.org";
passwordFile = config.sops.secrets.ep3bsMail.path;
auth = "plain";
};
database = {
user = "malodbuser";
passwordFile = config.sops.secrets.ep3bsDb.path;
};
};
sops.secrets.ep3bsDb = {
owner = config.services.ep3-bs.user;
key = "ep3bsDb";
};
sops.secrets.ep3bsMail = {
owner = config.services.ep3-bs.user;
key = "ep3bsMail";
};
system.stateVersion = "22.11"; # Did you read the comment? system.stateVersion = "22.11"; # Did you read the comment?
} }

View File

@@ -0,0 +1,15 @@
{ config, self, ... }:
{
services.nginx = {
enable = true;
virtualHosts."_" = {
listen = [
{ addr = "0.0.0.0"; port = 9000; }
];
root = "${self.packages.x86_64-linux.docs}/share/doc";
};
};
networking.firewall.allowedTCPPorts = [ 9000 ];
}

View File

@@ -33,6 +33,12 @@ in
} }
]; ];
services.nginx.virtualHosts."docs.malobeo.org" = {
forceSSL = true;
enableACME= true;
locations."/".proxyPass = "http://${cfg.host_ip}:9000";
};
services.nginx.virtualHosts."tasklist.malobeo.org" = { services.nginx.virtualHosts."tasklist.malobeo.org" = {
forceSSL = true; forceSSL = true;
enableACME= true; enableACME= true;

View File

@@ -6,66 +6,75 @@ sops:
gcp_kms: [] gcp_kms: []
azure_kv: [] azure_kv: []
hc_vault: [] hc_vault: []
age: [] age:
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBkOTV0VC92aGo0ZFU1RE84
LzJxWUh0MzYrSWJZYldVMTdsMlJ6RkI2WURNCmFVT1ZtMitOSzYySW1RMkE5aDUw
bEI2Z3ZhbUdaM2R5eVpkYVlrZks3dW8KLS0tIHFEdWZ2UmREeFl2Q0d0c0lVTGxm
SnZxRUcyaUY0QnRtVmdnYW9acmxTWmMKfLb2wgBcQC0Ay34wBvTenZW1jVvDH7aV
45+5NzmkhIQRNkKWgRfpT9EQ9cRJz3l7ZYoVgJe8qBhwH64lBqUiqw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-06-26T10:07:26Z" lastmodified: "2024-06-26T10:07:26Z"
mac: ENC[AES256_GCM,data:TfN80Hffm+Lf/5Cz7T37bBxMgJCAnk2aBxxW1/lr89N2p3cckcSOGAKoLWNIsdOkqOjAs4kft0nQ+xyfdLehG1WPo6OlOwZhJexfUUcS7GJ0QGNEVntkehQiHGw9TIv08/WHRbjnKTOGHLn1vuJAIJmSyff0hncGR7nxcwghZUU=,iv:TfidjsiqDx4SCbtb6ksNYOSz/EwzwnYieeWOaBrvA7Y=,tag:e8Vaycv9bxrVBn2QjRyfSw==,type:str] mac: ENC[AES256_GCM,data:TfN80Hffm+Lf/5Cz7T37bBxMgJCAnk2aBxxW1/lr89N2p3cckcSOGAKoLWNIsdOkqOjAs4kft0nQ+xyfdLehG1WPo6OlOwZhJexfUUcS7GJ0QGNEVntkehQiHGw9TIv08/WHRbjnKTOGHLn1vuJAIJmSyff0hncGR7nxcwghZUU=,iv:TfidjsiqDx4SCbtb6ksNY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Rh4v
Yf9xpAd0/m4mmg+py041nas8lgJzOXn5mKIxX/kLkV1U/ccrZXB9DTsWbuRVxh3W M8L2LkiZp5w8iij+uJ+k0ovu4XH2Bf/2myhabfRrk5bPZbweH/bJOxChIgf/b/ZP
CZTzgT0VdZWd88cUcYIR0lgBz0vCxDRgyPhc3B3ivoOHBisoBWbYURv+6rYE84Qs FdfHGP0KlJe+jMGY3j7c0lgB9k2vyvYTHaAOcQoe/HdKNvueMMYDIzxLZ6sXsn+z
6nDtCt4fUqrfKqnw1b++L1II+QjEBkhawOWNbqE9AxESOLAVwkn4cCOqeWDP8DBq jhdW9FxM9g2ZOStq1Mwjzvb8rJCAFQH0s/3yHZY7rveaI88Z3G11i97D3OME2yAx
OBN3luBRDDAj bxCHPCFfvmX/
=+dua =3wBJ
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: c4639370c41133a738f643a591ddbc4c3387f1fb fp: c4639370c41133a738f643a591ddbc4c3387f1fb
- created_at: "2024-06-26T10:06:21Z" - created_at: "2024-11-14T13:03:00Z"
enc: |- enc: |-
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
hQIMA98TrrsQEbXUARAAmj8h6g8Knwg5c/Ugfxcb4nuWuLydyzNZpKJ9YcQ4VTAo hQIMA98TrrsQEbXUAQ//eBqaTG6/KiQFfEMog839q+nukWh3SHSnhCDyCAhdqKA3
HA38lHH79JbnIoZ9kvxHzUONBLfnW3KekomUdmj1a2DjWllnsIOH8/16JCpFPXbx Q9FSroIYEOMwE9SYkNC9T0/pf/ZmRuPBpx09b+q+1df4FLdajgpEbg1CyWnw7fyR
hcWQFLxXzJcUEbVfONih4Zmb/2OTzSYoDjNzGaBJUx6x3AwJ0jTzCTxF9WIU1ieh 731vYt5hvN7PVtBGs842BcEvYwKVG33HTadi53l+pjDURpHGLWLbURiqchGrXpPn
9u+ovry7bcHPTn3RS0gQPGRx9gN0A8OSPScKpvz2CRtUA2Uzs0/fIe3NbKQSj6g3 o6rih4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
08O8qM7cxHy5tGzTm6LQZvXTb8W6ybcPvPw695TirUjq9zYVnaT2lmQ= +x7rrZsnQq8UBpnd+dQCyxipQvwmjtp9N5xKcragt1LdH4M+Q/qoSIo=
=7OG0 =4vnh
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4 fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
- created_at: "2024-06-26T10:06:21Z" - created_at: "2024-11-14T13:03:00Z"
enc: |- enc: |-
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
hQIMA1kR3vWkIYVnAQ//RZM4ifHThNFNV6pTCGKHdkF7BMHB4gv7BBkXT9cWTGcf hQIMA1kR3vWkIYVnAQ//UfsG62+53p9PyXN+c6hoMg+MqWxjvia9kHvjE3Q3bcO+
XxH3tH/kFPBSoWWfmtmHbN1bw77vpKda2lLHyOETGCusOFwuFe0+cz7sWStnf/T6 KVYqD8CszyTwiTV0RoTWddyiZwZHKkH/ymTtnNafG6NVo3XrYpRmO7SxmVMm1BIt
GVoaCRljhRxlXS2PY9gSG5fLi1uUjmCn9EshdCQdz1ix46kgSe17I+UJYRxi9r4U HrBCdQkLDQOzqbeKBV9bGqO3xHKLEu0vwFkEdpWpNrjkKZfYQ8SjE/6vTJRPeBxx
e1R0ky4md8tLGGXg2cz1z48+kS7QX6TA1L5jjrW6MEa5ld2wywXD1g7UKpaP6QAc Z++g8540vZtB0V2YzKStJJ8LcsU+3j1/+NlUJZamXUGT4AnxH3atWuKqC39CZAU6
B5xo4G+6zZNYk6x5i0NJ4EJalyyEXBvJDgsFzW4luqBGjMU2zLkq5VTQjssCbp6l 0iHxKEcHcQYPAmvTqtxTH0ELIaRYBIRlzCs0MVjmmfVyaeJOZGyd32vikQMUCrf/
aE1ZZtMJYDa3IdEV/gEIF7/WmODMopO2hfTWFCx9fZ2cp0gK2d6ffo7vum4WkAMv EvThUCnq3+qCNjLlp1tQbLJV4B6ptAuj6uns2Z9Xmj1j4nFgUKvsc1MPnuSQsOnM
FjsbRLCmoZrlwD+/y38Hru2Ok/2cDF+QiEHq0cx+XMjgRrV6vCYrg67kOGjXZ+0v tLF0qsVvunvLbHXhb/Z4uDaNMst8jWEGhk52QYCZ6pgq1zoN63tOAxD+HK12KSYQ
eZMPGo5506cp/0cbo6eIoG9XzdNirp9mXQHMBb47/dETr+mBAyVzImuHJVmUgXlK emcDTjGqLTxe2dTiFMHlOkmTk/unEJXI1rJEalBaLqzDFg2tS6I1swQKG115wUfv
0nScCjrE2BPfsphMlQKMV007znA8QB65wEuoQ9QWTfgUfxVqzqJxdnFHKSSKAciU COHQtmbWmwIMtcl0q/QHfSyc+jPVHoadj6ZZFS1iL9Er/zx1nuD5ybkHntQdO0Gb
fxAJTGN2RnbBDcehvch+QZAnIHznz3c+2WKetmFMpymqL1OKQKjhnEFewOK8rXKM YwfyLzhFQ4gKgDiXwHdjYmHeDnXI9mrH3Cypcc/I8WV96cMnuKQBrD7V3NKpjFMS
cEFRo1BOMkaccBBFHt/A/IQJt2+RuADbkxI9rPqPU9iPi3Ts4jFqfNzZp+m+ADHS CaLMVDQqwMoGi+Xi8Ve5oRCa/qt5UEpL1CZZUxNNE11ggPYI22ecKjegdIlGuWHS
WAGHQuVbo0oQ5RLEOMPheNbr2eL+uyuMLMNsv41G4Mr+lSjN2/KvBoMQEQvpPasG WAE4FsZZNLt+RWZxIW0iTP0BzDuCMQFkismL0YyDI18g1dG/sl43+ecd6F9yoWYP
HDYyoe7JdYbVs+08h465+L+cbi0LzaBUxTm44GliJXVbrz6eqy6lRto= sXjR3gwbASdHHXeYFAxbPX3Q/XT+SQzOAFigPhD0LUFRX2Cf/Q2yu34=
=GiUe =FLuF
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: 4095412245b6efc14cf92ca25911def5a4218567 fp: 4095412245b6efc14cf92ca25911def5a4218567
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted

View File

@@ -0,0 +1,44 @@
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
#./hardware-configuration.nix
../modules/malobeo_user.nix
../modules/sshd.nix
../modules/minimal_tools.nix
../modules/autoupdate.nix
];
malobeo.autoUpdate = {
enable = true;
url = "https://hydra.dynamicdiscord.de";
project = "malobeo";
jobset = "infrastructure";
cacheurl = "https://cache.dynamicdiscord.de";
};
boot.loader.systemd-boot.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
services.tor = {
enable = true;
client.enable = true;
};
# needed for printing drivers
nixpkgs.config.allowUnfree = true;
services.acpid.enable = true;
networking.hostName = "fanny";
networking.hostId = "1312acab";
networking.networkmanager.enable = true;
virtualisation.vmVariant.virtualisation.graphics = false;
time.timeZone = "Europe/Berlin";
system.stateVersion = "23.05"; # Do.. Not.. Change..
}

View File

@@ -0,0 +1,49 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices = {
root = {
device = "/dev/disk/by-uuid/35ae4fa2-1076-42ae-a04c-1752126b2aaf";
preLVM = true;
allowDiscards = true;
};
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/fe34ee57-9397-4311-94f2-a4fc0a3ef09c";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/402B-2026";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/b4a28946-dcc4-437d-a1b9-08d36f4b6b27"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,37 +0,0 @@
{ config, lib, pkgs, inputs, ... }:
with lib;
{
#sops.defaultSopsFile = ./secrets.yaml;
networking = {
hostName = mkDefault "gitea";
useDHCP = false;
nameservers = [ "1.1.1.1" ];
};
imports = [
../modules/malobeo_user.nix
../modules/sshd.nix
../modules/minimal_tools.nix
../modules/autoupdate.nix
];
services.gitea = {
enable = true;
appName = "malobeo git instance";
settings.server = {
DOMAIN = "git.malobeo.org";
HTTP_PORT = 3001;
SSH_PORT = 22;
ROOT_URL = "https://git.malobeo.org/";
};
};
networking.firewall.allowedTCPPorts = [ 3001 ];
system.stateVersion = "22.11"; # Did you read the comment?
}

View File

@@ -67,17 +67,13 @@
networking.hostName = "louise"; networking.hostName = "louise";
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
sound.enable = true; security.rtkit.enable = true;
hardware.pulseaudio = { services.pipewire = {
enable = true;
zeroconf.discovery.enable = true;
extraConfig = ''
load-module module-zeroconf-discover
'';
};
services.avahi = {
enable = true; enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
systemWide = true;
}; };

View File

@@ -20,14 +20,6 @@ in
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default) # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
boot.loader.raspberryPi.enable = false;
boot.loader.raspberryPi.version = 3;
boot.loader.raspberryPi.uboot.enable = true;
boot.loader.raspberryPi.firmwareConfig = ''
dtparam=audio=on
hdmi_ignore_edid_audio=1
audio_pwm_mode=2
'';
# Enables the generation of /boot/extlinux/extlinux.conf # Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true; boot.loader.generic-extlinux-compatible.enable = true;
@@ -39,12 +31,8 @@ in
# Set your time zone. # Set your time zone.
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
# hardware audio support:
sound.enable = true;
services = { services = {
dokuwiki.sites."wiki.malobeo.org" = { dokuwiki.sites."wiki.malobeo.org" = {
enable = true; enable = true;
#acl = "* @ALL 8"; # everyone can edit using this config #acl = "* @ALL 8"; # everyone can edit using this config

View File

@@ -5,66 +5,75 @@ sops:
gcp_kms: [] gcp_kms: []
azure_kv: [] azure_kv: []
hc_vault: [] hc_vault: []
age: [] age:
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBGaVZQT1U3cXp4NHVSb2lh
RWRUcjlGY1RtNVNFT3dMSWFaZHJGcC8ybzFFClhhT2RPRHZwbWNSQzdSay8wc0h5
NHVUN082U0lhcWF2MnNTaXQ2Q0trRk0KLS0tIHJrNmdEdUI5YVRqck8vejRrVHZ4
aVFGZjk4UjVJa3FoMDJiaXR2MmdiQ2cKSVgIdxPBNTbNFQbdI5ECNGQrDUK9dQI3
f3mHj+XAPmEtjUXLyxUI1gQ+8toctnU6cgJ+HdGLX01lgTHwz7uieQ==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-10-24T15:09:51Z" lastmodified: "2023-10-24T15:09:51Z"
mac: ENC[AES256_GCM,data:f/wf0EuNmy+ic/k+fHg3IJ8p4I8BftFn6QwGJsXJgTBDspe7Plnwh+kGEqdPg8OEbWy/1niRfCXJa/vKoquWsxL7LUP2lGYT7lj7QYuj2F8fo2WIe2qhCikuxO6Q1asKyBcebYv5KAY/yQlVBYs9X9tcU6Fu4IU2AmJhjYB6m3s=,iv:K3DCEV4/FocdnEulNM9snH4uym8pAZRSmsYbM+rghe4=,tag:429oJE1du0IRl4aDuLzoZA==,type:str] mac: ENC[AES256_GCM,data:f/wf0EuNmy+ic/k+fHg3IJ8p4I8BftFn6QwGJsXJgTBDspe7Plnwh+kGEqdPg8OEbWy/1niRfCXJa/vKoquWsxL7LUP2lGYT7lj7QYuj2F8fo2WIe2qhCikuxO6Q1asKyBcebYv5KAY/yQlVBYs9X9tcU6Fu4IU2AmJhjYB6m3s=,iv:K3DCEV4/FocdnEulNM9snH4uym8pAZRSmsYbM+rghe4=,tag:429oJE1du0IRl4aDuLzoZA==,type:str]
pgp: pgp:
- created_at: "2023-10-24T14:42:18Z" - created_at: "2024-11-14T13:02:46Z"
enc: | enc: |-
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
hQGMA5HdvEwzh/H7AQwAqFy6FthlG4of1IYE42baCy6AHhnCxTKN5i0/ZYXtxz/T hQGMA5HdvEwzh/H7AQv/QepkThVCOMoRZRtHSHEjEriFfp9QS2ZrlgM0p67TtzU3
xWTAKEXPlbhT4AMGdIvIbEf7od4Pr7xxrxERkHVn1rkHxqjF+bjFw9J2xRXJvilw edAPqxNq8jGeW7/1FRAwIHGTit9FueL/GRUOVsepbryJMt4ndhybuPdpuEaKeQYv
L4pWMKXoJOiuGeNwJfzOVMx2yar6NiFmA3HvFyCASIQeCh3v+cyEDvbdnJoUyHRJ aZLw3XA5FB7maMKFOl59wqoWNrY+d02lXIbLEafUjrL94/p1IEqQd5a/Ze244yXI
/f/VnQFSIM4YXvLMqkKXgE0ZnbZc+vNnZkAG2qbz65fB/zdOPQZkVYCbnVKLwiBd V1ty93i6Wmu5N5uf67bfiY00ObAEU+L4QepLHuJvcP2lWU0zvxnPdDqwv+47R1xB
eoDth5WbuPnYbK5Vp9wkOPr6KqjM1KN+Kx/ErZ36Ldd2ePk11dCf9O4cE1HcCOmb aJX2G3Vv6QRnpUYL81a8R4E9u9GGH0TwJdaFqQwsVgW1XJdCsAaB5wriqEWX5HOJ
mdnFleX4hbMH2bFCpt7HoJql7QsTodx2bX1wnLA+uUVrV5QcT74C/0yAYHhBELez 513plEpkBSSlZo/9/lUSHK79jP92DfKvGMxw4t35UULzsJVbCIkM/TzBK0Ruq7Bf
cE0gZ+th9l2tOCaCBBMQUa8EfoQD3hEnOmebOMcWoUQdkyKk5SlLeCVsuWKvbidh 2rQO1nkF9lqXqPK7ORAkdXX3foHcM474f3w5nCSSlPia5jn7y58Npd9m1za4lOPF
3Vvw7jINCTH06jPCWSewSBuTdPiAPJ+4CQ8DWXC7A4luFvJM09HX8h859VDEHA9a rQxHCJ7OSJ6KOsXhDi7cmMfjIfn6cUj5wT685LbjrftYPh95R2lK/ViwfhMQkJb9
FCou1ZTWmQEHbDw1DPw70lgBv35pPduQjSfgM71YwgHFtHDdTfWTbzCBoaDfKvj2 lCUqJj/7N6UuSDdnHXKg0lgBV5k+ARqh904rR7GTpSdDuSVMVdy9mUGni5V6xTNn
XWSevuyOKiinaiYd4jPK6srFyX3Horg1QvVzl3dvNC3o29lrzETSTFoUx75KdluT 2IyJzWlvxbUumdh7SVBV5HRjG/sOcmlQtsw2fT21CCFg/n6AdCMgRbtYDoX5OOJc
WxGMHNWqN7NS qkz9uKEGrGjb
=XZkW =wPkW
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: c4639370c41133a738f643a591ddbc4c3387f1fb fp: c4639370c41133a738f643a591ddbc4c3387f1fb
- created_at: "2023-10-24T14:42:18Z" - created_at: "2024-11-14T13:02:46Z"
enc: | enc: |-
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
hQIMA98TrrsQEbXUAQ//XRoesGtcKw0RNs30FfKgpG/qNVRh4eJTeb1AP7YO9nKA hQIMA98TrrsQEbXUARAArYZZpOEC9sZ4Bgbtie8snwYjhcJiLxcmaODcx0ai24vC
WWuZnomu8aDDKiP+why4Cl4raSb2LqTaDAIbeTzw902BeOlIXl6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34mqRk6UTkVmw4sgy4bqcV26xSeMCbLAVBoV7dR8
DuXHOdzt9pn3DQHb3Z+kEd8p9TEykQrVr6mcW8scvW3iZ6XBbSoxUDY2W14gNMHS a35kyxrs2MIsu9/SuW8zSdfZd0sBhDIEgzQqT7fO1KQQCDJyjBTzjloVSoE4TSXS
WAFbpyIyM0JV36DifyFLFuPNF+ZFexnD1/2rzSw5dmDh8Pou9KZnoRGirXbOIFBf WAE7lEhifj43H/jshtyaIgM8UpdFmBtEj9BmsX2jeS5XiZsIbIJbCsmPWYdd4XQ0
MwFQRonyDxw8zcMFGhXRmNbfqOE9ImnvkW2pNjYJSuBW4LSGaG8OHx0= m5M8KCUEMDXeVCygKieefCyboUSNOk1gdRmnIRcqJ/r8fxmHqZgn2ko=
=2A7P =DC78
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4 fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
- created_at: "2023-10-24T14:42:18Z" - created_at: "2024-11-14T13:02:46Z"
enc: | enc: |-
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
hQIMA7zVLR7VUDPbAQ/+O/+BPNT3PxzN85kpL6xXfyCf337Ay5gwhJOg5k3JyEwO hQIMA7zVLR7VUDPbAQ//S/8UshLDL5DW0+DXMGL7u/ug/sgCbSM60PvzT3hwAvyL
2L1eZncGZHkdeExxgfqWF1yAPvE7vXltikTVp3V+htHoNL8kck8obII/HptVUCrU 3mR6CycERSeXuYM67fLIa66WiSFGB1aqEsI1oqPL6W8AwjtGHDKSPhJC8W+9NosB
VjFm41kEoWQ9DLXIhmppqBC0hWVkLjCDEXcD5HqtAxt2yKENSFr3pEnFl3vgoHTA OypoV6VppHiDxB2uJvQl7VNnT8d2x6IWdG0bq9NKxCg+6lorw8bky0907qQ/6+hg
2TpzC/l2kC24hzk+es54I0sCd3N1LEXC/mBUmptnsZfIcgGdVOWZSGabHg5Mo464 2eWI0wPcJR2z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4WesmGqmcJwJFaQW39Omu
wLzHshawAMmJ/bD/jT4wWD0w+NGDzSF8D4b/Ee0LP7R70noS61+s6xo= 8zLfZcfdVUuFKyIijXNliG0ryq1uxmWcEl8ePRzjAAzVTRAILNtZzVY=
=NnkE =8HBK
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
fp: 3474196f3adf27cfb70f8f56bcd52d1ed55033db fp: 3474196f3adf27cfb70f8f56bcd52d1ed55033db
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted

View File

@@ -0,0 +1,63 @@
{ config, self, inputs, ... }:
{
imports = [
inputs.disko.nixosModules.disko
];
# https://github.com/nix-community/disko/blob/master/example/luks-btrfs-subvolumes.nix
disko.devices = {
disk = {
main = {
type = "disk";
# When using disko-install, we will overwrite this value from the commandline
device = "/dev/disk/by-id/some-disk-id";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
passwordFile = /tmp/secret.key; # Interactive
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "20M";
};
};
};
};
};
};
};
};
};
};
}

View File

@@ -0,0 +1,141 @@
{
disko.devices = {
disk = {
ssd = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1024M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
hdd0 = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "storage";
};
};
};
};
};
hdd1 = {
type = "disk";
device = "/dev/sdc";
content = {
type = "gpt";
partitions = {
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "storage";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
mode = "";
# Workaround: cannot import 'zroot': I/O error in disko tests
options.cachefile = "none";
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
datasets = {
encrypted = {
type = "zfs_fs";
options = {
mountpoint = "none";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///tmp/root.key";
};
# use this to read the key during boot
postCreateHook = ''
zfs set keylocation="prompt" "zroot/$name";
'';
};
"encrypted/root" = {
type = "zfs_fs";
mountpoint = "/";
};
"encrypted/var" = {
type = "zfs_fs";
mountpoint = "/var";
};
"encrypted/etc" = {
type = "zfs_fs";
mountpoint = "/etc";
};
"encrypted/home" = {
type = "zfs_fs";
mountpoint = "/home";
};
"encrypted/nix" = {
type = "zfs_fs";
mountpoint = "/nix";
};
};
};
storage = {
type = "zpool";
mode = "mirror";
datasets = {
encrypted = {
type = "zfs_fs";
options = {
mountpoint = "none";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///tmp/storage.key";
};
# use this to read the key during boot
postCreateHook = ''
zfs set keylocation="prompt" "zroot/$name";
'';
};
"encrypted/data" = {
type = "zfs_fs";
mountpoint = "/data";
};
};
};
};
};
}

View File

@@ -1,4 +1,4 @@
{ config, lib, options, pkgs, ... }: { config, self, lib, inputs, options, pkgs, ... }:
with lib; with lib;
@@ -13,12 +13,39 @@ in
type = types.bool; type = types.bool;
description = lib.mdDoc "Setup bridge device for microvms."; description = lib.mdDoc "Setup bridge device for microvms.";
}; };
enableHostBridgeUnstable = mkOption {
default = false;
type = types.bool;
description = lib.mdDoc "Setup bridge device for microvms.";
};
deployHosts = mkOption {
default = [];
type = types.listOf types.str;
description = ''
List hostnames of MicroVMs that should be automatically initializes and autostart
'';
};
}; };
}; };
config = mkIf cfg.enableHostBridge
{ imports = [
systemd.network = { inputs.microvm.nixosModules.host
];
config = {
assertions = [
{
assertion = !(cfg.enableHostBridgeUnstable && cfg.enableHostBridge);
message = ''
Only enableHostBridge or enableHostBridgeUnstable! Not Both!
'';
}
];
systemd.network = mkIf (cfg.enableHostBridge || cfg.enableHostBridgeUnstable) {
enable = true; enable = true;
# create a bride device that all the microvms will be connected to # create a bride device that all the microvms will be connected to
netdevs."10-microvm".netdevConfig = { netdevs."10-microvm".netdevConfig = {
@@ -32,14 +59,11 @@ in
DHCPServer = true; DHCPServer = true;
IPv6SendRA = true; IPv6SendRA = true;
}; };
addresses = [ { addresses = if cfg.enableHostBridgeUnstable then [
Address = "10.0.0.1/24"; { Address = "10.0.0.1/24"; }
} { ] else [
Address = "fd12:3456:789a::1/64"; { addressConfig.Address = "10.0.0.1/24"; }
} ]; ];
ipv6Prefixes = [ {
Prefix = "fd12:3456:789a::/64";
} ];
}; };
# connect the vms to the bridge # connect the vms to the bridge
@@ -48,5 +72,48 @@ in
networkConfig.Bridge = "microvm"; networkConfig.Bridge = "microvm";
}; };
}; };
microvm.vms =
let
# Map the values to each hostname to then generate an Attrset using listToAttrs
mapperFunc = name: { inherit name; value = {
# Host build-time reference to where the MicroVM NixOS is defined
# under nixosConfigurations
flake = inputs.malobeo;
# Specify from where to let `microvm -u` update later on
updateFlake = "git+https://git.dynamicdiscord.de/kalipso/infrastructure";
}; };
in
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
systemd.services = builtins.foldl' (services: name: services // {
"microvm-update@${name}" = {
description = "Update MicroVMs automatically";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
unitConfig.ConditionPathExists = "/var/lib/microvms/${name}";
serviceConfig = {
LimitNOFILE = "1048576";
Type = "oneshot";
};
path = with pkgs; [ nix git ];
environment.HOME = config.users.users.root.home;
script = ''
/run/current-system/sw/bin/microvm -Ru ${name}
'';
};
}) {} (cfg.deployHosts);
systemd.timers = builtins.foldl' (timers: name: timers // {
"microvm-update-${name}" = {
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "microvm-update@${name}.service";
# three times per hour
OnCalendar = "*:0,20,40:00";
Persistent = true;
};
};
}) {} (cfg.deployHosts);
}; };
} }

View File

@@ -3,5 +3,6 @@
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCfDz5teTvRorVtpMj7i3pffD8W4Dn3Aiqre5L4WZq8Wc4bh2OjabGnIcDWpeToKf38n5m0d95OkIbARJwFN7KlbuQbmnIJ5n6pUj/zzRQ3dQTeSsUjkvdbSXVvTcDczMWwLixc/UKP1DMbiLHz5ZSywPTSH2l40lg74q7tSFGBwMy8uy4tsdp2d2sUIDfpvgGj3Pq+zkQHWyFR5BYyCLDfJMTQvGO0bEsbRIDOjkH8YVni46ds6sQKMgc+L2vPo8S3neFZBQRlERVRvIAzdLiBWqGkiw4YgWQA8ocTfWp9DVzW+BZiatc34+AX3KtLEF1Oz76YsKjBttSQL4myUucuskz2Bs7UYvAsDFlWyiJ43ayZNzvG63m1UVsAoq84IhNYsdkPhd+G1rtnG0KxPVAtn7RkAGt8t7ObU+6xWayHcpSteNeE+QyH9nNmJcXNNKfoOeP4vHUBrBTeURafw527yuZDOYknJmg3O+nkeGseIgBYgq/As4+dD6vhp03Y5chjU4/FC6nEjsGPRdfe2RZx+0cqJkLgdd1paGByUfPfaUKykw4TsCUAiDucRwBjU32MLslUbyzeEkjzOJzOD5Frif3jZZLxaNP2QcHRbTiiKkdn+WFJmjr3BdC60pm7hqvmDxl0UZcz9hDv3wZUALUc92TQXnWc8GicKdpQgRYDRQ== kalipso@c3d2.de" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCfDz5teTvRorVtpMj7i3pffD8W4Dn3Aiqre5L4WZq8Wc4bh2OjabGnIcDWpeToKf38n5m0d95OkIbARJwFN7KlbuQbmnIJ5n6pUj/zzRQ3dQTeSsUjkv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AAAINQg6a2EGmq+i9lfwU+SRMQ8MGN3is3VS6janzl9qOHo quaseb67@hzdr.de"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICKaEcGaSKU0xC5qCwzj2oCLLG4PYjWHZ7/CXHw4urVk atlan@nixos"
]; ];
} }

View File

@@ -4,6 +4,7 @@
, nixpkgs-unstable , nixpkgs-unstable
, nixos-generators , nixos-generators
, sops-nix , sops-nix
, microvm
, ... , ...
} @inputs: } @inputs:
@@ -15,8 +16,27 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
pkgs = nixpkgs.legacyPackages."${system}"; pkgs = nixpkgs.legacyPackages."${system}";
in in
{ {
devShells.default = pkgs.callPackage ./shell.nix { devShells.default =
inherit (sops-nix.packages."${pkgs.system}") sops-import-keys-hook ssh-to-pgp sops-init-gpg-key; let
sops = sops-nix.packages."${pkgs.system}";
microvmpkg = microvm.packages."${pkgs.system}";
in
pkgs.mkShell {
sopsPGPKeyDirs = [
"./machines/secrets/keys/hosts"
"./machines/secrets/keys/users"
];
nativeBuildInputs = [
sops.ssh-to-pgp
sops.sops-import-keys-hook
sops.sops-init-gpg-key
pkgs.sops
pkgs.age
pkgs.python310Packages.grip
pkgs.mdbook
microvmpkg.microvm
];
}; };
packages = { packages = {
@@ -36,7 +56,46 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
cp -r ./book/* $dest cp -r ./book/* $dest
''; '';
}; };
}; } //
builtins.foldl'
(result: host:
let
inherit (self.nixosConfigurations.${host}) config;
in
result // {
# boot any machine in a microvm
"${host}-vm" = (self.nixosConfigurations.${host}.extendModules {
modules = [{
microvm = {
mem = pkgs.lib.mkForce 4096;
hypervisor = pkgs.lib.mkForce "qemu";
socket = pkgs.lib.mkForce null;
shares = pkgs.lib.mkForce [{
tag = "ro-store";
source = "/nix/store";
mountPoint = "/nix/.ro-store";
}];
interfaces = pkgs.lib.mkForce [{
type = "user";
id = "eth0";
mac = "02:23:de:ad:be:ef";
}];
};
boot.isContainer = pkgs.lib.mkForce false;
users.users.root.password = "";
fileSystems."/".fsType = pkgs.lib.mkForce "tmpfs";
services.getty.helpLine = ''
Log in as "root" with an empty password.
Use "reboot" to shut qemu down.
'';
}] ++ pkgs.lib.optionals (! config ? microvm) [
microvm.nixosModules.microvm
];
}).config.microvm.declaredRunner;
})
{ }
(builtins.attrNames self.nixosConfigurations);
apps = { apps = {
docs = { docs = {
@@ -50,6 +109,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
})) // rec { })) // rec {
nixosConfigurations = import ./machines/configuration.nix (inputs // { nixosConfigurations = import ./machines/configuration.nix (inputs // {
inherit inputs; inherit inputs;
self = self;
}); });
nixosModules.malobeo.imports = [ nixosModules.malobeo.imports = [

View File

@@ -1,23 +0,0 @@
{ mkShell
, sops-import-keys-hook
, ssh-to-pgp
, sops-init-gpg-key
, sops
, pkgs
}:
mkShell {
sopsPGPKeyDirs = [
"./machines/secrets/keys/hosts"
"./machines/secrets/keys/users"
];
nativeBuildInputs = [
ssh-to-pgp
sops-import-keys-hook
sops-init-gpg-key
sops
pkgs.python310Packages.grip
pkgs.mdbook
];
}