7 apptainer = callPackage
8 (import ./generic.nix rec {
11 projectName = "apptainer";
13 src = fetchFromGitHub {
16 rev = "refs/tags/v${version}";
17 hash = "sha256-YqPPTs7cIiMbOc8jOwr8KgUBVu2pTPlSL0Vvw/1n4co=";
21 # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).goModules"
22 # at the root directory of the Nixpkgs repository
23 vendorHash = "sha256-lWo6ic3Tdv1UInA5MtEaAgiheCin2JSh4nmheUooENY=";
25 extraDescription = " (previously known as Singularity)";
26 extraMeta.homepage = "https://apptainer.org";
29 # Apptainer doesn't depend on conmon
32 # Apptainer builders require explicit --with-suid / --without-suid flag
33 # when building on a system with disabled unprivileged namespace.
34 # See https://github.com/NixOS/nixpkgs/pull/215690#issuecomment-1426954601
38 singularity = callPackage
39 (import ./generic.nix rec {
40 pname = "singularity-ce";
42 projectName = "singularity";
44 src = fetchFromGitHub {
47 rev = "refs/tags/v${version}";
48 hash = "sha256-/KTDdkCMkZ5hO+VYHzw9vB8FDWxg7PS1yb2waRJQngY=";
52 # nix-prefetch -E "{ sha256 }: ((import ./. { }).singularity.override { vendorHash = sha256; }).goModules"
53 # at the root directory of the Nixpkgs repository
54 vendorHash = "sha256-4Nxj2PzZmFdvouWKyXLFDk8iuRhFuvyPW/+VRTw75Zw=";
56 # Do not build conmon and squashfuse from the Git submodule sources,
57 # Use Nixpkgs provided version
58 extraConfigureFlags = [
60 "--without-squashfuse"
63 extraDescription = " (Sylabs Inc's fork of Singularity, a.k.a. SingularityCE)";
64 extraMeta.homepage = "https://sylabs.io/";
70 genOverridenNixos = package: packageName: (nixos {
71 programs.singularity = {
75 }).config.programs.singularity.packageOverriden.overrideAttrs (oldAttrs: {
76 meta = oldAttrs.meta // {
79 This package produces identical store derivations to `pkgs.${packageName}`
80 overriden and installed by the NixOS module `programs.singularity`
81 with default configuration.
83 This is for binary substitutes only. Use pkgs.${packageName} instead.
89 inherit apptainer singularity;
91 apptainer-overriden-nixos = genOverridenNixos apptainer "apptainer";
92 singularity-overriden-nixos = genOverridenNixos singularity "singularity";