sternchen update
This commit is contained in:
parent
0d7975f31f
commit
e421a67919
4 changed files with 64 additions and 23 deletions
39
assets/nginx-show-config.sh
Normal file
39
assets/nginx-show-config.sh
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -p nginx-config-formatter python3 -i python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
|
||||||
|
def nginx_config() -> str:
|
||||||
|
reload_config ="/etc/nginx/nginx.conf"
|
||||||
|
if os.path.exists(reload_config):
|
||||||
|
return reload_config
|
||||||
|
out = subprocess.check_output(["systemctl", "cat", "nginx"])
|
||||||
|
match = re.search(r"-c '(\S+-nginx\.conf)", out.decode("utf-8"))
|
||||||
|
if not match:
|
||||||
|
print("Could not find nginx.conf in nginx.service", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
return match.group(1)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
config_path = nginx_config()
|
||||||
|
with TemporaryDirectory() as temp_dir:
|
||||||
|
temp_path = os.path.join(temp_dir, "nginx.conf")
|
||||||
|
with open(temp_path, "wb+") as temp_file, \
|
||||||
|
open(config_path, "rb") as config_file:
|
||||||
|
shutil.copyfileobj(config_file, temp_file)
|
||||||
|
temp_file.flush()
|
||||||
|
subprocess.check_call(["nginxfmt", temp_file.name])
|
||||||
|
editor = os.environ.get("EDITOR", "cat")
|
||||||
|
subprocess.check_call([editor, temp_file.name] + sys.argv[1:])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -15,9 +15,12 @@ in {
|
||||||
keepass
|
keepass
|
||||||
firefox
|
firefox
|
||||||
google-chrome
|
google-chrome
|
||||||
tor-browser-bundle-bin
|
|
||||||
|
|
||||||
|
# graphic
|
||||||
krita
|
krita
|
||||||
|
gthumb
|
||||||
|
digikam
|
||||||
|
shotwell
|
||||||
|
|
||||||
# kde programs
|
# kde programs
|
||||||
okular
|
okular
|
||||||
|
@ -25,12 +28,15 @@ in {
|
||||||
gwenview
|
gwenview
|
||||||
skanlite
|
skanlite
|
||||||
|
|
||||||
#(tor-browser-bundle-bin.overrideAttrs (old: {
|
#
|
||||||
# #version = "10.0.13";
|
#tor-browser-bundle-bin
|
||||||
|
#(tor-browser-bundle-bin.overrideAttrs (old: rec {
|
||||||
|
# version = "10.0.15";
|
||||||
|
# name = "tor-browser-bundle-${version}";
|
||||||
# src = pkgs.fetchurl {
|
# src = pkgs.fetchurl {
|
||||||
# url =
|
# url =
|
||||||
# "https://dist.torproject.org/torbrowser/10.0.13/tor-browser-linux64-10.0.13_en-US.tar.xz";
|
# "https://dist.torproject.org/torbrowser/10.0.15/tor-browser-linux64-10.0.15_en-US.tar.xz";
|
||||||
# sha256 = "1ncxacj1fprz2xlisd2w9qzajaqdq4yigk5qy0h40vm6zi5ll4ib";
|
# sha256 = "1ah69jmfgik063f9gkvyv9d4k706pqihmzc4k7cc95zyd17v8wrs";
|
||||||
# };
|
# };
|
||||||
#}))
|
#}))
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,7 +7,6 @@ in {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
||||||
tor-browser-bundle-bin
|
|
||||||
|
|
||||||
# bluetooth gui
|
# bluetooth gui
|
||||||
blueberry
|
blueberry
|
||||||
|
@ -34,6 +33,19 @@ in {
|
||||||
|
|
||||||
# foto
|
# foto
|
||||||
#fuji-cam-wifi-tool
|
#fuji-cam-wifi-tool
|
||||||
|
|
||||||
|
|
||||||
|
tor-browser-bundle-bin
|
||||||
|
#(tor-browser-bundle-bin.overrideAttrs (old: rec {
|
||||||
|
# version = "10.0.15";
|
||||||
|
# name = "tor-browser-bundle-${version}";
|
||||||
|
# src = pkgs.fetchurl {
|
||||||
|
# url =
|
||||||
|
# "https://dist.torproject.org/torbrowser/10.0.15/tor-browser-linux64-10.0.15_en-US.tar.xz";
|
||||||
|
# sha256 = "1ah69jmfgik063f9gkvyv9d4k706pqihmzc4k7cc95zyd17v8wrs";
|
||||||
|
# };
|
||||||
|
#}))
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.variables.RECIPE_HOME = "$HOME/mahlzeit";
|
environment.variables.RECIPE_HOME = "$HOME/mahlzeit";
|
||||||
|
|
|
@ -52,33 +52,17 @@ in {
|
||||||
|
|
||||||
terminal-tools = callPackage ./terminal-tools { };
|
terminal-tools = callPackage ./terminal-tools { };
|
||||||
|
|
||||||
# use upstream only for package tests
|
|
||||||
# memo = callPackage ./memo {};
|
|
||||||
|
|
||||||
sononym = callPackage ./sononym { };
|
sononym = callPackage ./sononym { };
|
||||||
sononym-crawler = callPackage ./sononym-crawler { };
|
sononym-crawler = callPackage ./sononym-crawler { };
|
||||||
|
|
||||||
castget = callPackage ./castget { };
|
castget = callPackage ./castget { };
|
||||||
|
|
||||||
#nixos-generators = callPackage (super.fetchgit {
|
|
||||||
# url = "https://github.com/nix-community/nixos-generators.git";
|
|
||||||
# # before flakes
|
|
||||||
# #rev = "5eb0cbe93bd1bcf134ec330c06b6f1e645de64c6";
|
|
||||||
# #sha256 = "0ghwy0xh7x7hwym8hzx95fj9yw8gxb4ffh56dn0p8a6scnlffci6";
|
|
||||||
# # with flaks
|
|
||||||
# #rev = "450f39121c45b93951c52874fe233455d007d3bc";
|
|
||||||
# #sha256 = "1iwc39hzvzzyndxwbnl3fck7phxnjpnhy8zn4nyp8is1fiw0648v";
|
|
||||||
#}) { };
|
|
||||||
|
|
||||||
radio-dj = callPackage (super.fetchgit {
|
radio-dj = callPackage (super.fetchgit {
|
||||||
url = "https://git.ingolf-wagner.de/crashburn_radio/radio_dj.git";
|
url = "https://git.ingolf-wagner.de/crashburn_radio/radio_dj.git";
|
||||||
rev = "0.1.5";
|
rev = "0.1.5";
|
||||||
sha256 = "04j6gcb6ayrcf7rxr0bkgd48zppiryhdyv7mvp0q12ngdkf2yagd";
|
sha256 = "04j6gcb6ayrcf7rxr0bkgd48zppiryhdyv7mvp0q12ngdkf2yagd";
|
||||||
}) { };
|
}) { };
|
||||||
|
|
||||||
#lektor = let
|
|
||||||
# python = import ./lektor-with-plugins/requirements.nix { pkgs = super.pkgs; };
|
|
||||||
#in
|
|
||||||
# python.packages.Lektor;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue