blob: cb2d1b5e8c259483cc339cef3e584875277c1310 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
{
callPackage,
fetchFromGitHub,
nixos,
conmon,
}:
let
apptainer =
callPackage
(import ./generic.nix rec {
pname = "apptainer";
version = "1.5.0";
projectName = "apptainer";
src = fetchFromGitHub {
owner = "apptainer";
repo = "apptainer";
tag = "v${version}";
hash = "sha256-zx3NPuwz3ZNJeYw4CG1/q8uwbGpA7G1/hvw6VmoCNkg=";
};
# Override vendorHash with overrideAttrs.
# See https://nixos.org/manual/nixpkgs/unstable/#buildGoModule-vendorHash
vendorHash = "sha256-ZyYGCGZHHy1YYE7O9fN1qFQbLshsRFBSrNLt1GXNyU8=";
extraDescription = " (previously known as Singularity)";
extraMeta.homepage = "https://apptainer.org";
})
{
# Apptainer doesn't depend on conmon
conmon = null;
# 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;
sourceFilesWithDefaultPaths = {
"cmd/internal/cli/actions.go" = [ "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" ];
"e2e/env/env.go" = [ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ];
"internal/pkg/util/env/env.go" = [ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ];
};
};
singularity =
callPackage
(import ./generic.nix rec {
pname = "singularity-ce";
version = "4.4.1";
projectName = "singularity";
src = fetchFromGitHub {
owner = "sylabs";
repo = "singularity";
tag = "v${version}";
hash = "sha256-lFnxh+cs5y6F/1f5uyQ3vA1E8uBKJOyOYbJy6081I5U=";
};
# Override vendorHash with overrideAttrs.
# See https://nixos.org/manual/nixpkgs/unstable/#buildGoModule-vendorHash
vendorHash = "sha256-uqEzYj8JmZWi2Rceh+JMJ5kzUmJ4T3JAt0rto1NewlM=";
extraConfigureFlags = [
# Do not build squashfuse from the Git submodule sources, use Nixpkgs provided version
"--without-squashfuse"
# Disable subid as it requires (unavailable?) libsubid headers:
"--without-libsubid"
];
extraDescription = " (Sylabs Inc's fork of Singularity, a.k.a. SingularityCE)";
extraMeta.homepage = "https://sylabs.io/";
})
{
# Sylabs SingularityCE builders defaults to set the SUID flag
# on UNIX-like platforms,
# and only have --without-suid but not --with-suid.
defaultToSuid = true;
sourceFilesWithDefaultPaths = {
"cmd/internal/cli/actions.go" = [ "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" ];
"e2e/env/env.go" = [ "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ];
"internal/pkg/util/env/clean.go" = [
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
];
};
};
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";
}
|