forked from ryanccn/osmosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
99 lines (93 loc) · 2.56 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
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
{
description = "An experimental Stable Diffusion frontend";
# this allows us to use nixified-ai's and our own cachix instance
# so we don't have to rebuild all the time :)
nixConfig = {
extra-substituters = [
"https://ai.cachix.org"
"https://osmosis.cachix.org"
];
extra-trusted-public-keys = [
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
"osmosis.cachix.org-1:mq0PbolVaW/p61SJvxfXbq6UkEmkWg6xdLL3uUPrr9g="
];
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
nixified-ai = {
url = "github:nixified-ai/flake";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
nixified-ai,
pre-commit-hooks,
...
}: let
version = builtins.substring 0 8 self.lastModifiedDate;
inherit (flake-utils.lib) eachDefaultSystem;
packageFn = pkgs:
import ./nix {
inherit pkgs version nixified-ai;
inherit (pkgs) lib;
};
in
eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
black.enable = true;
deadnix.enable = true;
eslint.enable = true;
prettier.enable = true;
statix.enable = true;
};
};
};
devShells = let
inherit (pkgs) mkShell alejandra deadnix nodePackages nodejs python39 statix yarn;
inherit (self.checks.${system}.pre-commit-check) shellHook;
in {
default = mkShell {
inherit shellHook;
packages = with nodePackages;
[
alejandra
deadnix
eslint
nodejs
prettier
statix
yarn
]
++ [(python39.withPackages (p: with p; [black]))];
};
};
formatter = pkgs.alejandra;
packages = let
packages = packageFn pkgs;
in
packages // {default = packages.osmosis-nvidia;};
})
// {
overlays.default = final: _: packageFn final;
};
}