-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
55 lines (52 loc) · 1.57 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
{
inputs.nixpkgs.url = "nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nur.url = "github:nix-community/NUR";
outputs = { self, flake-utils, nixpkgs, nur }: flake-utils.lib.eachDefaultSystem (system: let
nur-no-packages = import nur {
nurpkgs = import nixpkgs { inherit system; };
};
pkgs = import nixpkgs {
inherit system;
overlays = with nur-no-packages.repos.shados.overlays; [
lua-overrides
lua-packages
];
config.allowUnfree = true;
};
luaDeps = ps: with ps; [ inspect rapidjson lcmark ];
luaPkg = pkgs.luajit.withPackages luaDeps;
luaPkgs = luaPkg.pkgs;
optionsFile = pkgs.writeText "nv-options.json" nvModule.lib.optionsJSON;
nvModule = import ./loaded-module.nix { nixpkgs = pkgs; };
in {
devShell = pkgs.mkShell {
nativeBuildInputs = self.packages.${system}.manual.nativeBuildInputs ++ [
luaPkg
pkgs.niv
];
inherit optionsFile;
shellHook = ''
export LUA_PATH="${luaPkgs.getLuaPath luaPkg}"
export LUA_CPATH="${luaPkgs.getLuaCPath luaPkg}"
'';
};
packages.default = self.packages.${system}.manual;
packages.manual = pkgs.stdenv.mkDerivation {
name = "envy-manual";
src = ./.;
nativeBuildInputs = with pkgs; [
gnumake
luaPkgs.moonscript
mdbook
];
inherit optionsFile;
installPhase = ''
cp -r docs $out
'';
};
}) // {
homeModules.default = import ./home-manager.nix;
nixosModules.default = import ./nixos.nix;
};
}