-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
534 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import ./make-test-python.nix { | ||
name = "mailman"; | ||
|
||
nodes.machine = { pkgs, ... }: { | ||
environment.systemPackages = with pkgs; [ mailutils ]; | ||
|
||
services.mailman.enable = true; | ||
services.mailman.serve.enable = true; | ||
services.mailman.siteOwner = "postmaster@example.com"; | ||
services.mailman.webHosts = [ "example.com" ]; | ||
|
||
services.postfix.enable = true; | ||
services.postfix.destination = [ "example.com" "example.net" ]; | ||
services.postfix.relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ]; | ||
services.postfix.config.local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" "proxy:unix:passwd.byname" ]; | ||
services.postfix.config.transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; | ||
|
||
users.users.user = { isNormalUser = true; }; | ||
|
||
virtualisation.memorySize = 2048; | ||
|
||
specialisation.restApiPassFileSystem.configuration = { | ||
services.mailman.restApiPassFile = "/var/lib/mailman/pass"; | ||
}; | ||
}; | ||
|
||
testScript = { nodes, ... }: let | ||
restApiPassFileSystem = "${nodes.machine.system.build.toplevel}/specialisation/restApiPassFileSystem"; | ||
in '' | ||
def check_mail(_) -> bool: | ||
status, _ = machine.execute("grep -q hello /var/spool/mail/user/new/*") | ||
return status == 0 | ||
def try_api(_) -> bool: | ||
status, _ = machine.execute("curl -s http://localhost:8001/") | ||
return status == 0 | ||
def wait_for_api(): | ||
with machine.nested("waiting for Mailman REST API to be available"): | ||
retry(try_api) | ||
machine.wait_for_unit("mailman.service") | ||
wait_for_api() | ||
with subtest("subscription and delivery"): | ||
creds = machine.succeed("su -s /bin/sh -c 'mailman info' mailman | grep '^REST credentials: ' | sed 's/^REST credentials: //'").strip() | ||
machine.succeed(f"curl --fail-with-body -sLSu {creds} -d mail_host=example.com http://localhost:8001/3.1/domains") | ||
machine.succeed(f"curl --fail-with-body -sLSu {creds} -d fqdn_listname=list@example.com http://localhost:8001/3.1/lists") | ||
machine.succeed(f"curl --fail-with-body -sLSu {creds} -d list_id=list.example.com -d subscriber=root@example.com -d pre_confirmed=True -d pre_verified=True -d send_welcome_message=False http://localhost:8001/3.1/members") | ||
machine.succeed(f"curl --fail-with-body -sLSu {creds} -d list_id=list.example.com -d subscriber=user@example.net -d pre_confirmed=True -d pre_verified=True -d send_welcome_message=False http://localhost:8001/3.1/members") | ||
machine.succeed("mail -a 'From: root@example.com' -s hello list@example.com < /dev/null") | ||
with machine.nested("waiting for mail from list"): | ||
retry(check_mail) | ||
with subtest("Postorius"): | ||
machine.succeed("curl --fail-with-body -sILS http://localhost/") | ||
with subtest("restApiPassFile"): | ||
machine.succeed("echo secretpassword > /var/lib/mailman/pass") | ||
machine.succeed("${restApiPassFileSystem}/bin/switch-to-configuration test >&2") | ||
machine.succeed("grep secretpassword /etc/mailman.cfg") | ||
machine.succeed("su -s /bin/sh -c 'mailman info' mailman | grep secretpassword") | ||
wait_for_api() | ||
machine.succeed("curl --fail-with-body -sLSu restadmin:secretpassword http://localhost:8001/3.1/domains") | ||
machine.succeed("curl --fail-with-body -sILS http://localhost/") | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
pkgs/applications/editors/vim/plugins/patches/coq_nvim/emulate-venv.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/coq/__main__.py b/coq/__main__.py | ||
index 5a6c6fd2..e0d9eec8 100644 | ||
--- a/coq/__main__.py | ||
+++ b/coq/__main__.py | ||
@@ -78,7 +78,7 @@ _EXEC_PATH = Path(executable) | ||
_EXEC_PATH = _EXEC_PATH.parent.resolve(strict=True) / _EXEC_PATH.name | ||
_REQ = REQUIREMENTS.read_text() | ||
|
||
-_IN_VENV = _RT_PY == _EXEC_PATH | ||
+_IN_VENV = True | ||
|
||
|
||
if command == "deps": | ||
@@ -152,7 +152,7 @@ elif command == "run": | ||
try: | ||
if not _IN_VENV: | ||
raise ImportError() | ||
- elif lock != _REQ: | ||
+ elif False: | ||
raise ImportError() | ||
else: | ||
import pynvim_pp | ||
diff --git a/coq/consts.py b/coq/consts.py | ||
index 5a027fe9..a3e0c5a4 100644 | ||
--- a/coq/consts.py | ||
+++ b/coq/consts.py | ||
@@ -9,7 +9,7 @@ TOP_LEVEL = Path(__file__).resolve(strict=True).parent.parent | ||
REQUIREMENTS = TOP_LEVEL / "requirements.txt" | ||
|
||
|
||
-VARS = TOP_LEVEL / ".vars" | ||
+VARS = Path.home() / ".cache/coq_nvim/vars" | ||
|
||
RT_DIR = VARS / "runtime" | ||
RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,54 @@ | ||
{ lib, stdenv, writeText, python3Packages, fetchFromGitHub, gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook, librsvg }: | ||
python3Packages.buildPythonPackage rec { | ||
{ lib | ||
, python3 | ||
, fetchFromGitHub | ||
, wrapGAppsHook | ||
, gobject-introspection | ||
, gitUpdater | ||
}: python3.pkgs.buildPythonApplication rec { | ||
pname = "KlipperScreen"; | ||
version = "0.3.2"; | ||
format = "other"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "jordanruthe"; | ||
repo = pname; | ||
repo = "KlipperScreen"; | ||
rev = "v${version}"; | ||
hash = "sha256-LweO5EVWr3OxziHrjtQDdWyUBCVUJ17afkw7RCZWgcg="; | ||
}; | ||
patches = [ ./fix-paths.diff ]; | ||
|
||
buildInputs = [ gtk3 librsvg ]; | ||
nativeBuildInputs = [ wrapGAppsHook gdk-pixbuf gobject-introspection ]; | ||
nativeBuildInputs = [ | ||
gobject-introspection | ||
wrapGAppsHook | ||
]; | ||
|
||
propagatedBuildInputs = with python3Packages; [ jinja2 netifaces requests websocket-client pycairo pygobject3 mpv six dbus-python numpy pycairo ]; | ||
pythonPath = with python3.pkgs; [ | ||
jinja2 | ||
netifaces | ||
requests | ||
websocket-client | ||
pycairo | ||
pygobject3 | ||
mpv | ||
six | ||
dbus-python | ||
]; | ||
|
||
preBuild = '' | ||
ln -s ${./setup.py} setup.py | ||
dontWrapGApps = true; | ||
|
||
preFixup = '' | ||
mkdir -p $out/bin | ||
cp -r . $out/dist | ||
gappsWrapperArgs+=(--set PYTHONPATH "$PYTHONPATH") | ||
wrapGApp $out/dist/screen.py | ||
ln -s $out/dist/screen.py $out/bin/KlipperScreen | ||
''; | ||
|
||
passthru.updateScript = gitUpdater { url = meta.homepage; }; | ||
|
||
meta = with lib; { | ||
description = "Touchscreen GUI for the Klipper 3D printer firmware"; | ||
homepage = "https://github.com/jordanruthe/${pname}"; | ||
homepage = "https://github.com/jordanruthe/KlipperScreen"; | ||
license = licenses.agpl3; | ||
maintainers = with maintainers; [ cab404 ]; | ||
}; | ||
} |
Oops, something went wrong.