ha-now-playing/flake.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

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