]> gitweb.ps.run Git - flakes/blob - flake.nix
5f7f6785a8442912aaa9672f26f5e60d5a8fca15
[flakes] / flake.nix
1 {
2   description = "resetmsmice";
3
4   inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5   inputs.flake-utils.url = "github:numtide/flake-utils";
6
7   outputs = { self, nixpkgs, flake-utils }: {
8     overlays = {
9       cgit = final: prev: {
10         cgit = prev.cgit.overrideAttrs (oldAttrs: {
11           postPatch = ''substituteInPlace ui-repolist.c --replace "master" "main"'';
12         });
13       };
14     };
15   } ++
16   flake-utils.lib.eachDefaultSystem (system:
17     let
18       pkgs = import nixpkgs { inherit system; };
19     in {
20       packages.resetmsmice = pkgs.stdenv.mkDerivation {
21         pname = "resetmsmice";
22         version = "0.0.0";
23         src = pkgs.fetchFromGitHub {
24           owner = "paulrichards321";
25           repo = "resetmsmice";
26           rev = "2623a46bcfdaab199b1fc080060d4e3f1c94ce86";
27           hash = "sha256-xRteJe7lAoyMrz13UIXCkg5dxhziT6e9Bn7+zYzt2j8=";
28         };
29
30         buildInputs = with pkgs; [
31           autoconf automake pkg-config libusb1 shadow
32         ];
33
34         buildPhase = ''
35           autoreconf -i .
36           ./configure --disable-gui --prefix=$out
37           make
38         '';
39
40         installPhase = ''
41           mkdir -p $out/bin
42           cp resetmsmice $out/bin/
43         '';
44       };
45
46       apps.resetmsmice = {
47         type = "app";
48         program = "${self.packages.${system}.resetmsmice}/bin/resetmsmice";
49       };
50     });
51 }
52