Add a script for installing nginx
This commit is contained in:
parent
b80f2de860
commit
414de16273
2 changed files with 26 additions and 1 deletions
|
@ -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
|
||||||
|
|
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