Add a script for installing nginx

This commit is contained in:
Manuel Thalmann 2024-11-06 01:13:50 +01:00
parent 81dd9c2bd3
commit 0d6a25036a
2 changed files with 26 additions and 1 deletions

View file

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