forked from azuwis/pianotrans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
68 lines (65 loc) · 2.19 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.systems.url = "github:nix-systems/default";
inputs.devshell.url = "github:numtide/devshell";
inputs.devshell.inputs.nixpkgs.follows = "nixpkgs";
inputs.devshell.inputs.systems.follows = "systems";
nixConfig.extra-substituters = [ "https://azuwis.cachix.org" ];
nixConfig.extra-trusted-public-keys = [ "azuwis.cachix.org-1:194mFftt8RhaRjVyUrq8ttZCvYFwecVO+D5SC75d+9E=" ];
outputs = inputs@{ self, ... }:
let
eachSystem = inputs.nixpkgs.lib.genAttrs (import inputs.systems);
in
{
packages = eachSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
pkgsUnfree = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
python3-bin = pkgsUnfree.python3.override {
packageOverrides = self: super: {
torch = super.torch-bin;
};
};
pianotrans = pkgs.callPackage ./nix/pianotrans { };
pianotrans-bin = pianotrans.override { python3 = python3-bin; };
in
{
default = if pkgs.stdenv.isx86_64 then pianotrans-bin else pianotrans;
inherit pianotrans pianotrans-bin python3-bin;
}
);
devShells = eachSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
devshell = import inputs.devshell { inherit system; nixpkgs = pkgs; };
shell = devshell.mkShell {
packages = [
(pkgs.python3.withPackages (ps: [
ps.piano-transcription-inference
ps.resampy
ps.tkinter
]))
pkgs.ffmpeg
];
};
shell-bin = devshell.mkShell {
packages = [
(self.packages.${system}.python3-bin.withPackages (ps: [
ps.piano-transcription-inference
ps.resampy
ps.tkinter
]))
pkgs.ffmpeg
];
};
in
{
default = if pkgs.stdenv.isx86_64 then shell-bin else shell;
inherit shell shell-bin;
}
);
};
}