diff --git a/packages/open-browser/default.nix b/packages/open-browser/default.nix index b7c42339..0bdbe8f3 100644 --- a/packages/open-browser/default.nix +++ b/packages/open-browser/default.nix @@ -5,9 +5,12 @@ python3.pkgs.buildPythonApplication rec { pname = "open-browser"; version = "0.1"; + format = "pyproject"; src = ./.; + propagatedBuildInputs = with python3.pkgs; [ setuptools ]; + desktopItem = makeDesktopItem { categories = [ "Application" diff --git a/packages/open-browser/open-browser b/packages/open-browser/open_browser.py similarity index 98% rename from packages/open-browser/open-browser rename to packages/open-browser/open_browser.py index e9eeb4c2..26d01fd3 100755 --- a/packages/open-browser/open-browser +++ b/packages/open-browser/open_browser.py @@ -48,7 +48,7 @@ def get_url_map(config_path): return {} -def main(argv): +def main(argv = sys.argv): url = argv[-1] url_map = get_url_map(CONFIG_PATH) browser = get_browser_for_url(url, url_map) diff --git a/packages/open-browser/pyproject.toml b/packages/open-browser/pyproject.toml new file mode 100644 index 00000000..702f6744 --- /dev/null +++ b/packages/open-browser/pyproject.toml @@ -0,0 +1,12 @@ +[build-system] +requires = ["setuptools>=61.0.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "open-browser" +version = "0.1" +description = "Open browser according to user preference" +requires-python = ">=3.9" + +[project.scripts] +open-browser = "open_browser:main" diff --git a/packages/open-browser/setup.py b/packages/open-browser/setup.py deleted file mode 100644 index 0cc6a5cc..00000000 --- a/packages/open-browser/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -import setuptools - -setuptools.setup( - name="open-browser", - version="0.1", - description="Open browser according to user preference", - scripts=["open-browser"], -)