aboutsummaryrefslogtreecommitdiff
path: root/overlays/morph
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /overlays/morph
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst
Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository
Diffstat (limited to 'overlays/morph')
-rw-r--r--overlays/morph/default.nix5
-rw-r--r--overlays/morph/dry-run.patch59
-rw-r--r--overlays/morph/verbose_nix.patch12
3 files changed, 0 insertions, 76 deletions
diff --git a/overlays/morph/default.nix b/overlays/morph/default.nix
deleted file mode 100644
index 448f051..0000000
--- a/overlays/morph/default.nix
+++ /dev/null
@@ -1,5 +0,0 @@
1self: super: {
2 morph = super.morph.overrideAttrs(old: {
3 patches = (old.patches or []) ++ [ ./verbose_nix.patch ./dry-run.patch ];
4 });
5}
diff --git a/overlays/morph/dry-run.patch b/overlays/morph/dry-run.patch
deleted file mode 100644
index 2ff099e..0000000
--- a/overlays/morph/dry-run.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1diff --git a/morph.go b/morph.go
2index a88414b..e5894df 100644
3--- a/morph.go
4+++ b/morph.go
5@@ -542,6 +542,7 @@ func getNixContext() *nix.NixContext {
6 return &nix.NixContext{
7 EvalMachines: filepath.Join(assetRoot, assets.Friendly, "eval-machines.nix"),
8 ShowTrace: showTrace,
9+ DryRun: *dryRun,
10 KeepGCRoot: *keepGCRoot,
11 AllowBuildShell: *allowBuildShell,
12 }
13@@ -574,8 +575,10 @@ func buildHosts(hosts []nix.Host) (resultPath string, err error) {
14 return
15 }
16
17- fmt.Fprintln(os.Stderr, "nix result path: ")
18- fmt.Println(resultPath)
19+ if resultPath != "" {
20+ fmt.Fprintln(os.Stderr, "nix result path: ")
21+ fmt.Println(resultPath)
22+ }
23 return
24 }
25
26diff --git a/nix/nix.go b/nix/nix.go
27index 6a9cfd5..0f7884b 100644
28--- a/nix/nix.go
29+++ b/nix/nix.go
30@@ -49,6 +49,7 @@ type Deployment struct {
31 type NixContext struct {
32 EvalMachines string
33 ShowTrace bool
34+ DryRun bool
35 KeepGCRoot bool
36 AllowBuildShell bool
37 }
38@@ -269,6 +270,10 @@ func (ctx *NixContext) BuildMachines(deploymentPath string, hosts []Host, nixArg
39 args = append(args, "--show-trace")
40 }
41
42+ if ctx.DryRun {
43+ args = append(args, "--dry-run")
44+ }
45+
46 if nixBuildTargets != "" {
47 args = append(args,
48 "--arg", "buildTargets", nixBuildTargets)
49@@ -308,6 +313,10 @@ func (ctx *NixContext) BuildMachines(deploymentPath string, hosts []Host, nixArg
50 return resultPath, errors.New(errorMessage)
51 }
52
53+ if ctx.DryRun {
54+ return "", err
55+ }
56+
57 resultPath, err = os.Readlink(resultLinkPath)
58 if err != nil {
59 return "", err
diff --git a/overlays/morph/verbose_nix.patch b/overlays/morph/verbose_nix.patch
deleted file mode 100644
index 389a79c..0000000
--- a/overlays/morph/verbose_nix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
1diff --git a/nix/nix.go b/nix/nix.go
2index bb63870..7fe04aa 100644
3--- a/nix/nix.go
4+++ b/nix/nix.go
5@@ -347,6 +347,7 @@ func Push(ctx *ssh.SSHContext, host Host, paths ...string) (err error) {
6 options := mkOptions(host)
7 for _, path := range paths {
8 args := []string{
9+ "-v",
10 "copy",
11 path,
12 "--to", "ssh://" + userArg + host.TargetHost + keyArg,