From 83df3e21a5a6b845d70272430dcd21a1d90990c0 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Fri, 8 Dec 2023 11:40:36 +0100 Subject: [PATCH] Experiment --- ci/default.nix | 13 ++++++++++++- diff-closures/default.nix | 36 +++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/ci/default.nix b/ci/default.nix index 5cc5a7b..1994688 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -1,4 +1,4 @@ -{inputs, ...}: { +{inputs, config, ...}: { imports = [ inputs.hercules-ci-effects.flakeModule ]; @@ -16,5 +16,16 @@ hour = 13; dayOfWeek = ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"]; }; + pullRequestBody = '' + Update `flake.lock`. See the commit message(s) for details. + + You may reset this branch by deleting it and re-running the update job. xs + + git push origin :${config.hercules-ci.flake-update.updateBranch} + + ``` + ${builtins.readFile config.packages.x86_64-linux.diff-closures} + ``` + ''; }; } diff --git a/diff-closures/default.nix b/diff-closures/default.nix index bf7e818..f480a35 100644 --- a/diff-closures/default.nix +++ b/diff-closures/default.nix @@ -4,16 +4,34 @@ self', ... }: { - packages.diff-closures = pkgs.writeShellApplication { - name = "diff-closures"; - runtimeInputs = [pkgs.ansifilter]; - text = '' - nix store diff-closures --derivation \ - github:aciceri/emacs/master#ccrEmacs \ - "${inputs.self}#ccrEmacs" \ - | ansifilter --text + packages.diff-closures = let + diff-closures-script = pkgs.writeText "diff-closures-script" '' + echo ciao + export NIX_SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt" + # nix --extra-experimental-features "nix-command flakes" \ + # store diff-closures --derivation \ + # github:aciceri/emacs/master#ccrEmacs \ + # "${inputs.self}#ccrEmacs" \ + # | ${pkgs.ansifilter}/bin/ansifilter --text + ''; + in pkgs.runCommandNoCC + "diff-closures" + { + __impure = true; + } + '' + ${pkgs.bubblewrap}/bin/bwrap \ + --dir /run \ + --dev /dev \ + --bind /build /build \ + --bind /proc /proc \ + --bind /etc /etc \ + --chdir /build \ + --setenv PATH "${pkgs.nixVersions.nix_2_14}/bin:${pkgs.busybox}/bin" \ + --ro-bind /nix/store /nix/store \ + --share-net \ + ${pkgs.bash}/bin/bash ${diff-closures-script} > $out ''; - }; apps.diff-closures.program = "${self'.packages.diff-closures}/bin/diff-closures"; };