Compare commits

...

2 Commits

Author SHA1 Message Date
f0630c4a63 package.nix: fixed pname 2025-01-01 15:23:48 -05:00
1e336db1a9 package.nix: added desktop menu entry 2025-01-01 15:22:49 -05:00
2 changed files with 53 additions and 24 deletions

View File

@ -3,26 +3,26 @@
outputs = outputs =
{ self, nixpkgs, nix, }: { self, nixpkgs, nix, }:
let let
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
forEachSystem = nixpkgs.lib.genAttrs systems; forEachSystem = nixpkgs.lib.genAttrs systems;
overlayList = [ self.overlays.default ]; overlayList = [ self.overlays.default ];
pkgsBySystem = forEachSystem ( pkgsBySystem = forEachSystem (
system: system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
overlays = overlayList; overlays = overlayList;
} }
); );
in in
rec { rec {
overlays.default = final: prev: { invoiceninja-desktop = final.callPackage ./package.nix { }; }; overlays.default = final: prev: { invoiceninja-desktop = final.callPackage ./package.nix { }; };
packages = forEachSystem (system: { packages = forEachSystem (system: {
invoiceninja-desktop = pkgsBySystem.${system}.invoiceninja-desktop; invoiceninja-desktop = pkgsBySystem.${system}.invoiceninja-desktop;
default = pkgsBySystem.${system}.invoiceninja-desktop; default = pkgsBySystem.${system}.invoiceninja-desktop;
}); });
}; };
} }

View File

@ -1,6 +1,26 @@
{ lib, fetchFromGitHub, flutter319 }: { lib
, makeDesktopItem
, copyDesktopItems
, wrapGAppsHook3
, fetchFromGitHub
, flutter319
}:
let let
desktopFile = makeDesktopItem rec {
name = "Invoice Ninja";
desktopName = name;
exec = "invoiceninja";
icon = "invoiceninja";
startupWMClass = "invoiceninja";
categories = [ "Office" ];
terminal = false;
extraConfig = {
X-MultipleArgs = "false";
};
};
in flutter319.buildFlutterApplication rec {
version = "5.0.172"; version = "5.0.172";
src = fetchFromGitHub { src = fetchFromGitHub {
@ -10,10 +30,7 @@ let
hash = "sha256-yYGGmF0XiixDi/OuLdlKwN685BUsxcIFzIqXkJi4KMs="; hash = "sha256-yYGGmF0XiixDi/OuLdlKwN685BUsxcIFzIqXkJi4KMs=";
}; };
in flutter319.buildFlutterApplication { pname = "invoiceninja-desktop";
inherit version src;
pname = "invoice-ninja-desktop";
targetFlutterPlatform = "linux"; targetFlutterPlatform = "linux";
@ -29,10 +46,22 @@ in flutter319.buildFlutterApplication {
super_text_layout = "sha256-SGWTs2zHObYAC8J/LdtdmoDtI/EQZr0fJoYMpGcyGWE="; super_text_layout = "sha256-SGWTs2zHObYAC8J/LdtdmoDtI/EQZr0fJoYMpGcyGWE=";
}; };
nativeBuildInputs = [
copyDesktopItems
wrapGAppsHook3
];
postUnpack = '' postUnpack = ''
mv $sourceRoot/lib/.env.dart.example $sourceRoot/lib/.env.dart mv $sourceRoot/lib/.env.dart.example $sourceRoot/lib/.env.dart
''; '';
postInstall = ''
mkdir -p $out/share/icons
mv $out/app/invoice-ninja-desktop/data/flutter_assets/assets/images/icon.png $out/share/icons/invoiceninja.png
'';
desktopItems = [ desktopFile ];
meta = { meta = {
description = "Invoice Ninja desktop client"; description = "Invoice Ninja desktop client";
homepage = "https://github.com/invoiceninja/admin-portal"; homepage = "https://github.com/invoiceninja/admin-portal";