containers/garnet: init
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
Some checks are pending
CI / Build linux-lava for x86_64-linux (push) Waiting to run
This commit is contained in:
parent
81c17720eb
commit
ef490d82f7
5 changed files with 179 additions and 8 deletions
32
containers/garnet/configuration.nix
Normal file
32
containers/garnet/configuration.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ ... }: {
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
fileSystems."/var/lib/opencloud" = {
|
||||||
|
device = "/persist/opencloud";
|
||||||
|
fsType = "none";
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 9200 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 9200 ];
|
||||||
|
|
||||||
|
services.slskd = {
|
||||||
|
enable = true;
|
||||||
|
domain = null;
|
||||||
|
environmentFile = "/binds/slskd_env";
|
||||||
|
settings = {
|
||||||
|
shares.directories = [ "/binds/music/" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.etc."opencloud-admin-pass".text = ''
|
||||||
|
IDM_ADMIN_PASSWORD=supersillysecure
|
||||||
|
'';
|
||||||
|
services.opencloud = {
|
||||||
|
enable = true;
|
||||||
|
url = "https://cloud.lava.moe";
|
||||||
|
address = "127.0.0.1";
|
||||||
|
port = 9200;
|
||||||
|
environment = {
|
||||||
|
PROXY_TLS = "false";
|
||||||
|
};
|
||||||
|
environmentFile = "/etc/opencloud-admin-pass";
|
||||||
|
};
|
||||||
|
}
|
||||||
27
containers/garnet/flake.lock
generated
Normal file
27
containers/garnet/flake.lock
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1779560665,
|
||||||
|
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
80
containers/garnet/flake.nix
Normal file
80
containers/garnet/flake.nix
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
outputs = { nixpkgs, ... }:
|
||||||
|
let
|
||||||
|
name = "garnet";
|
||||||
|
fqdn = "cloud.lava.moe";
|
||||||
|
subnetId = "7";
|
||||||
|
|
||||||
|
subnet = x: "fd0d:1::${subnetId}:${toString x}";
|
||||||
|
host = subnet 1;
|
||||||
|
client = subnet 2;
|
||||||
|
|
||||||
|
subnet4 = x: "10.30.${subnetId}.${toString x}";
|
||||||
|
host4 = subnet4 1;
|
||||||
|
client4 = subnet4 2;
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./configuration.nix
|
||||||
|
{
|
||||||
|
networking.useHostResolvConf = false;
|
||||||
|
networking.nameservers = [ host ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit modules;
|
||||||
|
};
|
||||||
|
nixosModule = { config, ... }: {
|
||||||
|
networking.nat = {
|
||||||
|
enable = true;
|
||||||
|
enableIPv6 = true;
|
||||||
|
internalInterfaces = [ "ve-${name}" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${fqdn}" = {
|
||||||
|
useACMEHost = "lava.moe";
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://[${client}]:9200";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
listenAddresses = [ "10.0.0.1" "[fd0d::1]" "100.67.1.1" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /persist/containers/${name} 755 root users"
|
||||||
|
"d /persist/flower 755 root users"
|
||||||
|
];
|
||||||
|
containers.${name} = {
|
||||||
|
autoStart = true;
|
||||||
|
privateNetwork = true;
|
||||||
|
hostAddress = host4;
|
||||||
|
localAddress = client4;
|
||||||
|
hostAddress6 = host;
|
||||||
|
localAddress6 = client;
|
||||||
|
# privateUsers = "pick";
|
||||||
|
nixpkgs = nixpkgs;
|
||||||
|
ephemeral = true;
|
||||||
|
config = { imports = modules; };
|
||||||
|
specialArgs = { inherit fqdn; };
|
||||||
|
|
||||||
|
bindMounts."persist" = {
|
||||||
|
hostPath = "/persist/containers/${name}";
|
||||||
|
mountPoint = "/persist";
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
bindMounts."content" = {
|
||||||
|
hostPath = "/persist/flower";
|
||||||
|
mountPoint = "/flower";
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
47
flake.lock
generated
47
flake.lock
generated
|
|
@ -128,6 +128,20 @@
|
||||||
},
|
},
|
||||||
"parent": []
|
"parent": []
|
||||||
},
|
},
|
||||||
|
"c-garnet": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_9"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"path": "./containers/garnet",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"path": "./containers/garnet",
|
||||||
|
"type": "path"
|
||||||
|
},
|
||||||
|
"parent": []
|
||||||
|
},
|
||||||
"catppuccin": {
|
"catppuccin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
|
|
@ -595,7 +609,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"git-hooks": "git-hooks",
|
"git-hooks": "git-hooks",
|
||||||
"nixpkgs": "nixpkgs_9"
|
"nixpkgs": "nixpkgs_10"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778384395,
|
"lastModified": 1778384395,
|
||||||
|
|
@ -679,6 +693,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_10": {
|
"nixpkgs_10": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778274207,
|
||||||
|
"narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_11": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777954456,
|
"lastModified": 1777954456,
|
||||||
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
|
||||||
|
|
@ -694,7 +724,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_11": {
|
"nixpkgs_12": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770019141,
|
"lastModified": 1770019141,
|
||||||
"narHash": "sha256-VKS4ZLNx4PNrABoB0L8KUpc1fE7CLpQXQs985tGfaCU=",
|
"narHash": "sha256-VKS4ZLNx4PNrABoB0L8KUpc1fE7CLpQXQs985tGfaCU=",
|
||||||
|
|
@ -824,16 +854,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_9": {
|
"nixpkgs_9": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778274207,
|
"lastModified": 1779560665,
|
||||||
"narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=",
|
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7",
|
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixpkgs-unstable",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -880,7 +910,7 @@
|
||||||
"pastel": {
|
"pastel": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": "nixpkgs_11",
|
"nixpkgs": "nixpkgs_12",
|
||||||
"pnpm2nix": "pnpm2nix"
|
"pnpm2nix": "pnpm2nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -946,6 +976,7 @@
|
||||||
"c-diamond": "c-diamond",
|
"c-diamond": "c-diamond",
|
||||||
"c-emerald": "c-emerald",
|
"c-emerald": "c-emerald",
|
||||||
"c-fluorite": "c-fluorite",
|
"c-fluorite": "c-fluorite",
|
||||||
|
"c-garnet": "c-garnet",
|
||||||
"catppuccin": "catppuccin_2",
|
"catppuccin": "catppuccin_2",
|
||||||
"catppuccin-palette": "catppuccin-palette",
|
"catppuccin-palette": "catppuccin-palette",
|
||||||
"fast-syntax-highlighting": "fast-syntax-highlighting",
|
"fast-syntax-highlighting": "fast-syntax-highlighting",
|
||||||
|
|
@ -954,7 +985,7 @@
|
||||||
"neovim-nightly": "neovim-nightly",
|
"neovim-nightly": "neovim-nightly",
|
||||||
"nix-gaming": "nix-gaming",
|
"nix-gaming": "nix-gaming",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs_10",
|
"nixpkgs": "nixpkgs_11",
|
||||||
"nvim-treesitter": "nvim-treesitter",
|
"nvim-treesitter": "nvim-treesitter",
|
||||||
"pastel": "pastel",
|
"pastel": "pastel",
|
||||||
"pure": "pure",
|
"pure": "pure",
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
c-diamond.url = "path:./containers/diamond";
|
c-diamond.url = "path:./containers/diamond";
|
||||||
c-emerald.url = "path:./containers/emerald";
|
c-emerald.url = "path:./containers/emerald";
|
||||||
c-fluorite.url = "path:./containers/fluorite";
|
c-fluorite.url = "path:./containers/fluorite";
|
||||||
|
c-garnet.url = "path:./containers/garnet";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, agenix, catppuccin, nixpkgs, ... } @ inputs:
|
outputs = { self, agenix, catppuccin, nixpkgs, ... } @ inputs:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue