2021-11-24 13:43:20 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2023-07-03 13:54:33 +02:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2021-11-24 13:43:20 +01:00
|
|
|
naersk = {
|
|
|
|
url = "github:nmattia/naersk/master";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-07-03 13:54:33 +02:00
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2021-11-24 13:43:20 +01:00
|
|
|
};
|
|
|
|
|
2023-07-03 13:54:33 +02:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
flake-utils,
|
|
|
|
naersk,
|
|
|
|
rust-overlay,
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
overlays = [(import rust-overlay)];
|
|
|
|
pkgs = import nixpkgs {inherit system overlays;};
|
|
|
|
naersk-lib = pkgs.callPackage naersk {};
|
|
|
|
|
|
|
|
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
rustToolchain
|
|
|
|
pkgs.libpulseaudio.dev
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.pkgconf
|
|
|
|
];
|
|
|
|
in rec {
|
|
|
|
packages.pamedia = naersk-lib.buildPackage {
|
|
|
|
inherit buildInputs nativeBuildInputs;
|
|
|
|
|
|
|
|
root = ./.;
|
|
|
|
pname = "pamedia";
|
|
|
|
};
|
|
|
|
packages.default = packages.pamedia;
|
|
|
|
|
|
|
|
defaultApp = flake-utils.lib.mkApp {
|
|
|
|
drv = self.defaultPackage."${system}";
|
|
|
|
};
|
|
|
|
|
|
|
|
overlays = final: prev: {
|
|
|
|
pamedia = packages.pamedia;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShell = with pkgs;
|
|
|
|
mkShell {
|
|
|
|
buildInputs = [cargo rustc rustfmt pre-commit rustPackages.clippy cargo-edit cargo-feature cargo-outdated rust-analyzer] ++ buildInputs;
|
|
|
|
nativeBuildInputs = [libnotify] ++ nativeBuildInputs;
|
2021-11-24 13:43:20 +01:00
|
|
|
};
|
2023-07-03 13:54:33 +02:00
|
|
|
});
|
2021-11-24 13:43:20 +01:00
|
|
|
}
|