]> gitweb.ps.run Git - flakes/blob - flake.nix
add gitweb overlay
[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       gitweb = final: prev: {
14         gitweb = prev.gitweb.overrideAttrs (oldAttrs: {
15           patches = [ ./patches/gitweb.patch ];
16         });
17       };
18     };
19     inherit (flake-utils.lib.eachDefaultSystem (system:
20       let
21         pkgs = import nixpkgs { inherit system; };
22       in {
23         packages.resetmsmice = pkgs.stdenv.mkDerivation {
24           pname = "resetmsmice";
25           version = "0.0.0";
26           src = pkgs.fetchFromGitHub {
27             owner = "paulrichards321";
28             repo = "resetmsmice";
29             rev = "2623a46bcfdaab199b1fc080060d4e3f1c94ce86";
30             hash = "sha256-xRteJe7lAoyMrz13UIXCkg5dxhziT6e9Bn7+zYzt2j8=";
31           };
32
33           buildInputs = with pkgs; [
34             autoconf automake pkg-config libusb1 shadow
35           ];
36
37           buildPhase = ''
38             autoreconf -i .
39             ./configure --disable-gui --prefix=$out
40             make
41           '';
42
43           installPhase = ''
44             mkdir -p $out/bin
45             cp resetmsmice $out/bin/
46           '';
47         };
48
49         apps.resetmsmice = {
50           type = "app";
51           program = "${self.packages.${system}.resetmsmice}/bin/resetmsmice";
52         };
53       })
54     ) packages apps;
55   };
56 }
57