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