Add desktop item and icon, format flake code
This commit is contained in:
37
flake.nix
37
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;
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user