2023-02-09 11:40:11 +00:00
|
|
|
{ callPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nixos
|
|
|
|
, conmon
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
apptainer = callPackage
|
|
|
|
(import ./generic.nix rec {
|
|
|
|
pname = "apptainer";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.1.7";
|
2023-02-09 11:40:11 +00:00
|
|
|
projectName = "apptainer";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apptainer";
|
|
|
|
repo = "apptainer";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-3F8qwP27IXcnnEYMnLzkCOxQDx7yej6QIZ40Wb5pk34=";
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Update by running
|
2023-08-04 22:07:22 +00:00
|
|
|
# nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).goModules"
|
2023-02-09 11:40:11 +00:00
|
|
|
# at the root directory of the Nixpkgs repository
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = "sha256-PfFubgR/W1WBXIsRO+Kg7hA6ebeAcRiJlTlAZbnl19A=";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
extraDescription = " (previously known as Singularity)";
|
|
|
|
extraMeta.homepage = "https://apptainer.org";
|
|
|
|
})
|
|
|
|
{
|
|
|
|
# Apptainer doesn't depend on conmon
|
|
|
|
conmon = null;
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
# Apptainer builders require explicit --with-suid / --without-suid flag
|
|
|
|
# when building on a system with disabled unprivileged namespace.
|
|
|
|
# See https://github.com/NixOS/nixpkgs/pull/215690#issuecomment-1426954601
|
|
|
|
defaultToSuid = null;
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
singularity = callPackage
|
|
|
|
(import ./generic.nix rec {
|
|
|
|
pname = "singularity-ce";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.11.1";
|
2023-02-09 11:40:11 +00:00
|
|
|
projectName = "singularity";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sylabs";
|
|
|
|
repo = "singularity";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-gdgg6VN3Ily+2Remz6dZBhhfWIxyaBa4bIlFcgrA/uY=";
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Update by running
|
2023-08-04 22:07:22 +00:00
|
|
|
# nix-prefetch -E "{ sha256 }: ((import ./. { }).singularity.override { vendorHash = sha256; }).goModules"
|
2023-02-09 11:40:11 +00:00
|
|
|
# at the root directory of the Nixpkgs repository
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = "sha256-mBhlH6LSmcJuc6HbU/3Q9ii7vJkW9jcikBWCl8oeMOk=";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
# Do not build conmon from the Git submodule source,
|
|
|
|
# Use Nixpkgs provided version
|
|
|
|
extraConfigureFlags = [
|
|
|
|
"--without-conmon"
|
|
|
|
];
|
|
|
|
|
|
|
|
extraDescription = " (Sylabs Inc's fork of Singularity, a.k.a. SingularityCE)";
|
|
|
|
extraMeta.homepage = "https://sylabs.io/";
|
|
|
|
})
|
|
|
|
{
|
|
|
|
defaultToSuid = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
genOverridenNixos = package: packageName: (nixos {
|
|
|
|
programs.singularity = {
|
|
|
|
enable = true;
|
|
|
|
inherit package;
|
|
|
|
};
|
|
|
|
}).config.programs.singularity.packageOverriden.overrideAttrs (oldAttrs: {
|
|
|
|
meta = oldAttrs.meta // {
|
|
|
|
description = "";
|
|
|
|
longDescription = ''
|
|
|
|
This package produces identical store derivations to `pkgs.${packageName}`
|
|
|
|
overriden and installed by the NixOS module `programs.singularity`
|
|
|
|
with default configuration.
|
|
|
|
|
|
|
|
This is for binary substitutes only. Use pkgs.${packageName} instead.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit apptainer singularity;
|
|
|
|
|
|
|
|
apptainer-overriden-nixos = genOverridenNixos apptainer "apptainer";
|
|
|
|
singularity-overriden-nixos = genOverridenNixos singularity "singularity";
|
|
|
|
}
|