Add a script for installing nginx

This commit is contained in:
Manuel Thalmann 2024-11-06 01:13:50 +01:00
parent 5eefcb24f2
commit 7b0833f786
2 changed files with 26 additions and 1 deletions

View file

@ -12,7 +12,7 @@
let let
optionalAttrs = lib.attrsets.optionalAttrs; optionalAttrs = lib.attrsets.optionalAttrs;
cfg = config; cfg = config;
inherit (cfg.software) coding desktopExperience essential gaming socialMedia; inherit (cfg.software) coding desktopExperience essential gaming server socialMedia;
mkPrograms = programs: builtins.foldl' ( mkPrograms = programs: builtins.foldl' (
programs: name: programs // { programs: name: programs // {
@ -118,6 +118,8 @@
"pyenv" "pyenv"
])) // (optionalAttrs gaming (mkPrograms [ ])) // (optionalAttrs gaming (mkPrograms [
"lutris" "lutris"
])) // (optionalAttrs server (mkPrograms [
"nginx"
])); ]));
# Essentials # Essentials

View file

@ -0,0 +1,23 @@
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../lib/software.fish"
inherit "$dir/../../../Common/Software/aliae/main.fish"
function installSW
yayinst nginx
end
function configureSW
set -l file "/etc/nginx/nginx.conf"
set -l config "include /etc/nginx/conf.d/*.conf;"
if not grep --fixed-strings "$config" "$file" >/dev/null
sudo sed -i "$file" -e "/^http {/,/^}/{ /^}/{" -e "i\\" -e "" -e "i \ $config" -e "} }"
end
sudo systemctl enable --now nginx
end
runInstaller $argv
end