treesummaryrefslogcommitdiff
path: root/flake.nix
blob: 6c18c4fe8fca3fe4bafcf6d3530ca211413c567c (plain)
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
{
  description = "resetmsmice";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
      in {
        packages.default = pkgs.stdenv.mkDerivation {
          pname = "resetmsmice";
          version = "0.0.0";
          src = pkgs.fetchFromGitHub {
            owner = "paulrichards321";
            repo = "resetmsmice";
            rev = "2623a46bcfdaab199b1fc080060d4e3f1c94ce86";
            hash = "sha256-xRteJe7lAoyMrz13UIXCkg5dxhziT6e9Bn7+zYzt2j8=";
          };

          buildInputs = with pkgs; [
            autoconf automake pkg-config libusb1 shadow
          ];

          buildPhase = ''
            autoreconf -i .
            ./configure --disable-gui --prefix=$out
            make
          '';

          installPhase = ''
            mkdir -p $out/bin
            cp resetmsmice $out/bin/
          '';
        };

        apps.default = {
          type = "app";
          program = "${self.packages.${system}.default}/bin/resetmsmice";
        };
      });
}