Add desktop item and icon, format flake code
This commit is contained in:
parent
7110054836
commit
c8795588d8
37
flake.nix
37
flake.nix
@ -5,8 +5,15 @@
|
|||||||
utils.url = "github:numtide/flake-utils";
|
utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, utils, naersk }:
|
outputs =
|
||||||
utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
utils,
|
||||||
|
naersk,
|
||||||
|
}:
|
||||||
|
utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
naersk-lib = pkgs.callPackage naersk { };
|
naersk-lib = pkgs.callPackage naersk { };
|
||||||
@ -22,20 +29,36 @@
|
|||||||
];
|
];
|
||||||
# Needed at runtime (on run system)
|
# Needed at runtime (on run system)
|
||||||
buildInputs = with pkgs; [ ];
|
buildInputs = with pkgs; [ ];
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
defaultPackage = naersk-lib.buildPackage {
|
defaultPackage = naersk-lib.buildPackage {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
inherit buildInputs;
|
inherit buildInputs;
|
||||||
inherit nativeBuildInputs;
|
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 {
|
mkShell {
|
||||||
buildInputs =
|
buildInputs = [
|
||||||
[ cargo rustc rustfmt pre-commit rustPackages.clippy ];
|
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
|
# Without inheriting nativeBuildinputs, cargo build will fail but that is good since we want to use only nix build
|
||||||
# inherit nativeBuildInputs;
|
# inherit nativeBuildInputs;
|
||||||
|
|
||||||
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
9
music-reader.desktop
Normal file
9
music-reader.desktop
Normal file
@ -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;
|
BIN
music-reader.png
Normal file
BIN
music-reader.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 488 KiB |
Loading…
x
Reference in New Issue
Block a user