-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
72 lines (62 loc) · 2.12 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
outputs = {
self,
parts,
...
} @ inputs:
parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
imports = [./plugins ./bin];
perSystem = {
self',
pkgs,
npins,
inputs',
...
}: {
_module.args.npins = import ./npins;
_module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend inputs.gen-luarc.overlays.default;
formatter = pkgs.writeShellScriptBin "formatter" ''
export PATH=${pkgs.lib.makeBinPath [pkgs.alejandra inputs'.nixpkgs-emmy.legacyPackages.emmy-lua-code-style]}:$PATH
alejandra .
CodeFormat format -w . -ig .direnv -c ${self}/.editorconfig
'';
packages.md-oxide = pkgs.callPackage ./pkgs/oxide.nix {inherit npins;};
packages.neovim = pkgs.callPackage ./nvim.nix {inherit npins self';};
packages.default = self'.packages.neovim;
devShells.default = let
emmy-lua-code-style = inputs'.nixpkgs-emmy.legacyPackages.emmy-lua-code-style.overrideAttrs (_: {
src = npins.emmy-style;
});
in
pkgs.mkShell {
packages = builtins.attrValues {
inherit (pkgs) nil stylua npins alejandra;
inherit (self'.packages) neovim;
inherit emmy-lua-code-style;
};
shellHook = let
luarc = pkgs.mk-luarc-json {
nvim = self'.packages.neovim.unwrapped;
plugins = self'.packages.neovim.packpathDirs.myNeovimPackages.start;
};
in
/*
bash
*/
''
ln -fs ${luarc} .luarc.json
'';
};
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
nixpkgs-emmy.url = "github:NixOS/nixpkgs?ref=pull/323401/head";
parts.url = "github:hercules-ci/flake-parts";
parts.inputs.nixpkgs-lib.follows = "nixpkgs";
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
gen-luarc.inputs.nixpkgs.follows = "nixpkgs";
gen-luarc.inputs.flake-parts.follows = "parts";
};
}