forked from OpenTabletDriver/OpenTabletDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·40 lines (32 loc) · 1.17 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
{
description = "OpenTabletDriver is an open source, cross platform, user mode tablet driver.";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = inputs @ { self, nixpkgs }: let
inherit (nixpkgs.lib) attrValues genAttrs;
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = f: genAttrs supportedSystems (system: f system);
in rec {
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = attrValues self.overlays;
});
# Nixpkgs overlay
overlays.default = final: prev: {
opentabletdriver = final.callPackage ./default.nix {};
};
# Provide binary packages for all system types.
packages = forAllSystems (system: rec {
inherit (nixpkgsFor.${system}) opentabletdriver;
default = opentabletdriver;
});
# Provide a 'nix develop' environment for interactive hacking.
devShells = forAllSystems (system: {
default = import ./shell.nix {
inherit system;
flake = self;
};
});
};
}