Compare commits
13 Commits
issue77
...
b423efeaef
| Author | SHA1 | Date | |
|---|---|---|---|
| b423efeaef | |||
|
|
3bc74a3e80 | ||
| 251b0f0850 | |||
| 70fe179b5b | |||
| 2eec2ed980 | |||
|
|
d00188f770 | ||
|
|
556cc3d423 | ||
|
|
edc754ee7f | ||
|
|
ff673f0070 | ||
|
|
57c8e65917 | ||
|
|
e4be136b64 | ||
|
|
aedf5ca0bf | ||
|
|
923cbf4621 |
75
README.md
75
README.md
@@ -1,20 +1,44 @@
|
|||||||
# malobeo infrastructure
|
# malobeo infrastructure
|
||||||
|
|
||||||
this repository contains nixos configurations of the digital malobeo infrastructure. it should be used to setup, test, build and deploy different hosts in a reproducible manner.
|
this repository nxios configurations of the digital malobeo infrastructure. it should be used to setup, test, build and deploy different hosts in a reproducible manner.
|
||||||
|
|
||||||
|
the file structure is based on this [blog post](https://samleathers.com/posts/2022-02-03-my-new-network-and-deploy-rs.html)
|
||||||
|
|
||||||
|
## hosts
|
||||||
|
|
||||||
|
#### durruti
|
||||||
|
- nixos-container running on dedicated hetzner server
|
||||||
|
- login via ```ssh -p 222 malobeo@dynamicdiscord.de```
|
||||||
|
- if rebuild switch fails due to biglock do ```mount -o remount,rw /nix/var/nix/db```
|
||||||
|
- currently is running tasklist in detached tmux session
|
||||||
|
- [x] make module with systemd service out of that
|
||||||
|
|
||||||
|
## creating a new host
|
||||||
|
|
||||||
|
### setting up filesystem
|
||||||
|
currently nixos offers no declarative way of setting up filesystems and partitions. that means this has to be done manually for every new host. [to make it as easy as possible we can use this guide to setup an encrypted zfs filesystem](https://openzfs.github.io/openzfs-docs/Getting%20Started/NixOS/Root%20on%20ZFS.html)
|
||||||
|
|
||||||
|
*we could create a shell script out of that*
|
||||||
|
|
||||||
### deploying configuration
|
### deploying configuration
|
||||||
|
|
||||||
hosts are deployed automatically from master. The [hydra build server](https://hydra.dynamicdiscord.de/jobset/malobeo/infrastructure) will build new commits and on success, hosts will periodically pull those changes.
|
#### local deployment
|
||||||
Big changes (like updating flake lock) could be commited to the staging branch first. [Hydra builds staging seperate](https://hydra.dynamicdiscord.de/jobset/malobeo/staging), and on success you can merge into master.
|
``` shell
|
||||||
|
nixos-rebuild switch --use-remote-sudo
|
||||||
|
```
|
||||||
|
|
||||||
### deploy fresh host
|
#### remote deployment
|
||||||
if you want to deploy a completly new host refer to [docs](https://docs.malobeo.org/anleitung/create.html)
|
|
||||||
|
|
||||||
### testing configuration
|
you need the hostname and ip address of the host:
|
||||||
|
``` shell
|
||||||
|
nixos-rebuild switch --flake .#<hostname> --target-host root@<ip_address> --build-host localhost
|
||||||
|
```
|
||||||
|
|
||||||
|
in this case 'localhost' is used as buildhost which can be usefull if the target host is low systemresources
|
||||||
|
|
||||||
refer to https://docs.malobeo.org/anleitung/microvm.html#testing-microvms-locally
|
|
||||||
|
|
||||||
## development
|
## development
|
||||||
|
|
||||||
### requirements
|
### requirements
|
||||||
we use flake based configurations for our hosts. if you want to build configurations on you own machine you have to enable flakes first by adding the following to your *configuration.nix* or *nix.conf*
|
we use flake based configurations for our hosts. if you want to build configurations on you own machine you have to enable flakes first by adding the following to your *configuration.nix* or *nix.conf*
|
||||||
``` nix
|
``` nix
|
||||||
@@ -31,13 +55,46 @@ a development shell with the correct environment can be created by running ```ni
|
|||||||
If you're using direnv you can add flake support by following those steps: [link](https://nixos.wiki/wiki/Flakes#Direnv_integration)
|
If you're using direnv you can add flake support by following those steps: [link](https://nixos.wiki/wiki/Flakes#Direnv_integration)
|
||||||
|
|
||||||
### build a configuration
|
### build a configuration
|
||||||
|
|
||||||
to build a configuration run the following command (replace ```<hostname>``` with the actual hostname):
|
to build a configuration run the following command (replace ```<hostname>``` with the actual hostname):
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### building raspberry image
|
||||||
|
|
||||||
|
for the raspberry it is possible to build the whole configuration as an sd-card image which then can be flashed directly. more information about building arm on nixos can be found [here](https://nixos.wiki/wiki/NixOS_on_ARM).
|
||||||
|
|
||||||
|
to be able to build the image you need to enable qemu emulation on the machine you are building with. therefore it is necessary to add the following to your configuration.nix:
|
||||||
|
|
||||||
|
``` nix
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
```
|
||||||
|
|
||||||
|
then you can build the image with:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
nix build .#nixosConfigurations.rpi1_base_image.config.system.build.sdImage
|
||||||
|
```
|
||||||
|
|
||||||
|
### run a configuration as vm
|
||||||
|
|
||||||
|
to run a vm we have to build it first using the following command (replace ```<hostname>``` with the actual hostname):
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
nix build .#nixosConfigurations.<hostname>.config.system.build.vm
|
||||||
|
```
|
||||||
|
|
||||||
|
afterwards run the following command to start the vm:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
./result/bin/run-<hostname>-vm
|
||||||
|
```
|
||||||
|
|
||||||
### documentation
|
### documentation
|
||||||
|
|
||||||
documentation is automatically build from master and can be found here: docs.malobeo.org
|
for documentation we currently just use README.md files.
|
||||||
locally you can run documentation using ```nix run .#docs``` or ```nix run .#docsDev```
|
|
||||||
|
the devshell provides the python package ['grip'](https://github.com/joeyespo/grip) which can be used to preview different README.md files in the browser.
|
||||||
|
the usage is simple, just run ```grip``` in the same folder as the README.md you wanna preview. then open your browser at ```http://localhost:6419 ```.
|
||||||
|
|||||||
@@ -1,20 +1,26 @@
|
|||||||
# malobeo infrastructure
|
# malobeo infrastructure
|
||||||
|
|
||||||
this repository contains nixos configurations of the digital malobeo infrastructure. it should be used to setup, test, build and deploy different hosts in a reproducible manner.
|
this repository nxios configurations of the digital malobeo infrastructure. it should be used to setup, test, build and deploy different hosts in a reproducible manner.
|
||||||
|
|
||||||
|
the file structure is based on this [blog post](https://samleathers.com/posts/2022-02-03-my-new-network-and-deploy-rs.html)
|
||||||
|
|
||||||
### deploying configuration
|
### deploying configuration
|
||||||
|
#### local deployment
|
||||||
|
``` shell
|
||||||
|
nixos-rebuild switch --use-remote-sudo
|
||||||
|
```
|
||||||
|
|
||||||
hosts are deployed automatically from master. The [hydra build server](https://hydra.dynamicdiscord.de/jobset/malobeo/infrastructure) will build new commits and on success, hosts will periodically pull those changes.
|
#### remote deployment
|
||||||
Big changes (like updating flake lock) could be commited to the staging branch first. [Hydra builds staging seperate](https://hydra.dynamicdiscord.de/jobset/malobeo/staging), and on success you can merge into master.
|
you need the hostname and ip address of the host:
|
||||||
|
``` shell
|
||||||
|
nixos-rebuild switch --flake .#<hostname> --target-host root@<ip_address> --build-host localhost
|
||||||
|
```
|
||||||
|
|
||||||
### deploy fresh host
|
in this case 'localhost' is used as buildhost which can be usefull if the target host is low systemresources
|
||||||
if you want to deploy a completly new host refer to [docs](https://docs.malobeo.org/anleitung/create.html)
|
|
||||||
|
|
||||||
### testing configuration
|
|
||||||
|
|
||||||
refer to https://docs.malobeo.org/anleitung/microvm.html#testing-microvms-locally
|
|
||||||
|
|
||||||
## development
|
## development
|
||||||
|
|
||||||
### requirements
|
### requirements
|
||||||
we use flake based configurations for our hosts. if you want to build configurations on you own machine you have to enable flakes first by adding the following to your *configuration.nix* or *nix.conf*
|
we use flake based configurations for our hosts. if you want to build configurations on you own machine you have to enable flakes first by adding the following to your *configuration.nix* or *nix.conf*
|
||||||
``` nix
|
``` nix
|
||||||
@@ -31,13 +37,46 @@ a development shell with the correct environment can be created by running ```ni
|
|||||||
If you're using direnv you can add flake support by following those steps: [link](https://nixos.wiki/wiki/Flakes#Direnv_integration)
|
If you're using direnv you can add flake support by following those steps: [link](https://nixos.wiki/wiki/Flakes#Direnv_integration)
|
||||||
|
|
||||||
### build a configuration
|
### build a configuration
|
||||||
|
|
||||||
to build a configuration run the following command (replace ```<hostname>``` with the actual hostname):
|
to build a configuration run the following command (replace ```<hostname>``` with the actual hostname):
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### building raspberry image
|
||||||
|
|
||||||
|
for the raspberry it is possible to build the whole configuration as an sd-card image which then can be flashed directly. more information about building arm on nixos can be found [here](https://nixos.wiki/wiki/NixOS_on_ARM).
|
||||||
|
|
||||||
|
to be able to build the image you need to enable qemu emulation on the machine you are building with. therefore it is necessary to add the following to your configuration.nix:
|
||||||
|
|
||||||
|
``` nix
|
||||||
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
```
|
||||||
|
|
||||||
|
then you can build the image with:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
nix build .#nixosConfigurations.rpi1_base_image.config.system.build.sdImage
|
||||||
|
```
|
||||||
|
|
||||||
|
### run a configuration as vm
|
||||||
|
|
||||||
|
to run a vm we have to build it first using the following command (replace ```<hostname>``` with the actual hostname):
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
nix build .#nixosConfigurations.<hostname>.config.system.build.vm
|
||||||
|
```
|
||||||
|
|
||||||
|
afterwards run the following command to start the vm:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
./result/bin/run-<hostname>-vm
|
||||||
|
```
|
||||||
|
|
||||||
### documentation
|
### documentation
|
||||||
|
|
||||||
documentation is automatically build from master and can be found here: docs.malobeo.org
|
for documentation we currently just use README.md files.
|
||||||
locally you can run documentation using ```nix run .#docs``` or ```nix run .#docsDev```
|
|
||||||
|
the devshell provides the python package ['grip'](https://github.com/joeyespo/grip) which can be used to preview different README.md files in the browser.
|
||||||
|
the usage is simple, just run ```grip``` in the same folder as the README.md you wanna preview. then open your browser at ```http://localhost:6419 ```.
|
||||||
|
|||||||
30
flake.lock
generated
30
flake.lock
generated
@@ -109,11 +109,11 @@
|
|||||||
"spectrum": "spectrum"
|
"spectrum": "spectrum"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739104176,
|
"lastModified": 1736905611,
|
||||||
"narHash": "sha256-bNvtud2PUcbYM0i5Uq1v01Dcgq7RuhVKfjaSKkW2KRI=",
|
"narHash": "sha256-eW6SfZRaOnOybBzhvEzu3iRL8IhwE0ETxUpnkErlqkE=",
|
||||||
"owner": "astro",
|
"owner": "astro",
|
||||||
"repo": "microvm.nix",
|
"repo": "microvm.nix",
|
||||||
"rev": "d3a9b7504d420a1ffd7c83c1bb8fe57deaf939d2",
|
"rev": "a18d7ba1bb7fd4841191044ca7a7f895ef2adf3b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -160,11 +160,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1738816619,
|
"lastModified": 1736978406,
|
||||||
"narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=",
|
"narHash": "sha256-oMr3PVIQ8XPDI8/x6BHxsWEPBRU98Pam6KGVwUh8MPk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "2eccff41bab80839b1d25b303b53d339fbb07087",
|
"rev": "b678606690027913f3434dea3864e712b862dde5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -192,11 +192,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739020877,
|
"lastModified": 1737062831,
|
||||||
"narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=",
|
"narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a79cfe0ebd24952b580b1cf08cd906354996d547",
|
"rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -208,11 +208,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739206421,
|
"lastModified": 1736916166,
|
||||||
"narHash": "sha256-PwQASeL2cGVmrtQYlrBur0U20Xy07uSWVnFup2PHnDs=",
|
"narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "44534bc021b85c8d78e465021e21f33b856e2540",
|
"rev": "e24b4c09e963677b1beea49d411cd315a024ad3a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -245,11 +245,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739262228,
|
"lastModified": 1737107480,
|
||||||
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
|
"narHash": "sha256-GXUE9+FgxoZU8v0p6ilBJ8NH7k8nKmZjp/7dmMrCv3o=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
|
"rev": "4c4fb93f18b9072c6fa1986221f9a3d7bf1fe4b6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ keys:
|
|||||||
- &admin_atlan age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
- &admin_atlan age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
||||||
- &machine_moderatio 3b7027ab1933c4c5e0eb935f8f9b3c058aa6d4c2
|
- &machine_moderatio 3b7027ab1933c4c5e0eb935f8f9b3c058aa6d4c2
|
||||||
- &machine_lucia 3474196f3adf27cfb70f8f56bcd52d1ed55033db
|
- &machine_lucia 3474196f3adf27cfb70f8f56bcd52d1ed55033db
|
||||||
- &machine_durruti age1arwef7t65lz40lxhs5svyzentskjzam3e0e0yxen872vwy6v234s9uftvr
|
- &machine_durruti age1pd2kkscyh7fuvm49umz8lfhse4fpkmp5pa3gvnh4ranwxs4mz9nqdy7sda
|
||||||
- &machine_infradocs age15rqsygf7yfe6pv6t4c6c9jc6yk4vu5grmmcu7sexvqfw8763mf2q6qw50h
|
- &machine_infradocs age1decc74l6tm5sjtnjyj8rkxysr9j49fxsc92r2dcfpmzdcjv5dews8f03se
|
||||||
- &machine_overwatch age1075ep3sl5ztshnq4jrygxqqqfts9wzk4gvvtwfjcep5ke8nzqs5sxtw7vd
|
- &machine_overwatch age1psj6aeu03s2k4zdfcte89nj4fw95xgk4e7yr3e6k6u2evq84ng3s57p6f0
|
||||||
- &machine_vpn age1v6uxwej4nlrpfanr9js7x6059mtvyg4fw50pzt0a2kt3ahk7edlslafeuh
|
- &machine_vpn age1v6uxwej4nlrpfanr9js7x6059mtvyg4fw50pzt0a2kt3ahk7edlslafeuh
|
||||||
- &machine_fanny age136sz3lzhxf74ryruvq34d4tmmxnezkqkgu6zqa3dm582c22fgejqagrqxk
|
- &machine_fanny age1u6ljjefkyy242xxtpm65v8dl908efnpt4txjkh0c9emvagdv8etqt22wll
|
||||||
- &machine_nextcloud age19mn55pz5dgeghjg5cp7mymwax20jshmp8gwzuf2s3h5xlvzjksyqfscsqk
|
- &machine_nextcloud age1z0cfz7l4vakjrte220h46fc05503506fjcz440na92pzgztlspmqc8vt6k
|
||||||
#this dummy key is used for testing.
|
#this dummy key is used for testing.
|
||||||
- &machine_dummy age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
- &machine_dummy age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
||||||
creation_rules:
|
creation_rules:
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ in
|
|||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
#./hardware-configuration.nix
|
#./hardware-configuration.nix
|
||||||
../modules/xserver.nix
|
../modules/xserver.nix
|
||||||
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
|
../modules/minimal_tools.nix
|
||||||
../modules/autoupdate.nix
|
../modules/autoupdate.nix
|
||||||
inputs.self.nixosModules.malobeo.disko
|
inputs.self.nixosModules.malobeo.disko
|
||||||
inputs.self.nixosModules.malobeo.initssh
|
inputs.self.nixosModules.malobeo.initssh
|
||||||
inputs.self.nixosModules.malobeo.users
|
|
||||||
];
|
];
|
||||||
|
|
||||||
malobeo.autoUpdate = {
|
malobeo.autoUpdate = {
|
||||||
@@ -37,8 +38,6 @@ in
|
|||||||
ethernetDrivers = ["r8169"];
|
ethernetDrivers = ["r8169"];
|
||||||
};
|
};
|
||||||
|
|
||||||
malobeo.users.malobeo = true;
|
|
||||||
|
|
||||||
hardware.sane.enable = true; #scanner support
|
hardware.sane.enable = true; #scanner support
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ in
|
|||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
#./hardware-configuration.nix
|
#./hardware-configuration.nix
|
||||||
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
../modules/minimal_tools.nix
|
../modules/minimal_tools.nix
|
||||||
../modules/autoupdate.nix
|
../modules/autoupdate.nix
|
||||||
@@ -17,7 +18,6 @@ in
|
|||||||
inputs.self.nixosModules.malobeo.disko
|
inputs.self.nixosModules.malobeo.disko
|
||||||
inputs.self.nixosModules.malobeo.microvm
|
inputs.self.nixosModules.malobeo.microvm
|
||||||
inputs.self.nixosModules.malobeo.metrics
|
inputs.self.nixosModules.malobeo.metrics
|
||||||
inputs.self.nixosModules.malobeo.users
|
|
||||||
];
|
];
|
||||||
|
|
||||||
virtualisation.vmVariantWithDisko = {
|
virtualisation.vmVariantWithDisko = {
|
||||||
@@ -50,10 +50,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
malobeo.users = {
|
|
||||||
malobeo = true;
|
|
||||||
admin = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
malobeo.disks = {
|
malobeo.disks = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"data": "ENC[AES256_GCM,data:dsb1hdpeoH1Rc4Cz10cZMlAKL//GRUKQbTXvGuRcVqMtRVkmiVZonogj1FdpIFOY8m3zIuJKLpQp9i/RuWanRaThyOA4Mqo82N0MTkco0mwLfRhxqA2EbRv1dPgytVQvdNgSrnZI1FXtsQumPgO4KvifwaCG+Wu050NhPDC2Xt8i1U1TyMTkTigk2CKYaYgo+D9xSsA9ymjFUQgvnTn10t3di7cUJi3rBoEiZeOK/EAg1Y3h53AZ4p9SyG1kBflTvtE1NbIZNBYAiFkJNbIhT+Dw67Qv2Uso6oxL/I64IDOljMQz2874wZqpAL1w7W671KdlGtq0murjQ5Sg+g8RYseA1NVmTY7BCaGagNQuU6Ab0BSSdzIuDkH14BL1zGgprCqP0CE8WeWdUzCx5qud9emF24d+VvRKIiawTArSBe34VMnRq05OTKdmtwGZom7kbhD20c1/pwhytiJpzSE08iKy9cYGPGfirNJaxhT7z9XqSoECUg2XPI7Deh75PqoxM8pATLtOtOLp2cYSr2vSrqADMXzmR2M9ixEj,iv:RQH+e6ZADH2XMPqBeuHhMhHiksQg2iR4NUnYhD3pj7w=,tag:wJByTCrYf4cKxJaD2eTCMQ==,type:str]",
|
"data": "ENC[AES256_GCM,data:7JromtbrVy9ecNzz+uprYJk43wgWypEeMRpN/Pk4BGxxyUATyQwDRC+EyEwFju44vDLBzzpjZ8/gJJl4CeHJJahc50/n44IR8TmCC1DoKCbZ0KnUkHWijDAnW2hIvabonWoGGBusPJOC99VJ4OFNHJkneg0lPmDU812LGw6tQU34LOLd5CowPdD82yNWfmHCDTAwJU26pmmCntfecBQilLyYEXq0UncqkUuIlKLOLdRXwbFGxqu/POZyKEo5Er3dycnT69yanHRcKAEFlmfJ1lxXvbBG4s2bGOzaEXxkI2GjkHuCx7lPfvWAgbX6pS6UQvn7b7JuAojOjNqsnpaO0DBDeD8IfPimHa16TKubO1wcXaJLFRmw196oPnoVZBkd/aZU4XifSPFWAlS47/nIpeP5MRxmvp1WzHoWWtNinmGxxjGnzOVkn4FdbGeB0Af8OtI2PUFY4ghH92ugOWxgFZucLeJ3AjPkzodr4W38ej1F2rE5QVJdKZltQHm7V64KLh0L9OQ3WjWNa1Bf06uhYtIGLCJj/p9M6C2M,iv:Qlpz/Req6OBwjy7WiPyvdARFydZhiUIbwphpRlxuUdk=,tag:ARhK3X2TvdlStlVeUwgsYQ==,type:str]",
|
||||||
"sops": {
|
"sops": {
|
||||||
"kms": null,
|
"kms": null,
|
||||||
"gcp_kms": null,
|
"gcp_kms": null,
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzOS9jMmZoNWxrRTl6aVFu\nSW9oTTVkV3NiSGpDTDJNT3dmUWNmSURCYkZ3CnZJNFNEVTNWNEpvcS9NRjFTdExy\na0NNeTByblA3T0JFRXJacHlFTmRPcEEKLS0tIDJCa05LZHo2Rk9xek5Ec1hDODNQ\nOEs1Sk5YbTNHZGFtcmpqaDFKdzRpUVEKiUhTrGp4rXW3hHd8HueZ5v31CXpMACFT\nTq2OaVXUW7yTLFO2E405hQH2ZLS7KzkXeHmA4MZfbsq0ZkriXp956A==\n-----END AGE ENCRYPTED FILE-----\n"
|
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzOS9jMmZoNWxrRTl6aVFu\nSW9oTTVkV3NiSGpDTDJNT3dmUWNmSURCYkZ3CnZJNFNEVTNWNEpvcS9NRjFTdExy\na0NNeTByblA3T0JFRXJacHlFTmRPcEEKLS0tIDJCa05LZHo2Rk9xek5Ec1hDODNQ\nOEs1Sk5YbTNHZGFtcmpqaDFKdzRpUVEKiUhTrGp4rXW3hHd8HueZ5v31CXpMACFT\nTq2OaVXUW7yTLFO2E405hQH2ZLS7KzkXeHmA4MZfbsq0ZkriXp956A==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastmodified": "2025-02-25T16:42:28Z",
|
"lastmodified": "2025-02-22T18:08:12Z",
|
||||||
"mac": "ENC[AES256_GCM,data:iJS4wLJwJZRUozNBUBxL8wYOneGI1Et3r9+DtIs3JrQLEKV16n2SeRP0jRFyCO7VNkxyjnjXJwe0/GVbxtQbVCuDFaCWVpj4xNiEH3wMeuydU96E2QgHaWJGvhyj5e/5o3GO85DeF2ueFCa9DQKtTIWH1xPfqJwtZC2PGH5Uqyo=,iv:/TpULYHxSgFfMQyv715jLVY37AhSY/qh1Zn00UN8oOw=,tag:XrOn8ZpgWFYtSjatXn8sxA==,type:str]",
|
"mac": "ENC[AES256_GCM,data:cieSOz+0E1tFuRTgiIP9M84eV4bH5lgF4x2bwCGUTi3vG8FSlkk0+EVYjqDokLH7LnRysPO75YlZcuntvnUZYFVWPid/yjgCVR0qlfVbLx6ZUCW6GCNq5993Sa97mI6XjbiIO/yZE1lFqPhd+hev9koDqAGm/SbD9unqPzntBvM=,iv:+4xlcKGalNnR9PujjL54h2E3EnONXi+83g5bNAjFUSo=,tag:1O7lWZUPjPc6NtBqJ+nTxg==,type:str]",
|
||||||
"pgp": [
|
"pgp": [
|
||||||
{
|
{
|
||||||
"created_at": "2025-02-22T18:08:12Z",
|
"created_at": "2025-02-22T18:08:12Z",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOFRuQZweX3r9QQmAFo6oYY9zvrf9V3EIJOl6kFMgyLm kalipso@fanny-initrd
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOywBnc5vmhjQbkFZhiL0BAigcMWVSusrwazxgGwXl6C kalipso@celine
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"data": "ENC[AES256_GCM,data:16SwZ4RZ89+TvwPVgEg+96PmNd63Oai1GnrRipLkxQmzfeAkQvs78emYUEVT/ouAnRFQRNagbhjA4nmfTTq1xGz1u8bacjk1ny1ckd2FmkEOQ7Ry181h8UE61rZP3c8yra2WCgOcsL22oUxUMhg6iswJqEKLImi3cmJ+hASPTc6L3vlZLcP3Vx6FEbDMGrVtfpHEliSicB/rkAOnjVHmxHmVRjx1AI7jfAjCoBGnLwI9X2XREGay9H8Kt36HIhlXA9dK+xkl6WdtkllHIHe3OYHqwd730g+1htMAWtHmyI/DPLLJG48pzITnKv3cQ3aaziUWJGa89WGnBuzxP8ZOagpnC1/wQi1WTR7d/4JYoslz06fCt1ouGT4ttDFh/YqbV0hcXqkASbUnnixicBaYeVrwvSkYvlbwToZ6L+Jc+eqQRrTKXxs5pIZ4qkvImDp85v3U1bDxXT+qhpK9hasmgBqgM9GYjgw8Um/imr9HqDp9ztRsij87mRW/l47vUhxRjrAWpv+J0OlptUIpRiLv,iv:7x+dTHtSbcc47X/ZGz/bcnOxkGDDBu33ZgNrOD1FwDA=,tag:B6s1Jt1KFCitya9oAKvp9w==,type:str]",
|
"data": "ENC[AES256_GCM,data:hbYmYjGE+qWLnxB5H2K0MMuvhfmNGawcQm4z42YDHIcO24ZW+PlsEDaTQOxS1gGHvz7AKyL8swVRuf1IQhv0dQLp9nh1+idl0aFgOiky7MS7plchcyu41iZZOq6ScYO8nlTtDyjIMsi5WCflJbF7K+GDAPS6V2jn04760EuXg8wz//+WVKBDNBb9JRbW7nZIUeoLYY8bPhz0/754KBUoxscmthTUrt2C9VQAUCP3D6m7ug828d2XOX/oqbgwfvNu2rEWAlsTZ6DX+wuQGKZFLzwSMvE7YaE/fjxIjaYAXrwciGrDYI9WZn/oEdTAodUAeY9fMWHTogH7mwYHKtSg6pAqEL5kM+5Ssr8wzuit7AmGtq7x8l4ExTCodg+Y47tA++Rhnvf+bJRRUEPY1kNHzECNepSK/anHzPX0iisUxxmBn8yiJlBtiAbF06nuW0/yW/dRE6wLR+Y84JqiDcYK2WKy5q7W+Miw7m3TwJge/mDeezSiNqzROl5gtT58hvGixuYie+M93wO9M7h7EvJWHkN+kl+kcANBcMzF,iv:giFXavSHQsKhN2mES4Ud/wleYLIIELcvH08pCp+vEHw=,tag:xGkXW+0dzci6koXkujCQpw==,type:str]",
|
||||||
"sops": {
|
"sops": {
|
||||||
"kms": null,
|
"kms": null,
|
||||||
"gcp_kms": null,
|
"gcp_kms": null,
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIYlgxeXQzNmtEZXZXNytp\nTnRTRi9nRHJ2bEdPVGhPMzdMY1lPOUpGckFFCkJkL3BVSWlIZ1dBVUliemFWNXl4\ndU9DamhTRUp0aGVwamhWUUZJd3dUREkKLS0tIFNkaGNzc1R5aGxxZWV2QytaRFIw\ndC81MDR5SUlESnNQRlhuR3doTWhYL28KMIMs9mPwVuFr5cEvO6goqf3zQALSO5BB\nrY0C8TfkHLvV57999U9kfyLO7Sm0R/RGS4IinQSCRQWEeR+qLxnEWQ==\n-----END AGE ENCRYPTED FILE-----\n"
|
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIYlgxeXQzNmtEZXZXNytp\nTnRTRi9nRHJ2bEdPVGhPMzdMY1lPOUpGckFFCkJkL3BVSWlIZ1dBVUliemFWNXl4\ndU9DamhTRUp0aGVwamhWUUZJd3dUREkKLS0tIFNkaGNzc1R5aGxxZWV2QytaRFIw\ndC81MDR5SUlESnNQRlhuR3doTWhYL28KMIMs9mPwVuFr5cEvO6goqf3zQALSO5BB\nrY0C8TfkHLvV57999U9kfyLO7Sm0R/RGS4IinQSCRQWEeR+qLxnEWQ==\n-----END AGE ENCRYPTED FILE-----\n"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastmodified": "2025-02-25T16:43:40Z",
|
"lastmodified": "2025-02-22T18:08:12Z",
|
||||||
"mac": "ENC[AES256_GCM,data:dZJc0aqSD7dhe4Egih3z8QHIbwYDCGYU0DaOczkqHd/yMdcVNrNrcIR6yshArqCLl9jj5Zw3fIO75X09mvuvUCyszbjQyzSmTACp7K3skHuDRJ/yh5vaw6XNeJ3w26Dimfd0WfL1XC519DW532icrDiy2lCZ1qdcYwpqQUBKM/Q=,iv:4vx48jXxKLDOKfK6yYJWW28UaKl+EyqjeRAzV0WayEk=,tag:oO4cAVAv7N5aDAmK5V84mw==,type:str]",
|
"mac": "ENC[AES256_GCM,data:+dXI8Hm1FDsB9bD2jli+YpWmcY9j85ezNnNYrQmCRNuPUp1EqAQ1PuXkgTabzImqq8N6f4DMUAnL9+kVM2Fr0SMk3O4N6DbMTIkIBh2jos543DUR4tcE+KCeU4+tqzghArODeRtOzV1jDW6sW89pUfGpSZ2JTRfz+QcybySWQXY=,iv:1jzlnQrUDoENp6+nlsxdDsdeeYg+J03KAm7lRw1bi64=,tag:3QvMHCGTZJdHv0r/eX/JQQ==,type:str]",
|
||||||
"pgp": [
|
"pgp": [
|
||||||
{
|
{
|
||||||
"created_at": "2025-02-22T18:08:12Z",
|
"created_at": "2025-02-22T18:08:12Z",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHqp2/YiiIhai7wyScGZJ20gtrzY+lp4N/8unyRs4qhc root@fanny
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEvdnpvwSD1EEStciMitKahPlysD4L95bcwOuY4wV/6I kalipso@celine
|
||||||
|
|||||||
@@ -105,135 +105,135 @@ rec {
|
|||||||
inputsMod = inputs // { malobeo = self; };
|
inputsMod = inputs // { malobeo = self; };
|
||||||
|
|
||||||
|
|
||||||
vmMicroVMOverwrites = hostname: options: {
|
vmMicroVMOverwrites = hostname: options: {
|
||||||
microvm = rec {
|
microvm = rec {
|
||||||
mem = pkgs.lib.mkForce 4096;
|
mem = pkgs.lib.mkForce 4096;
|
||||||
hypervisor = pkgs.lib.mkForce "qemu";
|
hypervisor = pkgs.lib.mkForce "qemu";
|
||||||
socket = pkgs.lib.mkForce null;
|
socket = pkgs.lib.mkForce null;
|
||||||
|
|
||||||
|
|
||||||
#needed for hosts that deploy imperative microvms (for example fanny)
|
#needed for hosts that deploy imperative microvms (for example fanny)
|
||||||
writableStoreOverlay = pkgs.lib.mkIf options.writableStore "/nix/.rw-store";
|
writableStoreOverlay = pkgs.lib.mkIf options.writableStore "/nix/.rw-store";
|
||||||
volumes = pkgs.lib.mkIf options.writableStore [ {
|
volumes = pkgs.lib.mkIf options.writableStore [ {
|
||||||
image = "nix-store-overlay.img";
|
image = "nix-store-overlay.img";
|
||||||
mountPoint = writableStoreOverlay;
|
mountPoint = writableStoreOverlay;
|
||||||
size = 2048;
|
size = 2048;
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
shares = pkgs.lib.mkForce (pkgs.lib.optionals (!options.writableStore) [
|
shares = pkgs.lib.mkForce (pkgs.lib.optionals (!options.writableStore) [
|
||||||
{
|
{
|
||||||
tag = "ro-store";
|
tag = "ro-store";
|
||||||
source = "/nix/store";
|
source = "/nix/store";
|
||||||
mountPoint = "/nix/.ro-store";
|
mountPoint = "/nix/.ro-store";
|
||||||
}
|
}
|
||||||
] ++ pkgs.lib.optionals (options.varPath != "") [
|
] ++ pkgs.lib.optionals (options.varPath != "") [
|
||||||
{
|
{
|
||||||
source = "${options.varPath}";
|
source = "${options.varPath}";
|
||||||
securityModel = "mapped";
|
securityModel = "mapped";
|
||||||
mountPoint = "/var";
|
mountPoint = "/var";
|
||||||
tag = "var";
|
tag = "var";
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
interfaces = pkgs.lib.mkIf (!options.withNetworking) (pkgs.lib.mkForce [{
|
interfaces = pkgs.lib.mkIf (!options.withNetworking) (pkgs.lib.mkForce [{
|
||||||
type = "user";
|
type = "user";
|
||||||
id = "eth0";
|
id = "eth0";
|
||||||
mac = "02:23:de:ad:be:ef";
|
mac = "02:23:de:ad:be:ef";
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
#if networking is disabled forward port 80 to still have access to webservices
|
#if networking is disabled forward port 80 to still have access to webservices
|
||||||
forwardPorts = pkgs.lib.mkIf (!options.withNetworking && options.fwdPort != 0) (pkgs.lib.mkForce [
|
forwardPorts = pkgs.lib.mkIf (!options.withNetworking && options.fwdPort != 0) (pkgs.lib.mkForce [
|
||||||
{ from = "host"; host.port = options.fwdPort; guest.port = 80; }
|
{ from = "host"; host.port = options.fwdPort; guest.port = 80; }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems = {
|
|
||||||
"/".fsType = pkgs.lib.mkForce "tmpfs";
|
|
||||||
|
|
||||||
# prometheus uses a memory mapped file which doesnt seem supported by 9p shares
|
|
||||||
# therefore we mount a tmpfs inside the datadir
|
|
||||||
"/var/lib/prometheus2/data" = pkgs.lib.mkIf (hostname == "overwatch" && options.varPath != "") (pkgs.lib.mkForce {
|
|
||||||
fsType = pkgs.lib.mkForce "tmpfs";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.isContainer = pkgs.lib.mkForce false;
|
|
||||||
services.timesyncd.enable = false;
|
|
||||||
users.users.root.password = "";
|
|
||||||
services.getty.helpLine = ''
|
|
||||||
Log in as "root" with an empty password.
|
|
||||||
Use "reboot" to shut qemu down.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
vmDiskoOverwrites = {
|
|
||||||
boot.initrd = {
|
|
||||||
secrets = pkgs.lib.mkForce {};
|
|
||||||
network.ssh.enable = pkgs.lib.mkForce false;
|
|
||||||
};
|
|
||||||
|
|
||||||
malobeo.disks.enable = pkgs.lib.mkForce false;
|
|
||||||
networking.hostId = "a3c3101f";
|
|
||||||
};
|
|
||||||
|
|
||||||
vmSopsOverwrites = host: {
|
|
||||||
sops.defaultSopsFile = pkgs.lib.mkForce ../${host}/dummy.yaml;
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
devHostKey = {
|
|
||||||
source = ../secrets/devkey_ed25519;
|
|
||||||
mode = "0600";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/".fsType = pkgs.lib.mkForce "tmpfs";
|
||||||
|
|
||||||
|
# prometheus uses a memory mapped file which doesnt seem supported by 9p shares
|
||||||
|
# therefore we mount a tmpfs inside the datadir
|
||||||
|
"/var/lib/prometheus2/data" = pkgs.lib.mkIf (hostname == "overwatch" && options.varPath != "") (pkgs.lib.mkForce {
|
||||||
|
fsType = pkgs.lib.mkForce "tmpfs";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.isContainer = pkgs.lib.mkForce false;
|
||||||
|
services.timesyncd.enable = false;
|
||||||
|
users.users.root.password = "";
|
||||||
|
services.getty.helpLine = ''
|
||||||
|
Log in as "root" with an empty password.
|
||||||
|
Use "reboot" to shut qemu down.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.hostKeys = [{
|
vmDiskoOverwrites = {
|
||||||
path = "/etc/devHostKey";
|
boot.initrd = {
|
||||||
type = "ed25519";
|
secrets = pkgs.lib.mkForce {};
|
||||||
}];
|
network.ssh.enable = pkgs.lib.mkForce false;
|
||||||
};
|
};
|
||||||
|
|
||||||
vmNestedMicroVMOverwrites = host: sopsDummy: {
|
malobeo.disks.enable = pkgs.lib.mkForce false;
|
||||||
|
networking.hostId = "a3c3101f";
|
||||||
|
};
|
||||||
|
|
||||||
services.malobeo.microvm.deployHosts = pkgs.lib.mkForce [];
|
vmSopsOverwrites = host: {
|
||||||
microvm.vms =
|
sops.defaultSopsFile = pkgs.lib.mkForce ../${host}/dummy.yaml;
|
||||||
let
|
|
||||||
# Map the values to each hostname to then generate an Attrset using listToAttrs
|
environment.etc = {
|
||||||
mapperFunc = name: { inherit name; value = {
|
devHostKey = {
|
||||||
specialArgs.inputs = inputsMod;
|
source = ../secrets/devkey_ed25519;
|
||||||
specialArgs.self = self;
|
mode = "0600";
|
||||||
config = {
|
|
||||||
imports = (makeMicroVM "${name}"
|
|
||||||
"${hosts.malobeo.hosts.${name}.network.address}"
|
|
||||||
"${hosts.malobeo.hosts.${name}.network.mac}" [
|
|
||||||
../${name}/configuration.nix
|
|
||||||
(vmMicroVMOverwrites name {
|
|
||||||
withNetworking = true;
|
|
||||||
varPath = "";
|
|
||||||
writableStore = false; })
|
|
||||||
(if sopsDummy then (vmSopsOverwrites name) else {})
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
}; };
|
};
|
||||||
in
|
|
||||||
builtins.listToAttrs (map mapperFunc self.nixosConfigurations.${host}.config.services.malobeo.microvm.deployHosts);
|
|
||||||
};
|
|
||||||
|
|
||||||
buildVM = host: networking: sopsDummy: disableDisko: varPath: writableStore: fwdPort: (self.nixosConfigurations.${host}.extendModules {
|
services.openssh.hostKeys = [{
|
||||||
modules = [
|
path = "/etc/devHostKey";
|
||||||
(vmMicroVMOverwrites host {
|
type = "ed25519";
|
||||||
withNetworking = networking;
|
}];
|
||||||
varPath = "${varPath}";
|
};
|
||||||
writableStore = writableStore;
|
|
||||||
fwdPort = fwdPort; })
|
vmNestedMicroVMOverwrites = host: sopsDummy: {
|
||||||
(if sopsDummy then (vmSopsOverwrites host) else {})
|
|
||||||
(if disableDisko then vmDiskoOverwrites else {})
|
services.malobeo.microvm.deployHosts = pkgs.lib.mkForce [];
|
||||||
] ++ pkgs.lib.optionals (hosts.malobeo.hosts.${host}.type != "microvm") [
|
microvm.vms =
|
||||||
inputs.microvm.nixosModules.microvm
|
let
|
||||||
] ++ pkgs.lib.optionals (self.nixosConfigurations.${host}.config ? services.malobeo.microvm.deployHosts) [
|
# Map the values to each hostname to then generate an Attrset using listToAttrs
|
||||||
(vmNestedMicroVMOverwrites host sopsDummy)
|
mapperFunc = name: { inherit name; value = {
|
||||||
];
|
specialArgs.inputs = inputsMod;
|
||||||
});
|
specialArgs.self = self;
|
||||||
|
config = {
|
||||||
|
imports = (makeMicroVM "${name}"
|
||||||
|
"${hosts.malobeo.hosts.${name}.network.address}"
|
||||||
|
"${hosts.malobeo.hosts.${name}.network.mac}" [
|
||||||
|
../${name}/configuration.nix
|
||||||
|
(vmMicroVMOverwrites name {
|
||||||
|
withNetworking = true;
|
||||||
|
varPath = "";
|
||||||
|
writableStore = false; })
|
||||||
|
(if sopsDummy then (vmSopsOverwrites name) else {})
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
}; };
|
||||||
|
in
|
||||||
|
builtins.listToAttrs (map mapperFunc self.nixosConfigurations.${host}.config.services.malobeo.microvm.deployHosts);
|
||||||
|
};
|
||||||
|
|
||||||
|
buildVM = host: networking: sopsDummy: disableDisko: varPath: writableStore: fwdPort: (self.nixosConfigurations.${host}.extendModules {
|
||||||
|
modules = [
|
||||||
|
(vmMicroVMOverwrites host {
|
||||||
|
withNetworking = networking;
|
||||||
|
varPath = "${varPath}";
|
||||||
|
writableStore = writableStore;
|
||||||
|
fwdPort = fwdPort; })
|
||||||
|
(if sopsDummy then (vmSopsOverwrites host) else {})
|
||||||
|
(if disableDisko then vmDiskoOverwrites else {})
|
||||||
|
] ++ pkgs.lib.optionals (hosts.malobeo.hosts.${host}.type != "microvm") [
|
||||||
|
inputs.microvm.nixosModules.microvm
|
||||||
|
] ++ pkgs.lib.optionals (self.nixosConfigurations.${host}.config ? services.malobeo.microvm.deployHosts) [
|
||||||
|
(vmNestedMicroVMOverwrites host sopsDummy)
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
buildHost = hosts: (builtins.mapAttrs (host: settings: nixosSystem {
|
buildHost = hosts: (builtins.mapAttrs (host: settings: nixosSystem {
|
||||||
system = if (settings.type == "rpi") then "aarch64-linux" else "x86_64-linux";
|
system = if (settings.type == "rpi") then "aarch64-linux" else "x86_64-linux";
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
{config, lib, pkgs, inputs, ...}:
|
|
||||||
let
|
|
||||||
cfg = config.malobeo.users;
|
|
||||||
sshKeys = import ( inputs.self + /machines/ssh_keys.nix);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.malobeo.users = {
|
|
||||||
malobeo = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "enable malobeo user, defaults to on";
|
|
||||||
};
|
|
||||||
admin = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = "enable admin user, defaults to on to prevent lockouts";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = lib.mkMerge [
|
|
||||||
(lib.mkIf cfg.malobeo {
|
|
||||||
users.users.malobeo = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "malobeo user, password and ssh access, no root";
|
|
||||||
extraGroups = [ "pipewire" "pulse-access" "scanner" "lp" ];
|
|
||||||
openssh.authorizedKeys.keys = sshKeys.admins;
|
|
||||||
hashedPassword = "$y$j9T$39oJwpbFDeETiyi9TjZ/2.$olUdnIIABp5TQSOzoysuEsomn2XPyzwVlM91ZsEkIz1";
|
|
||||||
};
|
|
||||||
environment.systemPackages = with pkgs; [];
|
|
||||||
})
|
|
||||||
(lib.mkIf cfg.admin {
|
|
||||||
users.users.admin = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "admin user, passwordless sudo access, only ssh";
|
|
||||||
hashedPassword = null;
|
|
||||||
extraGroups = [ "networkmanager" ];
|
|
||||||
};
|
|
||||||
environment.systemPackages = with pkgs; [];
|
|
||||||
nix.settings.trusted-users = [ "admin" ];
|
|
||||||
security.sudo.extraRules = [
|
|
||||||
{
|
|
||||||
users = [ "admin" ];
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
command = "ALL";
|
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
})
|
|
||||||
{
|
|
||||||
users.mutableUsers = false;
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
nix-output-monitor
|
|
||||||
vim
|
|
||||||
htop
|
|
||||||
wget
|
|
||||||
git
|
|
||||||
pciutils
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -8,60 +8,60 @@ sops:
|
|||||||
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
||||||
enc: |
|
enc: |
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3cFBEempENHlXNnhNb1d5
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4dCt1ZFR0QnRqVFdiL0Zi
|
||||||
UitGNFliTDliZUdCSVBPRUVEWDc1Skw3N2xvCkFoL01DL2ZmWHhoMHV4TGdhaFdH
|
VTR6Zy9ZTy9YNDBZaDRTZzJnU2ZKcjJ0MG1vCldpRU5tTzc1YU5KbjlDbXlNRjBU
|
||||||
bG9XdUQ4ano4VjRxVTloNnl4OHJ6dkkKLS0tIDJvK2ZjNVhYZ1FkQTVWWjBhSFlt
|
Sm8yc0oyNWU1WHJoYTRvK3o4aGtTY2MKLS0tIE9wY0R0V3Vkc3Y1T1YwTkFTY0J5
|
||||||
R1Ixc3pWNFMvUVl0M1NsZ0txRXFMTkkK5aDgbCd13gAfZUrROnwRHgyXvIF67o1W
|
ZCtzbVdtNlh0cXpra2RWbEwzUDM0UjgKY3zZn5PUWuLBQgYxm9BUpLYWw3CdXYA8
|
||||||
EzEFyhWatq2KKzv6VoJSFnvEx5lMPSs0LLvOK2qgrsz0jWdy6yUkAg==
|
4U6OVdRF6foj4/GrKKyhVf8dMbLbkhPvxqZ5wg40o6bwHEw9QNM+5Q==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
- recipient: age19mn55pz5dgeghjg5cp7mymwax20jshmp8gwzuf2s3h5xlvzjksyqfscsqk
|
- recipient: age1z0cfz7l4vakjrte220h46fc05503506fjcz440na92pzgztlspmqc8vt6k
|
||||||
enc: |
|
enc: |
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxc3BSNVdqSTNYZSt4c05K
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBQbDZaYjRTTDc0SFU2U2xQ
|
||||||
TnpuYXF1L2lzQkdZOS9uUnA5aUpGTldWZVQ0CkZvN2hubmwvUW5xUWhtaE0xMzlp
|
cUhESStvKzM5Z0QyZlJldURtRUJZTHhvNEFrCmxReGJ6MU9qdkh6UFVPYmRuQThs
|
||||||
U3dpRHlmdU5UVG1nTS9XUVpTSjdQQ00KLS0tIC9sWTBOMStOYis1SDhLbjFlVk1F
|
VmVCMTQwc0xkR0gzemlSUVlnN0NCZE0KLS0tIDFtK041ZlF4VFBreHVacitSVEN5
|
||||||
M2dYNEpmWmxyeXU5S0FuV083NkVaQ3cKXuGyR0YQy+22z2kgM7IPhr0gurWQYczm
|
WXg4UkJtU2dTR3ZjeFYzR3lRODhLYzgKrO+NtT0Q3K8FgDwW0WiZJOUHwkEz+wp8
|
||||||
FA7C/2hoqb4tyyejomitndBSyxIxnaReO0Apl6JXeTLor8Dpuu42oQ==
|
lgBkXy2QJuuJ11f2e9ZJ3hx1xgOm6SMBmgl3zQVfVpq88yZE8uDe2Q==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2024-11-26T20:00:50Z"
|
lastmodified: "2024-11-26T20:00:50Z"
|
||||||
mac: ENC[AES256_GCM,data:qoY9SfpoU+8HfvD5v/1S6BOkbnZUmHIbtwr0tTSuPETjnFNgr1VVw9mnRatJKPYYFb9/rMZQWIqTY+iUIEkcTVyVXhd6ki5CHW+uxCeBIyMzq33rtEa/btkEUoii4iPieamBCIY21W0znE+edxfR04yRJtLxMICEbuW4Hjf6bwk=,iv:nG42fRgjpuIjPMYnn/6egEdzYolcUBsspaZ8zMv4888=,tag:C6apGoAvVLsWdLWSCwrx6w==,type:str]
|
mac: ENC[AES256_GCM,data:qoY9SfpoU+8HfvD5v/1S6BOkbnZUmHIbtwr0tTSuPETjnFNgr1VVw9mnRatJKPYYFb9/rMZQWIqTY+iUIEkcTVyVXhd6ki5CHW+uxCeBIyMzq33rtEa/btkEUoii4iPieamBCIY21W0znE+edxfR04yRJtLxMICEbuW4Hjf6bwk=,iv:nG42fRgjpuIjPMYnn/6egEdzYolcUBsspaZ8zMv4888=,tag:C6apGoAvVLsWdLWSCwrx6w==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2025-02-19T14:34:54Z"
|
- created_at: "2025-02-06T12:36:59Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
-----BEGIN PGP MESSAGE-----
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
hQGMA5HdvEwzh/H7AQwAkNhF9L1ocTsJRDyIA+0y24gtvRKAZhSRwds2wvTiBkPS
|
hQGMA5HdvEwzh/H7AQv8DLbU8OaQmYtAjTPlqeg1nv+/z3gA16MTZjz8rRBqK695
|
||||||
jzse8z4wY2yWz/JbEgqJqeFxJCaE64oc+2dETJIl2IsiRBDlXKfpL4yfRV+P6Ffu
|
JaEbWoCJ2Nv5Mnzj7owQSk/+f+Q/d00osr4KOhQWTNoq1442MyWgIXKGPDmHgXv8
|
||||||
DQfAR57hKIYa9emx+iFGoDMpRSuuLg4EGDoe1tmAu2OwLhKsqJrbL1ak88GB7/ko
|
CxFT3hIKMEFFvFtkSdo+HlBSTQJZtHgDSGabd2xd4e45tLnHsPvWQ4ngGn+piUaw
|
||||||
gFk02AF/QYuEetc7R0pZPxB6n1HQGBrvqAFrnHEsxw2rR7I4kNYpEzyf0IuGHfB1
|
qz5+YIpmFNlnL9ubsB8NivryXlIL6wBXL83FyfAPnY+qG0/7frVWwP1Cejg1CGYl
|
||||||
92WfYtdYSni7cqmTPV+t+k6P1VcJe6GXdlQnHk2pByqC2WrcrP+MtaAMkmWqxU72
|
bOYxgb1uPYIIqvvU9bZ4r46DfojFFGur9pwG/wKGOgIQ867vsXtRnNm6+SJIHeyt
|
||||||
AGarWEV2bnXmBsM5LcOQF6Mbui9tpEBE0O3lMlzUNXoVYHpOczlqdWkqh/y3Ea8V
|
eNqil3tee++V4VVUrDTf+gWufx9YFS/afRgMKuf1pUvQGTBMbUJNhIp+PjpOSBCk
|
||||||
bnHcaLQ8XubRyccK4JYZ4AIMJVPlVcnXdjZ4VFJwjRzGrllorq4x8L0niv60HV/g
|
Kk6uyMWrBhiCpAVU9GKFW1AbDBCgUig2sLIUGOrfb+RkzDLX4pEoa9DVVDC2pRVy
|
||||||
akxsjW1DPnJURNFacT3JYF+PsN+hpj/ma2k8qUTX5wFVJy3Gm0psVYqE5901ivBA
|
F2fjEEbPAZepsPFNbgDyaixv+FeA5oWWiBnA7qO/v8t142UOtqBcexUZjBYYgRmt
|
||||||
yg7mfiftchDvIeGQR8tE0lgBZrJbf/SjpVdawq7DORFVxkaNeoSAxOkCnqZ5kc7C
|
c0S+lTk//xEip9wYvY6W0lgBOLqEUEiLg1tw0xvt9H4R9aGNLkCyvUediwuAbfw4
|
||||||
w6zfxABWvwz73QM0AqfNzjkyswGk7N/09Zpj4BvjbbYuAfvIdiVVDHRPez/qWjnB
|
bGha9PTckYpnKN589xxsDMqbQ0Vn/rxeSzC7RT+qtjUg1gDbDJQTZdYr0+//e0YV
|
||||||
vkt9aLXFepLl
|
xRvlnfPW9voB
|
||||||
=4LVt
|
=xqAk
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: c4639370c41133a738f643a591ddbc4c3387f1fb
|
fp: c4639370c41133a738f643a591ddbc4c3387f1fb
|
||||||
- created_at: "2025-02-19T14:34:54Z"
|
- created_at: "2025-02-06T12:36:59Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
-----BEGIN PGP MESSAGE-----
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
hQIMA98TrrsQEbXUARAAmoHJ3i2vABDamIF3Nj6uuawarW+KKjzrIfYvAmWW4fgz
|
hQIMA98TrrsQEbXUARAAqGyBZLrJ1UpiJKIbQSTQpKA7bRD7olMczjh0Bx1fTN0U
|
||||||
zVAquTl1Oculhv+H4eVuylNUM5kwyCkM/VAxy3KoSNZn6aGZVDuns70r9lbNC1R8
|
bctdfIGVvdp5pM1C6xbvubNqAMEisQ1tMVozDkXCnLARTwcaq6lyE9vl3gJ1iF1Z
|
||||||
+diYAIe33rE3h6/Rw74RgOXUgNalONeoBWbIUuG+y9XOIfu7CBoUeGJct4ycYH0h
|
N8SbxVTYV1SXg3qokyBsZIggQ6gJqAr62Pyoansp4HfwwFwYohwR2zTfHJ8pFkkW
|
||||||
bn5iI0e4myDldmSc7OYnyruQMYg9OcKBnQPTZl1qzTqpwR6/BnIhWJcItuc3W5rv
|
R2FfEI2Gw5nN4GaauIxUGFDPuvvZapCWZ/ejt4s/ezT9cYrwYfu9XIlqsivsi3yp
|
||||||
aEunQ8lVyNxhGWMDwFucUJ2WbxkOFOFWPrLGXtsUg/I32aCUNR6X/HnYUezqCoSA
|
I03ohKS/pKhxlE7RV2ufRboG+m6TUCnyj5U5AzQa09hkSHd94s9A6M8I6M6zWebv
|
||||||
SFJAsaPkBr07o5Be5D03m0s5ryktQUdAElyDaz2Sgc58re9mtYKBAf4P4fKD5Zx+
|
pdX73sCjWZQdIZoeM5oXcyY/s/h4/w37loOUE/thh1+hIjybAG0CH31nJkjcdcLg
|
||||||
TJJGr6dmtb28Nxb5mbMroKbTit92NHHatXfz/YrZ1JyCHuINZ5Sq01TGhx6y71Uj
|
l/fqTLa89JVt37bU9c/hVsx2Bc1cTO7nqhG3kyahkMSLFrsb73yTNn4kOqSKZ7+z
|
||||||
0Afq3S2la+85UYRsQ5g9q6jM8rBHjm9AdcUkWA1chtn6elAUG8J0B+DUYYwcrMtp
|
189oR0EjNySgRt+M20vjKzhPbjxxQTKlpTE0vho6fEHYRmzPQ3IQbVUbPEbZR64I
|
||||||
YWFaKNHT09FRn4TcgE50Wgn9lX2RZ03viBbgCvDBLh3fmzl+dU1DsFdwuYmbgOeO
|
S+Nk7m95ZV8djaUOwqqU9pwDTvuYIBwhGOY1kefDg1sCCTM8C9RI9sG02HeQpme3
|
||||||
B6SQ2+SF3VVR7vAn4oPKydztCfYmb+38sCQl/FtZdP1RRW150fXtUx7aAzWGsLhq
|
bgkO+m4khXeiiIrTAODiyM+GCwx6UcwooUSpu8LZJmhiZtfgMsFdGF3P7ngtoOEQ
|
||||||
AObrNp0uMeCBHtpWctwFR1qssfRD3DHkI59MqoGK7ehDtBS6hzayjJp8sTiqCTzS
|
4cxP231EI/zoMqRyXYrvAovxXndwghG0LGcCAZZL6mNN2xzE6z1gesVWRjXM8inS
|
||||||
WAH/vMH2cvGN3q9mr73bBqHBxAL+ANWxrDvQmM4xwbLxET24ULnsC35bn4psWjTN
|
WAFB7DgLTlY43D4QbhkyZfo6XltYe1g1tcJJraG/HICa7hq5BZn48t/BcacCvsrJ
|
||||||
Y3aQqzhaZdYOki09fLENaYl6BMeIcfBx4qUrgfQKLUNqGV5fvVuXJUc=
|
lIkEgOT8gn1SlQbDL+T+3pRNOixGKPNU6Ategoy+Eq0Im3AhE0XO8Ns=
|
||||||
=/V5O
|
=Uvc2
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
initssh.imports = [ ./machines/modules/malobeo/initssh.nix ];
|
initssh.imports = [ ./machines/modules/malobeo/initssh.nix ];
|
||||||
metrics.imports = [ ./machines/modules/malobeo/metrics.nix ];
|
metrics.imports = [ ./machines/modules/malobeo/metrics.nix ];
|
||||||
disko.imports = [ ./machines/modules/disko ];
|
disko.imports = [ ./machines/modules/disko ];
|
||||||
users.imports = [ ./machines/modules/malobeo/users.nix ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hydraJobs = nixpkgs.lib.mapAttrs (_: nixpkgs.lib.hydraJob) (
|
hydraJobs = nixpkgs.lib.mapAttrs (_: nixpkgs.lib.hydraJob) (
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ mkdir -p "$pwpath"
|
|||||||
cd "$pwpath"
|
cd "$pwpath"
|
||||||
|
|
||||||
# Generate SSH keys
|
# Generate SSH keys
|
||||||
ssh-keygen -f $hostkey -t ed25519 -N "" -C "root@$host"
|
ssh-keygen -f $hostkey -t ed25519 -N ""
|
||||||
ssh-keygen -f $initrdkey -t ed25519 -N "" -C "root@$host-initrd"
|
ssh-keygen -f $initrdkey -t ed25519 -N ""
|
||||||
|
|
||||||
#encrypt the private keys
|
#encrypt the private keys
|
||||||
sops -e -i ./$hostkey
|
sops -e -i ./$hostkey
|
||||||
|
|||||||
Reference in New Issue
Block a user