[NixOS] Host railbird.ai on biskcomp

This commit is contained in:
Ivan Malison 2023-08-28 01:03:24 +00:00
parent 1ed985620c
commit 284f01e9df
4 changed files with 65 additions and 15 deletions

3
.gitmodules vendored
View File

@ -10,3 +10,6 @@
[submodule "dotfiles/config/alacritty/themes"]
path = dotfiles/config/alacritty/themes
url = https://github.com/alacritty/alacritty-theme
[submodule "nixos/railbird.ai"]
path = nixos/railbird.ai
url = git@github.com:billnerds/railbird.ai.git

View File

@ -1,5 +1,27 @@
{ config, makeEnable, ... }:
makeEnable config "modules.cache-server" false {
{ config, makeEnable, lib, ... }:
with lib;
let cfg = config.modules.cache-server;
in
{
options = {
modules.cache-server = {
enable = mkEnableOption "nix cache server";
port = mkOption {
type = types.int;
default = 8080;
};
host-string = mkOption {
type = types.string;
default = "0.0.0.0";
};
path = mkOption {
type = types.string;
default = "/";
};
};
};
config = mkIf cfg.enable {
age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age;
services.nix-serve = {
@ -12,9 +34,12 @@ makeEnable config "modules.cache-server" false {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"0.0.0.0" = {
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
"${cfg.host-string}" = {
locations."${cfg.path}".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
listen = [ { addr = "0.0.0.0"; port = cfg.port; } ];
};
};
};
};
}

View File

@ -15,7 +15,28 @@
modules.syncthing.enable = true;
modules.fonts.enable = true;
modules.nixified-ai.enable = false;
modules.cache-server.enable = true;
modules.cache-server = {
enable = true;
host-string = "192.168.1.44 railbird.ai 1896Folsom.duckdns.org 0.0.0.0 67.162.131.71";
port = 80;
path = "/nix-cache";
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedGzipSettings = true;
recommendedTlsSettings = true;
virtualHosts = let conf = {
root = ../railbird.ai;
locations."/" = {
index = "index.html";
};
};
in {
"192.168.1.44 railbird.ai 1896Folsom.duckdns.org 0.0.0.0 67.162.131.71" = conf;
};
};
services.plex = {
enable = true;

1
nixos/railbird.ai Submodule

@ -0,0 +1 @@
Subproject commit 74ee66bcb6c3a1ba509d1e78435e391255dc0647