romodoro/flake.nix

81 lines
1.7 KiB
Nix
Raw Normal View History

2024-05-21 19:51:46 +02:00
{
2024-09-25 03:56:42 +02:00
description = "Romodoro flake";
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
crane.url = "github:ipetkov/crane";
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
flake-utils.url = "github:numtide/flake-utils";
};
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
outputs = { self, nixpkgs, crane, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.mkLib pkgs;
commonArgs = {
src = craneLib.cleanCargoSource ./.;
strictDeps = true;
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
nativeBuildInputs = with pkgs;[
pkg-config
alsa-oss
alsa-lib.dev
alsa-utils
git
cmake
];
buildInputs = with pkgs;[
alsa-oss
alsa-lib.dev
alsa-utils
git
pkg-config
git
cmake
];
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
};
romodoro = craneLib.buildPackage (commonArgs // {
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
2024-05-21 19:51:46 +02:00
});
2024-09-25 03:56:42 +02:00
in
{
checks = {
inherit romodoro;
};
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
packages.default = romodoro;
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
apps.default = flake-utils.lib.mkApp {
drv = romodoro;
};
2024-05-21 19:51:46 +02:00
2024-09-25 03:56:42 +02:00
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
checks = self.checks.${system};
LIBCLANG_PATH = "${pkgs.llvmPackages_17.libclang.lib}/lib";
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
packages = with pkgs; [
openssl
pkg-config
libiconv
alsa-oss
alsa-lib.dev
alsa-utils
git
pkg-config
git
cmake
];
};
});
}