alpha
Login
or
Join now
tombl.dev
/
distro
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
run: split into separate file
author
Thomas Stokes
date
1 year ago
(Jan 18, 2025, 1:25 PM +0800)
commit
820589b1
820589b13482c30289580a28f5a04c1e9ccc99a2
parent
4ed3b70f
4ed3b70f017a4fa39dcec2dd639dc60342830970
+55
-42
2 changed files
Expand all
Collapse all
Unified
Split
all-packages.nix
packages
run
package.nix
+1
-42
all-packages.nix
Reviewed
···
6
6
}:
7
7
8
8
let
9
9
-
mkRun =
10
10
-
{ path, builder }:
11
11
-
args: command:
12
12
-
let
13
13
-
setup =
14
14
-
if args ? src then
15
15
-
''
16
16
-
cp -r ${args.src} src
17
17
-
cd src
18
18
-
chmod -R u+w .
19
19
-
''
20
20
-
else
21
21
-
"";
22
22
-
in
23
23
-
derivation (
24
24
-
{
25
25
-
system = currentSystem;
26
26
-
inherit builder;
27
27
-
args = [
28
28
-
"-euc"
29
29
-
''
30
30
-
if [ 0 -eq "$NIX_BUILD_CORES" ]; then
31
31
-
NIX_BUILD_CORES=$(${pkgs.busybox}/bin/nproc)
32
32
-
fi
33
33
-
exec ${builder} -eux $commandPath
34
34
-
''
35
35
-
];
36
36
-
PATH = lib.makeBinPath ((args.path or [ ]) ++ path);
37
37
-
command = setup + "\n" + command;
38
38
-
passAsFile = [ "command" ];
39
39
-
}
40
40
-
// (removeAttrs args [ "srcPath" ])
41
41
-
);
42
42
-
43
9
wasmpkgs =
44
10
{
45
45
-
inherit lib inputs;
46
46
-
run = mkRun {
47
47
-
path = [
48
48
-
pkgs.busybox
49
49
-
pkgs.bash
50
50
-
];
51
51
-
builder = "${pkgs.bash}/bin/bash";
52
52
-
};
11
11
+
inherit lib inputs currentSystem;
53
12
}
54
13
// lib.packagesFromDirectoryRecursive {
55
14
callPackage = lib.callPackageWith pkgs;
+54
packages/run/package.nix
Reviewed
···
1
1
+
{
2
2
+
lib,
3
3
+
currentSystem,
4
4
+
bash,
5
5
+
busybox,
6
6
+
}:
7
7
+
8
8
+
{
9
9
+
path ? [ ],
10
10
+
src ? null,
11
11
+
...
12
12
+
}@args:
13
13
+
command:
14
14
+
15
15
+
let
16
16
+
setup =
17
17
+
if src != null then
18
18
+
''
19
19
+
cp -r ${src} src
20
20
+
cd src
21
21
+
chmod -R u+w .
22
22
+
''
23
23
+
else
24
24
+
"";
25
25
+
in
26
26
+
27
27
+
derivation (
28
28
+
{
29
29
+
system = currentSystem;
30
30
+
builder = "${bash}/bin/bash";
31
31
+
args = [
32
32
+
"-euc"
33
33
+
''
34
34
+
if [ 0 -eq "$NIX_BUILD_CORES" ]; then
35
35
+
NIX_BUILD_CORES=$(${busybox}/bin/nproc)
36
36
+
fi
37
37
+
exec ${bash}/bin/bash -eux $commandPath
38
38
+
''
39
39
+
];
40
40
+
PATH = lib.makeBinPath (
41
41
+
path
42
42
+
++ [
43
43
+
bash
44
44
+
busybox
45
45
+
]
46
46
+
);
47
47
+
command = setup + "\n" + command;
48
48
+
passAsFile = [ "command" ];
49
49
+
}
50
50
+
// (removeAttrs args [
51
51
+
"path"
52
52
+
"src"
53
53
+
])
54
54
+
)