-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
36 lines (36 loc) · 993 Bytes
/
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
{
description = "A `flake-parts` module for Rust development";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.flake = false;
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { rust-overlay, crane, ... }:
let
# Preserve name and key of the module file for dedup and error message locations
import' =
modulePath: staticArg:
{
key = toString modulePath;
_file = toString modulePath;
imports = [ (import modulePath staticArg) ];
};
in
{
flakeModules = {
default = import' ./nix/modules/flake-module.nix { inherit rust-overlay crane; };
nixpkgs = ./nix/modules/nixpkgs.nix;
};
nixci.default =
let
overrideInputs = {
rust-flake = ./.;
};
in
{
dev = { inherit overrideInputs; dir = "dev"; };
};
};
}