servicepoint-simulator/flake.nix

85 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2024-11-07 20:18:49 +01:00
{
description = "Flake for servicepoint-simulator";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
2024-11-09 20:42:13 +01:00
nix-filter.url = "github:numtide/nix-filter";
2024-11-09 18:53:11 +01:00
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-11-07 20:18:49 +01:00
};
outputs =
2024-11-09 18:53:11 +01:00
inputs@{
self,
nixpkgs,
naersk,
2024-11-09 20:04:44 +01:00
nix-filter,
2024-11-09 18:53:11 +01:00
}:
2024-11-07 20:34:52 +01:00
let
2024-11-07 23:24:41 +01:00
lib = nixpkgs.lib;
2024-11-09 18:53:11 +01:00
supported-systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
2025-01-26 14:29:44 +01:00
forAllSystems =
f:
lib.genAttrs supported-systems (
system:
f rec {
pkgs = nixpkgs.legacyPackages.${system};
inherit system;
}
);
2024-11-07 23:24:41 +01:00
in
rec {
packages = forAllSystems (
2025-01-26 14:29:44 +01:00
{ pkgs, ... }:
2024-11-09 18:53:11 +01:00
rec {
2025-01-26 14:29:44 +01:00
servicepoint-simulator = import ./servicepoint-simulator.nix {
inherit nix-filter pkgs;
naersk' = pkgs.callPackage naersk { };
2024-11-07 23:24:41 +01:00
};
2024-11-09 18:53:11 +01:00
default = servicepoint-simulator;
2024-11-07 23:24:41 +01:00
}
);
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 (
2025-01-26 14:29:44 +01:00
{
pkgs,
system,
}:
2024-11-07 23:24:41 +01:00
{
2024-11-09 18:53:11 +01:00
default = pkgs.mkShell rec {
2024-11-07 23:24:41 +01:00
inputsFrom = [ self.packages.${system}.default ];
2025-01-26 14:29:44 +01:00
packages = [
pkgs.gdb
(pkgs.symlinkJoin {
name = "rust-toolchain";
paths = with pkgs; [
rustc
cargo
rustPlatform.rustcSrc
rustfmt
clippy
cargo-expand
];
})
];
2024-11-09 20:42:13 +01:00
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (builtins.concatMap (d: d.buildInputs) inputsFrom)}";
2025-01-26 14:29:44 +01:00
NIX_LD_LIBRARY_PATH = LD_LIBRARY_PATH;
NIX_LD = pkgs.stdenv.cc.bintools.dynamicLinker;
2024-11-07 23:24:41 +01:00
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
}
);
2024-11-07 20:18:49 +01:00
2025-01-26 14:29:44 +01:00
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
2024-11-07 20:18:49 +01:00
};
}