Cleaned up flake.nix
This commit is contained in:
parent
de02797144
commit
dd2894089a
1 changed files with 24 additions and 25 deletions
49
flake.nix
49
flake.nix
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue