[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"] [submodule "dotfiles/config/alacritty/themes"]
path = dotfiles/config/alacritty/themes path = dotfiles/config/alacritty/themes
url = https://github.com/alacritty/alacritty-theme 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,20 +1,45 @@
{ config, makeEnable, ... }: { config, makeEnable, lib, ... }:
makeEnable config "modules.cache-server" false { with lib;
age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age; let cfg = config.modules.cache-server;
in
services.nix-serve = { {
enable = true; options = {
secretKeyFile = config.age.secrets."cache-priv-key.pem".path; modules.cache-server = {
port = 5050; 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 = "/";
};
};
}; };
services.nginx = { config = mkIf cfg.enable {
enable = true; age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age;
recommendedProxySettings = true;
virtualHosts = { services.nix-serve = {
"0.0.0.0" = { enable = true;
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; secretKeyFile = config.age.secrets."cache-priv-key.pem".path;
port = 5050;
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"${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.syncthing.enable = true;
modules.fonts.enable = true; modules.fonts.enable = true;
modules.nixified-ai.enable = false; 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 = { services.plex = {
enable = true; enable = true;

1
nixos/railbird.ai Submodule

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