diff --git a/flake.lock b/flake.lock index 3018e55..0ada18b 100644 --- a/flake.lock +++ b/flake.lock @@ -54,36 +54,6 @@ "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": { "inputs": { "blobs": "blobs", @@ -211,8 +181,6 @@ "root": { "inputs": { "deploy-rs": "deploy-rs", - "mattermost-server": "mattermost-server", - "mattermost-webapp": "mattermost-webapp", "nixos-mailserver": "nixos-mailserver", "nixpkgs": "nixpkgs_2", "nixpkgs-oldstable": "nixpkgs-oldstable", diff --git a/flake.nix b/flake.nix index 1163e98..4b1bc5b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,6 @@ description = "hacc infra stuff"; 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-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-oldstable.url = "github:/NixOS/nixpkgs?rev=c4aec3c021620d98861639946123214207e98344"; diff --git a/pkgs/default.nix b/pkgs/default.nix index ea2c71b..cec7f43 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,7 +10,6 @@ let newpkgs = { mattermost = callPackage ./mattermost.nix { - inherit sources; buildGoModule = unstable.buildGo122Module; }; diff --git a/pkgs/mattermost.nix b/pkgs/mattermost.nix index b535513..a383bc3 100644 --- a/pkgs/mattermost.nix +++ b/pkgs/mattermost.nix @@ -1,5 +1,4 @@ { lib -, sources , buildGoModule , fetchFromGitHub , nix-update-script @@ -15,8 +14,12 @@ buildGoModule rec { # the version regex in passthru.updateScript as well. version = "9.5.2"; - src = sources.mattermost-server; - webapp = sources.mattermost-webapp; + src = fetchFromGitHub { + owner = "mattermost"; + repo = "mattermost"; + rev = "v${version}"; + hash = "sha256-NYP0mhON+TCvNTSx4I4hddFGF9TWtnMAwyJvX8sEdWU="; + }; # Needed because buildGoModule does not support go workspaces yet. # 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="; modRoot = "./server"; @@ -36,7 +44,7 @@ buildGoModule rec { make setup-go-work ''; - subPackages = [ "cmd/mattermost" "cmd/mmctl" ]; + subPackages = [ "cmd/mattermost" ]; tags = [ "production" ]; @@ -52,7 +60,9 @@ buildGoModule rec { ]; 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 find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \; '';