nextcompanion/flake.nix
2026-03-10 23:25:26 +01:00

47 lines
1.2 KiB
Nix

{
description = "NextCompanion a minimal GTK4 Nextbike client for Linux";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay, ... }:
let
system = "x86_64-linux";
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
runtimeDeps = with pkgs; [
gtk4
libadwaita
glib
];
buildDeps = with pkgs; [
pkg-config
rust-bin.stable.latest.default
];
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = buildDeps ++ runtimeDeps;
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath runtimeDeps}:$LD_LIBRARY_PATH"
'';
};
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
pname = "next-companion";
version = "0.1.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = buildDeps;
buildInputs = runtimeDeps;
};
apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/next-companion";
};
};
}