From 6c2bc29efd08ab5982e3f40a4e294c0cd7971b67 Mon Sep 17 00:00:00 2001 From: undefined Date: Fri, 23 Aug 2024 12:40:06 +0800 Subject: [PATCH] add mongodb7 --- default.nix | 3 ++- flake.lock | 6 +++--- flake.nix | 31 +++++++++++++++++++++---------- judge.nix | 3 +-- mongodb.nix | 13 ++++++------- xeger.nix | 4 +--- 6 files changed, 34 insertions(+), 26 deletions(-) diff --git a/default.nix b/default.nix index 017933a..a9b769c 100644 --- a/default.nix +++ b/default.nix @@ -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; }; diff --git a/flake.lock b/flake.lock index b5b5e99..789f0f3 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1709128929, - "narHash": "sha256-GWrv9a+AgGhG4/eI/CyVVIIygia7cEy68Huv3P8oyaw=", + "lastModified": 1715218190, + "narHash": "sha256-R98WOBHkk8wIi103JUVQF3ei3oui4HvoZcz9tYOAwlk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c8e74c2f83fe12b4e5a8bd1abbc090575b0f7611", + "rev": "9a9960b98418f8c385f52de3b09a63f9c561427a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 840c946..0574417 100644 --- a/flake.nix +++ b/flake.nix @@ -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; } ); } diff --git a/judge.nix b/judge.nix index 08e7c78..478e957 100644 --- a/judge.nix +++ b/judge.nix @@ -1,6 +1,6 @@ # Note: this file is used to construct HydroOJ judge rootfs. { system ? builtins.currentSystem -, pkgs ? import { system = system; } +, pkgs , minimal ? false }: @@ -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 ''; } diff --git a/mongodb.nix b/mongodb.nix index e729f5d..288db64 100644 --- a/mongodb.nix +++ b/mongodb.nix @@ -1,5 +1,5 @@ { system ? builtins.currentSystem -, pkgs ? import { system = system; } +, pkgs , version ? "6.0.12" , mirror ? "https://repo.mongodb.org/" }: @@ -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: @@ -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 @@ -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 ]; }; diff --git a/xeger.nix b/xeger.nix index 736a7de..a5b1eaf 100644 --- a/xeger.nix +++ b/xeger.nix @@ -1,6 +1,4 @@ -{ system ? builtins.currentSystem -, pkgs ? import { system = system; } -}: +{ pkgs, ... }: pkgs.python3Packages.buildPythonPackage rec { pname = "xeger"; version = "0.4.0";