Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
43 lines (39 loc) · 1.45 KB
/
Copy pathflake.nix
File metadata and controls
43 lines (39 loc) · 1.45 KB
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
{
description = "Blockwork: build keyboard and mouse macros by snapping blocks together";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAll = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
packages = forAll (pkgs: rec {
blockwork = pkgs.callPackage ./packaging/nix/package.nix { };
default = blockwork;
});
overlays.default = final: _: { blockwork = final.callPackage ./packaging/nix/package.nix { }; };
# programs.blockwork.enable = true; installs Blockwork, loads uinput and
# lets the user at the seat use it. Recording still needs the input group.
nixosModules.default =
{ config, lib, pkgs, ... }:
let
cfg = config.programs.blockwork;
in
{
options.programs.blockwork = {
enable = lib.mkEnableOption "Blockwork";
package = lib.mkOption {
type = lib.types.package;
default = self.packages.${pkgs.stdenv.hostPlatform.system}.blockwork;
description = "The Blockwork package to use.";
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
boot.kernelModules = [ "uinput" ];
};
};
};
}