ha-now-playing/flake.nix

53 lines
1.3 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
naersk = {
url = "github:nmattia/naersk/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
buildInputs = [
pkgs.openssl
];
nativeBuildInputs = [
pkgs.pkg-config
];
in
rec {
packages.ha-now-playing = naersk-lib.buildPackage
{
inherit buildInputs nativeBuildInputs;
pname = "ha-now-playing";
root = ./.;
};
defaultPackage = packages.ha-now-playing;
apps.ha-now-playing = utils.lib.mkApp {
drv = self.defaultPackage."${system}";
};
defaultApp = apps.ha-now-playing;
overlays = final: prev: {
ha-now-playing = packages.ha-now-playing;
};
devShell = with pkgs; mkShell {
inherit nativeBuildInputs;
buildInputs = [ cargo cargo-edit cargo-diet cargo-feature cargo-outdated rustc rustfmt pre-commit rustPackages.clippy ] ++ buildInputs;
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}