Compare commits

...

6 Commits

Author SHA1 Message Date
Noah Masur
8dde578676 try multiple ternary option for arrow workflow 2024-03-30 14:07:36 -04:00
Noah Masur
5e1534451d
don't enable cloudflare-dyndns unless domain list is non-empty 2024-03-30 18:03:52 +00:00
Noah Masur
c4a1c7564c remove league of legends as anticheat no longer supports linux 2024-03-30 13:48:26 -04:00
Noah Masur
0de2c429f2 fix path for transmission if not in download 2024-03-30 13:48:10 -04:00
Noah Masur
eb6b72a25c try updating workflow name 2024-03-30 13:07:06 -04:00
Noah Masur
0618fc3962 try binding to wait for identity service to complete
and see if remainafterexit fixes one of the issues
2024-03-30 13:01:34 -04:00
7 changed files with 57 additions and 79 deletions

View File

@ -1,5 +1,7 @@
name: Arrow name: Arrow
run-name: Arrow - ${{ inputs.rebuild && 'Rebuild and ' || '' }}${{ inputs.action == 'create' && 'Create' || ( ${{ inputs.action == 'destroy' && 'Destroy' || 'No Action' ) }}
env: env:
TERRAFORM_DIRECTORY: hosts/arrow TERRAFORM_DIRECTORY: hosts/arrow
DEPLOY_IDENTITY_BASE64: ${{ secrets.DEPLOY_IDENTITY_BASE64 }} DEPLOY_IDENTITY_BASE64: ${{ secrets.DEPLOY_IDENTITY_BASE64 }}
@ -24,6 +26,7 @@ on:
options: options:
- create - create
- destroy - destroy
- nothing
jobs: jobs:
build-deploy: build-deploy:

View File

@ -3,7 +3,6 @@
imports = [ imports = [
./chiaki.nix ./chiaki.nix
./dwarf-fortress.nix ./dwarf-fortress.nix
./leagueoflegends.nix
./legendary.nix ./legendary.nix
./lutris.nix ./lutris.nix
./minecraft-server.nix ./minecraft-server.nix

View File

@ -1,32 +0,0 @@
{ config, pkgs, lib, ... }: {
options.gaming.leagueoflegends.enable =
lib.mkEnableOption "League of Legends";
config =
lib.mkIf (config.gaming.leagueoflegends.enable && pkgs.stdenv.isLinux) {
# League of Legends anti-cheat requirement
boot.kernel.sysctl = { "abi.vsyscall32" = 0; };
environment.systemPackages = with pkgs; [
# Lutris requirement to install the game
lutris
amdvlk
wineWowPackages.stable
# vulkan-tools
# Required according to https://lutris.net/games/league-of-legends/
openssl
gnome.zenity
# Don't remember if this is required
dconf
];
environment.sessionVariables = { QT_X11_NO_MITSHM = "1"; };
};
}

View File

@ -98,22 +98,25 @@ in {
services.transmission.settings.rpc-whitelist = services.transmission.settings.rpc-whitelist =
builtins.concatStringsSep "," ([ "127.0.0.1" ] ++ cloudflareIpRanges); builtins.concatStringsSep "," ([ "127.0.0.1" ] ++ cloudflareIpRanges);
services.cloudflare-dyndns = { services.cloudflare-dyndns = lib.mkIf
((builtins.length config.services.cloudflare-dyndns.domains) > 0) {
enable = true; enable = true;
proxied = true; proxied = true;
deleteMissing = true; deleteMissing = true;
apiTokenFile = config.secrets.cloudflare-api.dest; apiTokenFile = config.secrets.cloudflare-api.dest;
}; };
# Wait for secret to exist # Wait for secret to exist to start
systemd.services.cloudflare-dyndns = { systemd.services.cloudflare-dyndns =
lib.mkIf config.services.cloudflare-dyndns.enable {
after = [ "cloudflare-api-secret.service" ]; after = [ "cloudflare-api-secret.service" ];
requires = [ "cloudflare-api-secret.service" ]; requires = [ "cloudflare-api-secret.service" ];
}; };
# Run a second copy of dyn-dns for non-proxied domains # Run a second copy of dyn-dns for non-proxied domains
# Adapted from: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/cloudflare-dyndns.nix # Adapted from: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/cloudflare-dyndns.nix
systemd.services.cloudflare-dyndns-noproxy = { systemd.services.cloudflare-dyndns-noproxy =
lib.mkIf ((builtins.length config.cloudflare.noProxyDomains) > 0) {
description = "CloudFlare Dynamic DNS Client (no proxy)"; description = "CloudFlare Dynamic DNS Client (no proxy)";
after = [ "network.target" "cloudflare-api-secret.service" ]; after = [ "network.target" "cloudflare-api-secret.service" ];
requires = [ "cloudflare-api-secret.service" ]; requires = [ "cloudflare-api-secret.service" ];
@ -130,7 +133,8 @@ in {
StateDirectory = "cloudflare-dyndns-noproxy"; StateDirectory = "cloudflare-dyndns-noproxy";
EnvironmentFile = config.services.cloudflare-dyndns.apiTokenFile; EnvironmentFile = config.services.cloudflare-dyndns.apiTokenFile;
ExecStart = let ExecStart = let
args = [ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ] args =
[ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ]
++ (if config.services.cloudflare-dyndns.ipv4 then ++ (if config.services.cloudflare-dyndns.ipv4 then
[ "-4" ] [ "-4" ]
else else

View File

@ -4,7 +4,10 @@
systemd.services.wait-for-identity = { systemd.services.wait-for-identity = {
description = "Wait until identity file exists on the machine"; description = "Wait until identity file exists on the machine";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { Type = "oneshot"; }; serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = '' script = ''
for i in $(seq 1 10); do for i in $(seq 1 10); do
if [ -f ${config.identityFile} ]; then if [ -f ${config.identityFile} ]; then

View File

@ -68,7 +68,8 @@
description = "Decrypt secret for ${name}"; description = "Decrypt secret for ${name}";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
requires = [ "wait-for-identity.service" ]; bindsTo = [ "wait-for-identity.service" ];
after = [ "wait-for-identity.service" ];
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
echo "${attrs.prefix}$( echo "${attrs.prefix}$(

View File

@ -40,15 +40,15 @@
}; };
# Create reverse proxy for web UI # Create reverse proxy for web UI
caddy.routes = lib.mkAfter [{ caddy.routes = let
group = # Set if the download domain is the same as the Transmission domain
if (config.hostnames.download == config.hostnames.transmission) then useDownloadDomain = config.hostnames.download
"download" == config.hostnames.transmission;
else in lib.mkAfter [{
"transmission"; group = if useDownloadDomain then "download" else "transmission";
match = [{ match = [{
host = [ config.hostnames.transmission ]; host = [ config.hostnames.transmission ];
path = [ "/transmission*" ]; path = if useDownloadDomain then [ "/transmission*" ] else null;
}]; }];
handle = [{ handle = [{
handler = "reverse_proxy"; handler = "reverse_proxy";