2022-02-13 13:10:21 +00:00
|
|
|
{
|
2022-02-20 15:59:07 +00:00
|
|
|
nixos.systems.colony = {
|
|
|
|
system = "x86_64-linux";
|
2022-04-03 19:01:21 +01:00
|
|
|
nixpkgs = "mine";
|
2022-02-20 15:59:07 +00:00
|
|
|
home-manager = "unstable";
|
2022-02-19 22:55:53 +00:00
|
|
|
|
2022-05-07 17:27:12 +01:00
|
|
|
configuration = { lib, pkgs, modulesPath, config, systems, ... }:
|
2022-02-21 00:37:09 +00:00
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
in
|
2022-02-20 15:59:07 +00:00
|
|
|
{
|
|
|
|
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
|
2022-02-13 23:06:31 +00:00
|
|
|
|
2022-02-20 15:59:07 +00:00
|
|
|
my = {
|
2022-02-22 00:59:57 +00:00
|
|
|
secrets = {
|
|
|
|
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINkqdN5t3UKwrNOOPKlbnG1WYhnkV5H9luAzMotr8SbT";
|
|
|
|
files."test.txt" = {};
|
|
|
|
};
|
|
|
|
|
2022-02-20 15:59:07 +00:00
|
|
|
firewall = {
|
2022-05-02 17:34:48 +01:00
|
|
|
trustedInterfaces = [ "virtual" ];
|
2022-02-20 15:59:07 +00:00
|
|
|
nat = {
|
|
|
|
externalInterface = "eth0";
|
|
|
|
forwardPorts = [
|
|
|
|
{
|
|
|
|
proto = "tcp";
|
|
|
|
sourcePort = 2222;
|
|
|
|
destination = "127.0.0.1:22";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
server.enable = true;
|
2022-03-26 14:20:30 +00:00
|
|
|
|
|
|
|
containers = {
|
2022-05-02 17:34:48 +01:00
|
|
|
instances.vaultwarden = {
|
|
|
|
networking.bridge = "virtual";
|
|
|
|
};
|
2022-03-26 14:20:30 +00:00
|
|
|
};
|
2022-05-02 20:40:11 +01:00
|
|
|
vms = {
|
|
|
|
instances.test = {
|
2022-05-12 21:06:46 +01:00
|
|
|
uuid = "59f51efb-7e6d-477b-a263-ed9620dbc87b";
|
|
|
|
networks.virtual.mac = "52:54:00:ab:f1:52";
|
2022-05-07 17:27:12 +01:00
|
|
|
drives = {
|
|
|
|
disk = {
|
|
|
|
backend = {
|
|
|
|
driver = "file";
|
|
|
|
filename = "${systems.installer.configuration.config.my.buildAs.iso}/iso/nixos.iso";
|
|
|
|
read-only = "on";
|
|
|
|
};
|
|
|
|
format.driver = "raw";
|
|
|
|
frontend = "ide-cd";
|
|
|
|
frontendOpts = {
|
|
|
|
bootindex = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-05-02 20:40:11 +01:00
|
|
|
};
|
|
|
|
};
|
2022-02-20 15:59:07 +00:00
|
|
|
};
|
2022-02-13 23:06:31 +00:00
|
|
|
|
2022-02-20 15:59:07 +00:00
|
|
|
fileSystems = {
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/nix" = {
|
|
|
|
device = "/dev/disk/by-label/nix";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/persist" = {
|
|
|
|
device = "/dev/disk/by-label/persist";
|
|
|
|
fsType = "ext4";
|
|
|
|
neededForBoot = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
2022-02-21 00:37:09 +00:00
|
|
|
interfaces = mkIf (!config.my.build.isDevVM) {
|
|
|
|
enp1s0.useDHCP = true;
|
|
|
|
};
|
2022-02-20 15:59:07 +00:00
|
|
|
};
|
2022-03-26 14:20:30 +00:00
|
|
|
|
2022-05-02 17:34:48 +01:00
|
|
|
systemd.network = {
|
|
|
|
netdevs."25-virtual-bridge".netdevConfig = {
|
|
|
|
Name = "virtual";
|
|
|
|
Kind = "bridge";
|
|
|
|
};
|
|
|
|
networks."80-virtual-bridge" = {
|
|
|
|
matchConfig = {
|
|
|
|
Name = "virtual";
|
|
|
|
Driver = "bridge";
|
|
|
|
};
|
|
|
|
networkConfig = {
|
|
|
|
Address = "172.16.137.1/24";
|
|
|
|
DHCPServer = true;
|
|
|
|
# TODO: Configuration for routed IPv6 (and maybe IPv4)
|
|
|
|
IPMasquerade = "both";
|
|
|
|
IPv6SendRA = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-03-26 14:20:30 +00:00
|
|
|
#systemd.services.systemd-networkd.environment.SYSTEMD_LOG_LEVEL = "debug";
|
2022-05-02 20:40:11 +01:00
|
|
|
virtualisation = {
|
|
|
|
cores = 8;
|
|
|
|
memorySize = 8192;
|
|
|
|
};
|
2022-02-20 15:59:07 +00:00
|
|
|
};
|
2022-02-19 22:55:53 +00:00
|
|
|
};
|
2022-02-13 13:10:21 +00:00
|
|
|
}
|