-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
41 lines (35 loc) · 1.17 KB
/
flake.nix
File metadata and controls
41 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
description = "Robostart FRC Robot Project Initializer";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
naersk.url = "github:nix-community/naersk";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ ... }: {
systems = import inputs.systems;
perSystem = { pkgs, self', ... }: let
naerskLib = pkgs.callPackage inputs.naersk {};
basePackage = release: naerskLib.buildPackage {
src = ./.;
inherit release;
buildInputs = [ pkgs.openssl ];
nativeBuildInputs = [ pkgs.pkg-config ];
};
in {
packages.dev = basePackage false;
packages.robostart = basePackage true;
packages.default = self'.packages.robostart;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rustup
openssl
cargo-deb
];
nativeBuildInputs = [ pkgs.pkg-config ];
env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
};
});
}