From 04272968d0b9c9e5621428e2b71310cd43e071b9 Mon Sep 17 00:00:00 2001 From: hexchen Date: Sat, 24 Sep 2022 14:41:34 +0000 Subject: [PATCH] update and fix mattermost --- modules/mattermost.nix | 6 +----- nix/sources.json | 14 +++++++------- nix/sources.nix | 22 +++++++++++++++++++++- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/modules/mattermost.nix b/modules/mattermost.nix index c2a7509..122abce 100644 --- a/modules/mattermost.nix +++ b/modules/mattermost.nix @@ -6,13 +6,9 @@ let cfg = config.services.mattermost-patched; - defaultConfig = builtins.fromJSON (builtins.replaceStrings [ "\\u0026" ] [ "&" ] - (readFile "${pkgs.mattermost}/config/config.json") - ); - database = "postgres://${cfg.localDatabaseUser}:${cfg.localDatabasePassword}@localhost:5432/${cfg.localDatabaseName}?sslmode=disable&connect_timeout=10"; - mattermostConf = foldl recursiveUpdate defaultConfig + mattermostConf = foldl recursiveUpdate {} [ { ServiceSettings.SiteURL = cfg.siteUrl; ServiceSettings.ListenAddress = cfg.listenAddress; TeamSettings.SiteName = cfg.siteName; diff --git a/nix/sources.json b/nix/sources.json index 0ed84d7..cbc976c 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -23,7 +23,7 @@ "homepage": "https://mattermost.com", "owner": "mattermost", "repo": "mattermost-server", - "rev": "90c635041053fc53905be5735b0399bfe135080e", + "rev": "2ea14ef395fad8919b2f4137642a7f50b370ffba", "sha256": "1k5zqnc4yqnad2cw1wpqk22mjra08jz9gf4v692kbrgx3x4d13kh", "type": "tarball", "url": "https://github.com/mattermost/mattermost-server/archive/refs/tags/v6.7.2.tar.gz", @@ -75,10 +75,10 @@ "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "4dbec24ea806d348dd8f8e8e80051bbda708726a", - "sha256": "0jjg6cr6jg16fy368p49vpq4al86084jhls135jqqvnf778q43cf", + "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", + "sha256": "04ffwp2gzq0hhz7siskw6qh9ys8ragp7285vi1zh8xjksxn1msc5", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/4dbec24ea806d348dd8f8e8e80051bbda708726a.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/eabc38219184cc3e04a974fe31857d8e0eac098d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-unstable": { @@ -87,10 +87,10 @@ "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "e0169d7a9d324afebf5679551407756c77af8930", - "sha256": "1nr7ih856ca2vl0blim4bz2yxz6cg7jfsx4z096hg0qa5i04zg95", + "rev": "ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90", + "sha256": "0dq22dagzk76x2ws4dz88w018i6byamd6rnzqizx68bzimg6g7xn", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/e0169d7a9d324afebf5679551407756c77af8930.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/ae1dc133ea5f1538d035af41e5ddbc2ebcb67b90.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "workadventure": { diff --git a/nix/sources.nix b/nix/sources.nix index 1938409..9a01c8a 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -31,8 +31,28 @@ let if spec ? branch then "refs/heads/${spec.branch}" else if spec ? tag then "refs/tags/${spec.tag}" else abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + submodules = if spec ? submodules then spec.submodules else false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules == true + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + {} + else {}; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path;