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