-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
87 lines (81 loc) · 2.16 KB
/
flake.nix
File metadata and controls
87 lines (81 loc) · 2.16 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
description = "A nix flake for rustowl";
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs"
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rustowl = {
url = "github:cordx56/rustowl";
flake = false;
};
rust-overlay.url = "github:oxalica/rust-overlay";
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = builtins.attrNames nixpkgs.legacyPackages;
perSystem = attrs @ {
system,
pkgs,
...
}: let
pkgs = attrs.pkgs.extend self.overlays.default;
git-hooks-check = inputs.git-hooks.lib.${system}.run {
src = self;
hooks = {
alejandra.enable = true;
editorconfig-checker.enable = true;
};
};
in {
# use rust-overlay
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [self.overlays.default];
};
packages = with pkgs; {
default = rustowl;
inherit
rustowl
rustowl-nvim
;
};
devShells.default = pkgs.mkShell {
name = "rustowl-flake devShell";
inherit (git-hooks-check) shellHook;
buildInputs = self.checks.${system}.git-hooks-check.enabledPackages;
};
checks = rec {
default = git-hooks-check;
inherit
git-hooks-check
;
};
};
flake = {
overlays = rec {
default = rustowl-with-rust-overlay;
rustowl = import ./nix/overlay.nix {inherit self inputs;};
rustowl-with-rust-overlay = nixpkgs.lib.composeManyExtensions [
(import inputs.rust-overlay)
self.overlays.rustowl
];
};
};
};
}