Add a script for installing nginx
This commit is contained in:
parent
f4e72d9c4c
commit
9fc504b0bf
2 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
|
|
23
scripts/Arch/Software/nginx/main.fish
Executable file
23
scripts/Arch/Software/nginx/main.fish
Executable 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
|
Loading…
Reference in a new issue