Compare commits
3 Commits
gitea
...
9b014c5ff0
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b014c5ff0 | |||
| 1c66b6db8c | |||
| 1cecd21763 |
@@ -46,6 +46,11 @@ let
|
|||||||
{
|
{
|
||||||
microvm = {
|
microvm = {
|
||||||
hypervisor = "qemu";
|
hypervisor = "qemu";
|
||||||
|
shares = [ {
|
||||||
|
tag = "ro-store";
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
} ];
|
||||||
interfaces = [
|
interfaces = [
|
||||||
{
|
{
|
||||||
type = "tap";
|
type = "tap";
|
||||||
@@ -94,12 +99,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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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?
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -13,6 +13,14 @@ in
|
|||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = lib.mdDoc "Setup bridge device for microvms.";
|
description = lib.mdDoc "Setup bridge device for microvms.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
deployHosts = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf string;
|
||||||
|
description = ''
|
||||||
|
List hostnames of MicroVMs that should be automatically initializes and autostart
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,5 +56,24 @@ in
|
|||||||
networkConfig.Bridge = "microvm";
|
networkConfig.Bridge = "microvm";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imports = mkIf (lib.length cfg.deployHosts != 0) [
|
||||||
|
inputs.microvm.nixosModules.host
|
||||||
|
];
|
||||||
|
|
||||||
|
microvm.autostart = cfg.deployHosts;
|
||||||
|
microvm.vms =
|
||||||
|
let
|
||||||
|
# Map the values to each hostname to then generate a Attrs using listToAttrs
|
||||||
|
mapperFunc = name: { inherit name; value = {
|
||||||
|
# Host build-time reference to where the MicroVM NixOS is defined
|
||||||
|
# under nixosConfigurations
|
||||||
|
flake = self;
|
||||||
|
# Specify from where to let `microvm -u` update later on
|
||||||
|
updateFlake = "git+https://git.dynamicdiscord.de/kalipso/infrastructure?ref=microvm";
|
||||||
|
}; };
|
||||||
|
in
|
||||||
|
mkIf (lib.length cfg.deployHosts != 0)
|
||||||
|
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user