abouttreesummaryrefslogcommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..a0d8c77
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,50 @@
+{
+ description = "A Nix Flake for a fork of cgit";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ };
+
+ outputs = { self, nixpkgs }:
+ let
+ forAllSystems = nixpkgs.lib.genAttrs [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
+ in
+ {
+ packages = forAllSystems (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ default = pkgs.callPackage ({ lib, fetchurl, callPackage, luajit, nixosTests }:
+ # This logic was previously in package.nix
+ callPackage (import ./common.nix rec {
+ pname = "cgit-fork";
+ version = "1.2.3";
+
+ src = ./.;
+
+ # cgit needs the git source code to compile.
+ # Ensure this matches the version found in the Makefile of your fork.
+ gitSrc = fetchurl {
+ url = "mirror://kernel/software/scm/git/git-2.25.1.tar.xz";
+ sha256 = "09lzwa183nblr6l8ib35g2xrjf9wm9yhk3szfvyzkwivdv69c9r2";
+ };
+
+ buildInputs = [ luajit ];
+
+ passthru.tests = { inherit (nixosTests) cgit; };
+
+ homepage = "https://git.zx2c4.com/cgit/about/";
+ description = "Web frontend for git repositories (Custom Fork)";
+ maintainers = with lib.maintainers; [ ];
+ }) { }
+ ) { };
+ });
+ };
+}
+