diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/version-management/gogs')
-rw-r--r-- | nixpkgs/pkgs/applications/version-management/gogs/default.nix | 48 | ||||
-rw-r--r-- | nixpkgs/pkgs/applications/version-management/gogs/static-root-path.patch | 13 |
2 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/version-management/gogs/default.nix b/nixpkgs/pkgs/applications/version-management/gogs/default.nix new file mode 100644 index 000000000000..56e411368961 --- /dev/null +++ b/nixpkgs/pkgs/applications/version-management/gogs/default.nix @@ -0,0 +1,48 @@ +{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper +, git, bash, gzip, openssh +, sqliteSupport ? true +}: + +with stdenv.lib; + +buildGoPackage rec { + name = "gogs-${version}"; + version = "0.11.66"; + + src = fetchFromGitHub { + owner = "gogs"; + repo = "gogs"; + rev = "v${version}"; + sha256 = "1b9ilk4xlsllsj5pzmxwsz4a1zvgd06a8mi9ni9hbvmfl3w8xf28"; + }; + + patches = [ ./static-root-path.patch ]; + + postPatch = '' + patchShebangs . + substituteInPlace pkg/setting/setting.go --subst-var data + ''; + + nativeBuildInputs = [ makeWrapper ]; + + buildFlags = optionalString sqliteSupport "-tags sqlite"; + + outputs = [ "bin" "out" "data" ]; + + postInstall = '' + mkdir $data + cp -R $src/{public,templates} $data + + wrapProgram $bin/bin/gogs \ + --prefix PATH : ${makeBinPath [ bash git gzip openssh ]} + ''; + + goPackagePath = "github.com/gogs/gogs"; + + meta = { + description = "A painless self-hosted Git service"; + homepage = https://gogs.io; + license = licenses.mit; + maintainers = [ maintainers.schneefux ]; + }; +} diff --git a/nixpkgs/pkgs/applications/version-management/gogs/static-root-path.patch b/nixpkgs/pkgs/applications/version-management/gogs/static-root-path.patch new file mode 100644 index 000000000000..9eaa72a0c85d --- /dev/null +++ b/nixpkgs/pkgs/applications/version-management/gogs/static-root-path.patch @@ -0,0 +1,13 @@ +diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go +index f206592d..796da6ef 100644 +--- a/pkg/setting/setting.go ++++ b/pkg/setting/setting.go +@@ -474,7 +474,7 @@ func NewContext() { + LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HTTPPort + "/") + OfflineMode = sec.Key("OFFLINE_MODE").MustBool() + DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool() +- StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir) ++ StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString("@data@") + AppDataPath = sec.Key("APP_DATA_PATH").MustString("data") + EnableGzip = sec.Key("ENABLE_GZIP").MustBool() + |