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