Skip to content

Commit

Permalink
add mongodb7
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined-moe committed Aug 23, 2024
1 parent e9e2e25 commit 6c2bc29
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 26 deletions.
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ let

self = {
mongodb = import ./mongodb.nix;
mongodb7 = callPackage ./mongodb.nix { version = "7.0.4"; inherit system; };
mongodb7 = callPackage ./mongodb.nix { version = "7.0.11"; inherit system; };
mongodb6 = callPackage ./mongodb.nix { version = "6.0.12"; inherit system; };
mongodb5 = callPackage ./mongodb.nix { version = "5.0.10"; inherit system; };
mongodb4 = callPackage ./mongodb.nix { version = "4.4.16"; inherit system; };
mongodb7-cn = callPackage ./mongodb.nix { version = "7.0.11"; mirror = tuna; inherit system; };
mongodb6-cn = callPackage ./mongodb.nix { version = "6.0.12"; mirror = tuna; inherit system; };
mongodb5-cn = callPackage ./mongodb.nix { version = "5.0.10"; mirror = tuna; inherit system; };
mongodb4-cn = callPackage ./mongodb.nix { version = "4.4.16"; mirror = tuna; inherit system; };
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
{
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11;
inputs.flake-utils.url = github:numtide/flake-utils;
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
{
packages.judge = (import ./judge.nix)
{ pkgs = nixpkgs.legacyPackages.${system}; system = system; };
packages.cyaron = (import ./cyaron.nix)
{ pkgs = nixpkgs.legacyPackages.${system}; system = system; };
packages.xeger = (import ./xeger.nix)
{ pkgs = nixpkgs.legacyPackages.${system}; system = system; };
packages.mongodb = (import ./mongodb.nix)
{ pkgs = nixpkgs.legacyPackages.${system}; system = system; };
packages = let
tuna = "https://mirrors.tuna.tsinghua.edu.cn/mongodb/";
callPackage = file: args: import file (args // { pkgs = nixpkgs.legacyPackages.${system}; system = system; });
in {
judge = callPackage ./judge.nix {};
cyaron = callPackage ./cyaron.nix {};
xeger = callPackage ./xeger.nix {};
mongodb = callPackage ./mongodb.nix {};
gcc = callPackage ./gccWithCache.nix {};
mongodb7 = callPackage ./mongodb.nix { version = "7.0.11"; inherit system; };
mongodb6 = callPackage ./mongodb.nix { version = "6.0.12"; inherit system; };
mongodb5 = callPackage ./mongodb.nix { version = "5.0.10"; inherit system; };
mongodb4 = callPackage ./mongodb.nix { version = "4.4.16"; inherit system; };
mongodb7-cn = callPackage ./mongodb.nix { version = "7.0.11"; mirror = tuna; inherit system; };
mongodb6-cn = callPackage ./mongodb.nix { version = "6.0.12"; mirror = tuna; inherit system; };
mongodb5-cn = callPackage ./mongodb.nix { version = "5.0.10"; mirror = tuna; inherit system; };
mongodb4-cn = callPackage ./mongodb.nix { version = "4.4.16"; mirror = tuna; inherit system; };
};
mongodb = import ./mongodb.nix;
}
);
}
3 changes: 1 addition & 2 deletions judge.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: this file is used to construct HydroOJ judge rootfs.
{ system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { system = system; }
, pkgs
, minimal ? false
}:

Expand Down Expand Up @@ -67,6 +67,5 @@ pkgs.buildEnv {
mkdir $out/buildInfo
echo 'root:x:0:0:root:/root:/bin/bash' >$out/etc/passwd
date >$out/buildInfo/timestamp
ls $out/lib/locale
'';
}
13 changes: 6 additions & 7 deletions mongodb.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { system = system; }
, pkgs
, version ? "6.0.12"
, mirror ? "https://repo.mongodb.org/"
}:
Expand All @@ -11,11 +11,12 @@ let
"5.0.10x86_64-linux" = "sha256-NV+a1bBdY5z2559cJYgNYlTvoRfGHVWrvmyWcCLgxls=";
"6.0.0x86_64-linux" = "sha256-AJUQ8Jo/T4PDnYtFg3njUZyoH9XXzleZ+nj/knCBKzg=";
"6.0.12x86_64-linux" = "sha256-Fgk42wwdKLDZJsE1GxB4fcB1z22P0zkDxDb0HXu1ZsM=";
"7.0.4x86_64-linux" = "sha256-6C/K+SwEMAX1wsJH1ltQAVWjKY2aNqfqv5EXcER4WCY=";
"7.0.11x86_64-linux" = "sha256-NCRNvYnR0GfJ9q9pDmQWR7Cs6GgGalMxuTF0mdfXsZs=";
"4.4.16aarch64-linux" = "sha256-8L+4uwIvhuVw9t4N1CuStHnwIZhOdZqiBsjcN+iIyBI=";
"5.0.10aarch64-linux" = "sha256-phLLCL1wXE0pjrb4n1xQjoTVDYuFFRz5RQdfmYj9HPY=";
"6.0.0aarch64-linux" = "sha256-nEmpS2HUeQdehQAiFgxKLnnYVV9aPKtUtb/GRS9f+4M=";
"6.0.12aarch64-linux" = "sha256-0xAOKjFYVIIoRtDm6Cdqq+WP+ArpVlOna/YqePF3XKI=";
"7.0.11aarch64-linux" = "sha256-g+7fCH4KWxDCsCtlkrts8i+ARy3jigF3O2tEINVE5b0=";
};
versionDetail = pkgs.lib.concatStrings [ version system ];
buildDownloadUrl = system: version:
Expand All @@ -32,12 +33,10 @@ let
in
pkgs.lib.concatStrings [
mirror
# Prefer debian bookworm as its package was built with openssl3
(if nmajor >= 7 then "apt/debian/dists/bookworm" else "apt/ubuntu/dists/focal")
(if nmajor >= 7 then "apt/ubuntu/dists/jammy" else "apt/ubuntu/dists/focal")
"/mongodb-org/"
"${major}.${minor}"
(if nmajor >= 7 then "/main" else "/multiverse")
"/binary-"
"/multiverse/binary-"
arch
"/mongodb-org-server_"
version
Expand Down Expand Up @@ -75,7 +74,7 @@ pkgs.stdenvNoCC.mkDerivation {

meta = {
description = "MongoDB";
homepage = https://www.mongodb.com/;
homepage = "https://www.mongodb.com/";
maintainers = with pkgs.lib.maintainers; [ undefined-moe ];
platforms = [ system ];
};
Expand Down
4 changes: 1 addition & 3 deletions xeger.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{ system ? builtins.currentSystem
, pkgs ? import <nixpkgs> { system = system; }
}:
{ pkgs, ... }:
pkgs.python3Packages.buildPythonPackage rec {
pname = "xeger";
version = "0.4.0";
Expand Down

0 comments on commit 6c2bc29

Please sign in to comment.