]> git.scottworley.com Git - nix-env-apps/blobdiff - default.nix
Remove stray ( from documentation example of env template
[nix-env-apps] / default.nix
index ad68b48de9755dd8a7535f4c845eb17a94ff8e19..845dc8b685e3ef0894e9587c2ea68e061c52aa65 100644 (file)
@@ -1,27 +1,67 @@
-{ pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage ({ autopep8, buildPythonPackage
-  , gobject-introspection, gtk4, lib, mypy, pylint, pygobject3, wrapGAppsHook4,
+{
+  pkgs ? import <nixpkgs> { },
+  lint ? false,
+}:
+pkgs.python3Packages.callPackage (
+  {
+    autopep8,
+    buildPythonPackage,
+    gobject-introspection,
+    gtk4,
+    lib,
+    makeDesktopItem,
+    mypy,
+    pylint,
+    pygobject3,
+    setuptools,
+    wrapGAppsHook4,
   }:
   buildPythonPackage rec {
     pname = "apps";
-    version = "1.0.0";
+    version = "1.0.2";
 
     src = lib.cleanSource ./.;
 
+    pyproject = true;
+    build-system = [ setuptools ];
+
     doCheck = true;
     checkPhase = "./test.sh";
 
-    nativeBuildInputs = [ gobject-introspection wrapGAppsHook4 ];
-    nativeCheckInputs = [ mypy ] ++ lib.optionals lint [ autopep8 pylint ];
+    nativeBuildInputs = [
+      gobject-introspection
+      wrapGAppsHook4
+    ];
+    nativeCheckInputs = [
+      mypy
+    ]
+    ++ lib.optionals lint [
+      autopep8
+      pylint
+    ];
     buildInputs = [ gtk4 ];
     pythonPath = [ pygobject3 ];
 
+    postInstall = ''
+      cp -r $desktopItem/share $out
+    '';
+
+    desktopItem = makeDesktopItem {
+      name = "Apps";
+      exec = "apps";
+      icon = ./apps.png;
+      comment = "Configure nix-env Apps";
+      desktopName = "Apps";
+      genericName = "Configure Apps";
+      categories = [ "Settings" ];
+    };
+
     meta = {
-      description =
-        "A simple GUI for managing declarative nix-env user environments";
+      description = "A simple GUI for managing declarative nix-env user environments";
       homepage = "https://git.scottworley.com/nix-env-apps";
       license = pkgs.lib.licenses.gpl3;
       maintainers = with pkgs.lib.maintainers; [ chkno ];
     };
 
-  }) { }
+  }
+) { }