gigalint everything
This commit is contained in:
parent
2ce46f1cf5
commit
d4c31f8fd1
39 changed files with 499 additions and 398 deletions
|
|
@ -1,30 +1,44 @@
|
|||
{ lib, pkgs, addressList, ... }:
|
||||
let genVMConfig = { name, config ? {}, ro-store ? true }: {
|
||||
restartIfChanged = true;
|
||||
pkgs = pkgs;
|
||||
config = config // {
|
||||
microvm = {
|
||||
shares = lib.mkIf (ro-store == true) [{
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
tag = "ro-store";
|
||||
proto = "virtiofs";
|
||||
}];
|
||||
interfaces = [
|
||||
{
|
||||
type = "tap";
|
||||
id = name;
|
||||
mac = addressList.${name}.mac;
|
||||
}
|
||||
];
|
||||
};
|
||||
} // import ./vmDefaults.nix { inherit name addressList; };
|
||||
};
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
addressList,
|
||||
...
|
||||
}: let
|
||||
genVMConfig = {
|
||||
name,
|
||||
config ? {},
|
||||
ro-store ? true,
|
||||
}: {
|
||||
restartIfChanged = true;
|
||||
inherit pkgs;
|
||||
config =
|
||||
config
|
||||
// {
|
||||
microvm = {
|
||||
shares = lib.mkIf ro-store [
|
||||
{
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
tag = "ro-store";
|
||||
proto = "virtiofs";
|
||||
}
|
||||
];
|
||||
interfaces = [
|
||||
{
|
||||
type = "tap";
|
||||
id = name;
|
||||
inherit (addressList.${name}) mac;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
// import ./vmDefaults.nix {inherit name addressList;};
|
||||
};
|
||||
in {
|
||||
microvm.vms = {
|
||||
vm-test = genVMConfig {
|
||||
name = "vm-test";
|
||||
config = import ./vm-test.nix { inherit pkgs addressList; };
|
||||
config = import ./vm-test.nix {inherit pkgs addressList;};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
27
nixos/htz/vms/headscale.nix
Normal file
27
nixos/htz/vms/headscale.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{config, ...}: let
|
||||
domain = "ts.10110110.xyz";
|
||||
in {
|
||||
services = {
|
||||
headscale = {
|
||||
enable = true;
|
||||
address = "0.0.0.0";
|
||||
port = 8080;
|
||||
serverUrl = "https://${domain}";
|
||||
dns = {baseDomain = "10110110.xyz";};
|
||||
settings = {logtail.enabled = false;};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts.${domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.headscale.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }: {
|
||||
_: {
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [80];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ name, addressList, ...}: {
|
||||
{
|
||||
name,
|
||||
addressList,
|
||||
...
|
||||
}: {
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks."20-lan" = {
|
||||
|
|
@ -27,11 +31,12 @@
|
|||
root = {
|
||||
openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIItTJm2iu/5xacOoh4/JAvMtHE62duDlVVXpvVP+uQMR root@htz''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILU2TUxKyGKoZ68IG4hw23RmxVf72u5K9W0StkgTr0b2 e@t14'' ];
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILU2TUxKyGKoZ68IG4hw23RmxVf72u5K9W0StkgTr0b2 e@t14''
|
||||
];
|
||||
};
|
||||
e = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
extraGroups = ["wheel"];
|
||||
openssh.authorizedKeys.keys = [
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIItTJm2iu/5xacOoh4/JAvMtHE62duDlVVXpvVP+uQMR root@htz''
|
||||
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILU2TUxKyGKoZ68IG4hw23RmxVf72u5K9W0StkgTr0b2 e@t14''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue