forked from Gerg-L/nvim-flake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
99 lines (93 loc) · 2.35 KB
/
Copy pathflake.nix
File metadata and controls
99 lines (93 loc) · 2.35 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
88
89
90
91
92
93
94
95
96
97
98
99
{
inputs = {
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz";
neovim-nightly = {
type = "github";
owner = "nix-community";
repo = "neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
mnw = {
type = "github";
owner = "gerg-l";
repo = "mnw";
};
systems = {
type = "github";
owner = "nix-systems";
repo = "default";
};
};
outputs =
{
self,
nixpkgs,
mnw,
systems,
...
}@inputs:
let
eachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
#
# Linter and formatter, run with "nix fmt"
# You can use alejandra or nixpkgs-fmt instead of nixfmt if you wish
#
formatter = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.writeShellApplication {
name = "format";
runtimeInputs = builtins.attrValues {
inherit (pkgs)
nixfmt
deadnix
statix
fd
stylua
;
};
text = ''
fd "$@" -t f -e nix -x statix fix -- '{}'
fd "$@" -t f -e nix -X deadnix -e -- '{}' \; -X nixfmt '{}'
fd "$@" -t f -e lua -X stylua --indent-type Spaces --indent-width 2 '{}'
'';
}
);
devShells = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShellNoCC {
packages = [
pkgs.npins
(pkgs.writeShellScriptBin "opt" ''
npins --lock-file opt.json "$@"
'')
(pkgs.writeShellScriptBin "start" ''
npins --lock-file start.json "$@"
'')
];
};
}
);
packages = eachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = self.packages.${system}.neovim;
dev = self.packages.${system}.default.devMode;
inherit (self.packages.${system}.default) configDir;
blink-cmp = pkgs.callPackage ./packages/blink-cmp/package.nix { };
neovim = mnw.lib.wrap { inherit pkgs inputs; } ./config.nix;
}
);
};
}