diff --git a/flake.nix b/flake.nix index 86e9cd8..8e1ca2d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,8 +5,15 @@ utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, utils, naersk }: - utils.lib.eachDefaultSystem (system: + outputs = + { + self, + nixpkgs, + utils, + naersk, + }: + utils.lib.eachDefaultSystem ( + system: let pkgs = import nixpkgs { inherit system; }; naersk-lib = pkgs.callPackage naersk { }; @@ -22,20 +29,36 @@ ]; # Needed at runtime (on run system) buildInputs = with pkgs; [ ]; - in rec { + in + rec { defaultPackage = naersk-lib.buildPackage { src = ./.; inherit buildInputs; inherit nativeBuildInputs; + + postInstall = '' + mkdir -p $out/share/applications + cp ${./music-reader.desktop} $out/share/applications/music-reader.desktop + + mkdir -p $out/share/icons + cp ${./music-reader.png} $out/share/icons/music-reader.png + ''; }; - devShell = with pkgs; + devShell = + with pkgs; mkShell { - buildInputs = - [ cargo rustc rustfmt pre-commit rustPackages.clippy ]; + buildInputs = [ + cargo + rustc + rustfmt + pre-commit + rustPackages.clippy + ]; # Without inheriting nativeBuildinputs, cargo build will fail but that is good since we want to use only nix build # inherit nativeBuildInputs; RUST_SRC_PATH = rustPlatform.rustLibSrc; }; - }); + } + ); } diff --git a/music-reader.desktop b/music-reader.desktop new file mode 100644 index 0000000..7d26506 --- /dev/null +++ b/music-reader.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Terminal=false +Name=Music Reader +Icon=music-reader +Categories=Viewer;Utility; +Keywords=viewer;document;pdf; +Exec=music-reader %F +MimeType=application/pdf; diff --git a/music-reader.png b/music-reader.png new file mode 100644 index 0000000..08020ab Binary files /dev/null and b/music-reader.png differ