mattermost: remove flake inputs, copy nixpkgs package

this copies the current mattermost package definition from upstream
nixpkgs into our repo as-is (that definition itself being a modified
version of our definition that I upstreamed recently).

Since apparently no one else is maintaining the nixpkgs package and I am
apparently maintaining a mattermost package mostly on my own anyways,
this should make upstreaming future changes easier.
This commit is contained in:
stuebinm 2024-03-11 00:13:18 +01:00
parent 8f7f5448a3
commit 8283162109
4 changed files with 15 additions and 43 deletions

View file

@ -54,36 +54,6 @@
"type": "github" "type": "github"
} }
}, },
"mattermost-server": {
"flake": false,
"locked": {
"lastModified": 1709319070,
"narHash": "sha256-NYP0mhON+TCvNTSx4I4hddFGF9TWtnMAwyJvX8sEdWU=",
"owner": "mattermost",
"repo": "mattermost",
"rev": "9a5b3d30495cb878328cf459850e334b592b3ab8",
"type": "github"
},
"original": {
"owner": "mattermost",
"ref": "v9.5.2",
"repo": "mattermost",
"type": "github"
}
},
"mattermost-webapp": {
"flake": false,
"locked": {
"lastModified": 1709319782,
"narHash": "sha256-F7WzEe+3pEK8FyB3T58cJo8uB2zFZg6tZsmrUE1ZqzA=",
"type": "tarball",
"url": "https://releases.mattermost.com/9.5.2/mattermost-9.5.2-linux-amd64.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://releases.mattermost.com/9.5.2/mattermost-9.5.2-linux-amd64.tar.gz"
}
},
"nixos-mailserver": { "nixos-mailserver": {
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
@ -211,8 +181,6 @@
"root": { "root": {
"inputs": { "inputs": {
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"mattermost-server": "mattermost-server",
"mattermost-webapp": "mattermost-webapp",
"nixos-mailserver": "nixos-mailserver", "nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-oldstable": "nixpkgs-oldstable", "nixpkgs-oldstable": "nixpkgs-oldstable",

View file

@ -2,11 +2,6 @@
description = "hacc infra stuff"; description = "hacc infra stuff";
inputs = { inputs = {
mattermost-webapp.url = "https://releases.mattermost.com/9.5.2/mattermost-9.5.2-linux-amd64.tar.gz";
mattermost-webapp.flake = false;
mattermost-server.url = "github:mattermost/mattermost?ref=v9.5.2";
mattermost-server.flake = false;
nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs-oldstable.url = "github:/NixOS/nixpkgs?rev=c4aec3c021620d98861639946123214207e98344"; nixpkgs-oldstable.url = "github:/NixOS/nixpkgs?rev=c4aec3c021620d98861639946123214207e98344";

View file

@ -10,7 +10,6 @@ let
newpkgs = { newpkgs = {
mattermost = callPackage ./mattermost.nix { mattermost = callPackage ./mattermost.nix {
inherit sources;
buildGoModule = unstable.buildGo122Module; buildGoModule = unstable.buildGo122Module;
}; };

View file

@ -1,5 +1,4 @@
{ lib { lib
, sources
, buildGoModule , buildGoModule
, fetchFromGitHub , fetchFromGitHub
, nix-update-script , nix-update-script
@ -15,8 +14,12 @@ buildGoModule rec {
# the version regex in passthru.updateScript as well. # the version regex in passthru.updateScript as well.
version = "9.5.2"; version = "9.5.2";
src = sources.mattermost-server; src = fetchFromGitHub {
webapp = sources.mattermost-webapp; owner = "mattermost";
repo = "mattermost";
rev = "v${version}";
hash = "sha256-NYP0mhON+TCvNTSx4I4hddFGF9TWtnMAwyJvX8sEdWU=";
};
# Needed because buildGoModule does not support go workspaces yet. # Needed because buildGoModule does not support go workspaces yet.
# We use go 1.22's workspace vendor command, which is not yet available # We use go 1.22's workspace vendor command, which is not yet available
@ -29,6 +32,11 @@ buildGoModule rec {
''; '';
}); });
webapp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
hash = "sha256-ogiowbNYHo9NTQLAg1OKXp8pV1Zn7kPcZR9ukaKvpKA=";
};
vendorHash = "sha256-TJCtgNf56A1U0EbV5gXjTro+YudVBRWiSZoBC3nJxnE="; vendorHash = "sha256-TJCtgNf56A1U0EbV5gXjTro+YudVBRWiSZoBC3nJxnE=";
modRoot = "./server"; modRoot = "./server";
@ -36,7 +44,7 @@ buildGoModule rec {
make setup-go-work make setup-go-work
''; '';
subPackages = [ "cmd/mattermost" "cmd/mmctl" ]; subPackages = [ "cmd/mattermost" ];
tags = [ "production" ]; tags = [ "production" ];
@ -52,7 +60,9 @@ buildGoModule rec {
]; ];
postInstall = '' postInstall = ''
cp -r $webapp/{client,i18n,fonts,templates,config} $out tar --strip 1 --directory $out -xf $webapp \
mattermost/{client,i18n,fonts,templates,config}
# For some reason a bunch of these files are executable # For some reason a bunch of these files are executable
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \; find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
''; '';