Akos Hadnagy commited on
Commit
7ca55d1
·
1 Parent(s): 8f08a1b

Update flake.nix

Browse files
Files changed (1) hide show
  1. flake.nix +54 -16
flake.nix CHANGED
@@ -1,24 +1,62 @@
1
  {
2
- description = "Flake for megablocks_moe kernel";
3
-
4
  inputs = {
5
- kernel-builder.url = "github:huggingface/kernel-builder/torch-2.8";
 
 
6
  };
7
-
8
  outputs =
9
  {
10
  self,
11
- kernel-builder,
 
 
12
  }:
13
- kernel-builder.lib.genFlakeOutputs {
14
- path = ./.;
15
- rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
- pythonCheckInputs = pkgs: with pkgs; [
18
- tqdm
19
- py-cpuinfo
20
- importlib-metadata
21
- torchmetrics
22
- ];
23
- };
24
- }
 
 
1
  {
 
 
2
  inputs = {
3
+ hf-nix.url = "github:huggingface/hf-nix/mktestdocs-0.2.5";
4
+ nixpkgs.follows = "hf-nix/nixpkgs";
5
+ flake-utils.url = "github:numtide/flake-utils";
6
  };
 
7
  outputs =
8
  {
9
  self,
10
+ nixpkgs,
11
+ flake-utils,
12
+ hf-nix,
13
  }:
14
+ flake-utils.lib.eachDefaultSystem (
15
+ system:
16
+ let
17
+ pkgs = import nixpkgs {
18
+ inherit system;
19
+ config = hf-nix.lib.config system;
20
+ overlays = [
21
+ hf-nix.overlays.default
22
+ ];
23
+ };
24
+ in
25
+ {
26
+ formatter = pkgs.nixfmt-tree;
27
+ devShells = with pkgs; rec {
28
+ default = mkShell {
29
+ nativeBuildInputs = [
30
+ # For hf-doc-builder.
31
+ nodejs
32
+ ];
33
+ buildInputs =
34
+ [
35
+ black
36
+ mypy
37
+ pyright
38
+ ruff
39
+ ]
40
+ ++ (with python3.pkgs; [
41
+ docutils
42
+ huggingface-hub
43
+ mktestdocs
44
+ pytest
45
+ pytest-benchmark
46
+ pyyaml
47
+ torch
48
+ types-pyyaml
49
+ venvShellHook
50
+ ]);
51
+
52
+ venvDir = "./.venv";
53
 
54
+ postVenvCreation = ''
55
+ unset SOURCE_DATE_EPOCH
56
+ ( python -m pip install --no-build-isolation --no-dependencies -e . )
57
+ '';
58
+ };
59
+ };
60
+ }
61
+ );
62
+ }