-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathflake.nix
98 lines (89 loc) · 2.46 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
{
description = "Cross-platform visual development tool and SCPI instrument controller";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.05";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
npmlock2nix = {
url = "github:ilkecan/npmlock2nix/";
flake = false;
};
nix-utils.url = "git+https://git.sr.ht/~ilkecan/nix-utils";
};
outputs = { self, nixpkgs, flake-utils, npmlock2nix, ... }@inputs:
let
inherit (builtins)
attrNames
attrValues
;
inherit (nixpkgs.lib)
getAttrs
;
inherit (flake-utils.lib)
defaultSystems
eachSystem
;
nix-filter = inputs.nix-filter.lib;
nix-utils = inputs.nix-utils.lib;
inherit (nix-utils)
createOverlays
getUnstableVersion
;
supportedSystems = defaultSystems;
commonArgs = {
version = getUnstableVersion self.lastModifiedDate;
homepage = "https://github.com/eez-open/studio";
downloadPage = "https://github.com/eez-open/studio/releases";
changelog = null;
maintainers = [
{
name = "ilkecan bozdogan";
email = "[email protected]";
github = "ilkecan";
githubId = "40234257";
}
];
platforms = supportedSystems;
};
derivations = {
eez-studio = import ./nix/eez-studio.nix commonArgs;
};
in
{
overlays = createOverlays derivations {
inherit
nix-filter
nix-utils
;
};
overlay = self.overlays.eez-studio;
} // eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = attrValues self.overlays ++ [
(final: prev: { npmlock2nix = import npmlock2nix { pkgs = prev; }; })
];
};
packageNames = attrNames derivations;
in
rec {
checks = packages;
packages = getAttrs packageNames pkgs;
defaultPackage = packages.eez-studio;
hydraJobs = {
build = packages;
};
devShell =
let
packageList = attrValues packages;
in
pkgs.mkShell {
packages = packageList;
shellHook = ''
$(${defaultPackage.preConfigure}) || true
export PATH=./node_modules/.bin:$PATH
'';
};
});
}