Cleaned up flake.nix

This commit is contained in:
Erwin Boskma 2021-11-23 14:23:12 +01:00
parent de02797144
commit dd2894089a
Signed by: erwin
GPG key ID: 270B20D17394F7E5

View file

@ -10,33 +10,26 @@
};
outputs = { self, nixpkgs, utils, naersk }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ naersk.overlay ]; };
naersk-lib = pkgs.naersk;
in
rec {
overlay = nixpkgs.lib.composeManyExtensions [
(final: prev: {
ha-now-playing = naersk-lib.buildPackage
{
pname = "ha-now-playing";
root = ./.;
buildInputs = [
prev.openssl
];
nativeBuildInputs = [
prev.pkg-config
];
};
})
];
} // utils.lib.eachDefaultSystem (system:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
buildInputs = [
pkgs.openssl
];
nativeBuildInputs = [
pkgs.pkg-config
];
in
rec {
packages.ha-now-playing = pkgs.ha-now-playing;
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 {
@ -44,8 +37,14 @@
};
defaultApp = apps.ha-now-playing;
overlays = final: prev: {
ha-now-playing = packages.ha-now-playing;
};
devShell = with pkgs; mkShell {
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy ];
inherit nativeBuildInputs;
buildInputs = [ cargo cargo-edit cargo-diet cargo-feature cargo-outdated rustc rustfmt pre-commit rustPackages.clippy ] ++ buildInputs;
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};