-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
57 lines (47 loc) · 1.71 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
{
description = "SEGGER J-Link";
outputs = { self, nixpkgs }:
let
inherit (nixpkgs.lib) genAttrs;
systems = [ "i686-linux" "x86_64-linux" "armv7l-linux" "aarch64-linux" ];
packages = genAttrs systems (system:
let j-link = (import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
config.allowUnfree = true;
}).j-link;
in { inherit j-link; default = j-link; });
overlay = final: prev: {
j-link = final.callPackage ./pkgs/j-link {};
};
nixosModule = { pkgs, ... }: {
nixpkgs.overlays = [ self.overlays.default ];
services.udev.packages = [ pkgs.j-link ];
environment.systemPackages = [ pkgs.j-link ];
};
in {
inherit packages overlay nixosModule;
nixosModules.default = nixosModule;
overlays.default = overlay;
apps =
genAttrs systems (system:
let
mkApp = program: {
type = "app";
program = "${packages.${system}.j-link}/bin/${program}";
};
in {
j-flash = mkApp "JFlashExe";
j-flash-lite = mkApp "JFlashLiteExe";
j-flash-spi = mkApp "JFlashSPIExe";
j-link-config = mkApp "JFlashLinkConfigExe";
j-link-gdb-server = mkApp "JLinkGDBServer";
j-link-license-manager = mkApp "JLinkLicenseManager";
j-link-rtt-viewer = mkApp "JLinkRTTViewerExe";
j-link-registration = mkApp "JLinkRegistration";
j-remote-server = mkApp "JLinkRemoteServer";
j-swo-viewer = mkApp "JLinkSWOViewer";
j-mem = mkApp "JMemExe";
});
};
}