mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-28 19:22:24 +00:00
Compare commits
No commits in common. "8dde5786762384fd59972839661d9e8627830a97" and "1b7e4687e4e384962c1b30b8c8bab9eedff80d2b" have entirely different histories.
8dde578676
...
1b7e4687e4
3
.github/workflows/arrow.yml
vendored
3
.github/workflows/arrow.yml
vendored
@ -1,7 +1,5 @@
|
|||||||
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 }}
|
||||||
@ -26,7 +24,6 @@ on:
|
|||||||
options:
|
options:
|
||||||
- create
|
- create
|
||||||
- destroy
|
- destroy
|
||||||
- nothing
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
build-deploy:
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
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
|
||||||
|
32
modules/nixos/gaming/leagueoflegends.nix
Normal file
32
modules/nixos/gaming/leagueoflegends.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{ 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"; };
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
@ -98,56 +98,52 @@ 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 = lib.mkIf
|
services.cloudflare-dyndns = {
|
||||||
((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 to start
|
# Wait for secret to exist
|
||||||
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" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
startAt = "*:0/5";
|
||||||
startAt = "*:0/5";
|
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
CLOUDFLARE_DOMAINS = toString config.cloudflare.noProxyDomains;
|
CLOUDFLARE_DOMAINS = toString config.cloudflare.noProxyDomains;
|
||||||
};
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "simple";
|
|
||||||
DynamicUser = true;
|
|
||||||
StateDirectory = "cloudflare-dyndns-noproxy";
|
|
||||||
EnvironmentFile = config.services.cloudflare-dyndns.apiTokenFile;
|
|
||||||
ExecStart = let
|
|
||||||
args =
|
|
||||||
[ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ]
|
|
||||||
++ (if config.services.cloudflare-dyndns.ipv4 then
|
|
||||||
[ "-4" ]
|
|
||||||
else
|
|
||||||
[ "-no-4" ]) ++ (if config.services.cloudflare-dyndns.ipv6 then
|
|
||||||
[ "-6" ]
|
|
||||||
else
|
|
||||||
[ "-no-6" ])
|
|
||||||
++ lib.optional config.services.cloudflare-dyndns.deleteMissing
|
|
||||||
"--delete-missing";
|
|
||||||
|
|
||||||
in "${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns ${toString args}";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
DynamicUser = true;
|
||||||
|
StateDirectory = "cloudflare-dyndns-noproxy";
|
||||||
|
EnvironmentFile = config.services.cloudflare-dyndns.apiTokenFile;
|
||||||
|
ExecStart = let
|
||||||
|
args = [ "--cache-file /var/lib/cloudflare-dyndns-noproxy/ip.cache" ]
|
||||||
|
++ (if config.services.cloudflare-dyndns.ipv4 then
|
||||||
|
[ "-4" ]
|
||||||
|
else
|
||||||
|
[ "-no-4" ]) ++ (if config.services.cloudflare-dyndns.ipv6 then
|
||||||
|
[ "-6" ]
|
||||||
|
else
|
||||||
|
[ "-no-6" ])
|
||||||
|
++ lib.optional config.services.cloudflare-dyndns.deleteMissing
|
||||||
|
"--delete-missing";
|
||||||
|
|
||||||
|
in "${pkgs.cloudflare-dyndns}/bin/cloudflare-dyndns ${toString args}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
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 = {
|
serviceConfig = { Type = "oneshot"; };
|
||||||
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
|
||||||
|
@ -68,8 +68,7 @@
|
|||||||
|
|
||||||
description = "Decrypt secret for ${name}";
|
description = "Decrypt secret for ${name}";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
bindsTo = [ "wait-for-identity.service" ];
|
requires = [ "wait-for-identity.service" ];
|
||||||
after = [ "wait-for-identity.service" ];
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script = ''
|
||||||
echo "${attrs.prefix}$(
|
echo "${attrs.prefix}$(
|
||||||
|
@ -40,15 +40,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Create reverse proxy for web UI
|
# Create reverse proxy for web UI
|
||||||
caddy.routes = let
|
caddy.routes = lib.mkAfter [{
|
||||||
# Set if the download domain is the same as the Transmission domain
|
group =
|
||||||
useDownloadDomain = config.hostnames.download
|
if (config.hostnames.download == config.hostnames.transmission) then
|
||||||
== config.hostnames.transmission;
|
"download"
|
||||||
in lib.mkAfter [{
|
else
|
||||||
group = if useDownloadDomain then "download" else "transmission";
|
"transmission";
|
||||||
match = [{
|
match = [{
|
||||||
host = [ config.hostnames.transmission ];
|
host = [ config.hostnames.transmission ];
|
||||||
path = if useDownloadDomain then [ "/transmission*" ] else null;
|
path = [ "/transmission*" ];
|
||||||
}];
|
}];
|
||||||
handle = [{
|
handle = [{
|
||||||
handler = "reverse_proxy";
|
handler = "reverse_proxy";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user