2024-11-07 20:18:49 +01:00
|
|
|
{
|
|
|
|
description = "Flake for servicepoint-simulator";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
inputs@{ self, nixpkgs }:
|
2024-11-07 20:34:52 +01:00
|
|
|
let
|
2024-11-07 23:24:41 +01:00
|
|
|
lib = nixpkgs.lib;
|
|
|
|
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages = forAllSystems (
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.rustPlatform.buildRustPackage {
|
|
|
|
pname = "servicepoint-simulator";
|
|
|
|
version = "0.0.1";
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
allowBuiltinFetchGit = true;
|
|
|
|
};
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
src = ./.;
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
nativeBuildInputs = with pkgs; [ pkg-config ];
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
buildInputs =
|
|
|
|
with pkgs;
|
|
|
|
[
|
|
|
|
xe
|
|
|
|
lzma
|
|
|
|
]
|
|
|
|
++ (lib.optionals pkgs.stdenv.isLinux (
|
|
|
|
with pkgs;
|
|
|
|
[
|
|
|
|
xorg.libxkbfile
|
|
|
|
wayland
|
|
|
|
libxkbcommon
|
|
|
|
]
|
|
|
|
));
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "";
|
|
|
|
description = "";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2024-11-07 20:34:52 +01:00
|
|
|
|
|
|
|
legacyPackages = packages;
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
devShells = forAllSystems (
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
inputsFrom = [ self.packages.${system}.default ];
|
|
|
|
packages = with pkgs; [
|
|
|
|
rustfmt
|
|
|
|
cargo-expand
|
|
|
|
];
|
|
|
|
#LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath buildInputs}";
|
|
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2024-11-07 20:18:49 +01:00
|
|
|
|
2024-11-07 23:24:41 +01:00
|
|
|
formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style);
|
2024-11-07 20:18:49 +01:00
|
|
|
};
|
|
|
|
}
|