-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
50 lines (44 loc) · 1.45 KB
/
flake.nix
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
42
43
44
45
46
47
48
49
50
{
description = "Scalable push server for XMPP";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, crane }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.mkLib pkgs;
commonArgs = {
src = craneLib.cleanCargoSource ./.;
buildInputs = [
pkgs.openssl
];
nativeBuildInputs = [
pkgs.pkg-config
];
};
in
{
packages.default = craneLib.buildPackage ({
meta = { mainProgram = "fpush"; };
cargoExtraArgs = "--all-features";
} // commonArgs);
devShells = {
default = pkgs.mkShell {
buildInputs = [ ] ++ commonArgs.buildInputs;
nativeBuildInputs = builtins.attrValues
{
inherit (pkgs) cargo rustc fmt cargo-udeps cargo-outdated cargo-audit;
} ++ [
# This is required to prevent a mangled bash shell in nix develop
# see: https://discourse.nixos.org/t/interactive-bash-with-nix-develop-flake/15486
(pkgs.hiPrio pkgs.bashInteractive)
] ++ commonArgs.nativeBuildInputs;
};
};
}
);
}