-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (60 loc) · 1.75 KB
/
flake.nix
File metadata and controls
61 lines (60 loc) · 1.75 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/develop";
nixpkgs.follows = "nix-ros-overlay/nixpkgs";
systems.follows = "nix-ros-overlay/flake-utils/systems";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
{ lib, ... }:
let
flakeModule = inputs.flake-parts.lib.importApply ./module {
inherit (inputs) nixpkgs nix-ros-overlay;
};
in
{
systems = import inputs.systems;
flake = {
inherit flakeModule;
lib = import ./lib { inherit lib; } // {
/**
Shortcut for flake-parts.lib.mkFlake
*/
mkFlakoboros =
localInputs: module:
inputs.flake-parts.lib.mkFlake { inputs = localInputs; } (args: {
systems = import inputs.systems;
imports = [
flakeModule
{ flakoboros = module args; }
];
});
};
};
imports = [
inputs.treefmt-nix.flakeModule
flakeModule
];
perSystem =
{ pkgs, system, ... }:
{
packages = { inherit (pkgs) nixdoc; };
treefmt = {
# workaround https://github.com/numtide/treefmt-nix/issues/352
pkgs = inputs.nixpkgs.legacyPackages.${system};
programs = {
deadnix.enable = true;
keep-sorted.enable = true;
nixfmt.enable = true;
};
};
};
}
);
}