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
|
||||
firefox
|
||||
google-chrome
|
||||
tor-browser-bundle-bin
|
||||
|
||||
# graphic
|
||||
krita
|
||||
gthumb
|
||||
digikam
|
||||
shotwell
|
||||
|
||||
# kde programs
|
||||
okular
|
||||
|
@ -25,12 +28,15 @@ in {
|
|||
gwenview
|
||||
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 {
|
||||
# url =
|
||||
# "https://dist.torproject.org/torbrowser/10.0.13/tor-browser-linux64-10.0.13_en-US.tar.xz";
|
||||
# sha256 = "1ncxacj1fprz2xlisd2w9qzajaqdq4yigk5qy0h40vm6zi5ll4ib";
|
||||
# "https://dist.torproject.org/torbrowser/10.0.15/tor-browser-linux64-10.0.15_en-US.tar.xz";
|
||||
# sha256 = "1ah69jmfgik063f9gkvyv9d4k706pqihmzc4k7cc95zyd17v8wrs";
|
||||
# };
|
||||
#}))
|
||||
];
|
||||
|
|
|
@ -7,7 +7,6 @@ in {
|
|||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
tor-browser-bundle-bin
|
||||
|
||||
# bluetooth gui
|
||||
blueberry
|
||||
|
@ -34,6 +33,19 @@ in {
|
|||
|
||||
# foto
|
||||
#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";
|
||||
|
|
|
@ -52,33 +52,17 @@ in {
|
|||
|
||||
terminal-tools = callPackage ./terminal-tools { };
|
||||
|
||||
# use upstream only for package tests
|
||||
# memo = callPackage ./memo {};
|
||||
|
||||
sononym = callPackage ./sononym { };
|
||||
sononym-crawler = callPackage ./sononym-crawler { };
|
||||
|
||||
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 {
|
||||
url = "https://git.ingolf-wagner.de/crashburn_radio/radio_dj.git";
|
||||
rev = "0.1.5";
|
||||
sha256 = "04j6gcb6ayrcf7rxr0bkgd48zppiryhdyv7mvp0q12ngdkf2yagd";
|
||||
}) { };
|
||||
|
||||
#lektor = let
|
||||
# python = import ./lektor-with-plugins/requirements.nix { pkgs = super.pkgs; };
|
||||
#in
|
||||
# python.packages.Lektor;
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue