fix(nixfmt) Formatted modified files to default style

The style of files modified in this branch has been corrected.
This commit is contained in:
Skryta Istota 2025-12-02 15:15:15 +01:00
parent fc79dd5120
commit d8e55a05b2
No known key found for this signature in database
2 changed files with 121 additions and 107 deletions

View file

@ -11,13 +11,16 @@ in
pipelineName, pipelineName,
nixConfig, nixConfig,
}: }:
if ! nixConfig.enable then job else if ! nixConfig.enable
then job
else
(builtins.removeAttrs job ["variables" "cache"]) (builtins.removeAttrs job ["variables" "cache"])
// (prependToBeforeScript ["source setup_nix_ci \"gitlab-ci:pipeline:${pipelineName}:job-deps:${key}\""] job) // (prependToBeforeScript ["source setup_nix_ci \"gitlab-ci:pipeline:${pipelineName}:job-deps:${key}\""] job)
// (appendToAfterScript ["finalize_nix_ci"] job) // (appendToAfterScript ["finalize_nix_ci"] job)
// (let // (let
variables = job.variables or {} // variables =
optionalAttrs nixConfig.enableRunnerCache { job.variables or {}
// optionalAttrs nixConfig.enableRunnerCache {
NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
}; };
in in
@ -26,8 +29,9 @@ in
inherit variables; inherit variables;
}) })
// (let // (let
cache = (toList (job.cache or [])) ++ cache =
(optional nixConfig.enableRunnerCache { (toList (job.cache or []))
++ (optional nixConfig.enableRunnerCache {
key = nixConfig.runnerCacheKey; key = nixConfig.runnerCacheKey;
paths = [".nix-cache/"]; paths = [".nix-cache/"];
}); });

View file

@ -91,10 +91,12 @@
BASH = toString pkgs.bash; BASH = toString pkgs.bash;
TEST = "work"; TEST = "work";
}; };
cache = [{ cache = [
{
name = "some"; name = "some";
paths = ["this"]; paths = ["this"];
}]; }
];
}; };
actual = mkJobPatched { actual = mkJobPatched {
key = "test"; key = "test";
@ -120,13 +122,16 @@
expected = { expected = {
after_script = ["finalize_nix_ci"]; after_script = ["finalize_nix_ci"];
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""]; before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\""];
cache = [{ cache = [
{
name = "some"; name = "some";
paths = ["this"]; paths = ["this"];
}{ }
{
key = "test"; key = "test";
paths = [".nix-cache/"]; paths = [".nix-cache/"];
}]; }
];
variables = { variables = {
NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
BASH = toString pkgs.bash; BASH = toString pkgs.bash;
@ -216,7 +221,8 @@
}; };
}; };
}; };
actual = (mkPipeline { actual =
(mkPipeline {
name = "test"; name = "test";
nixConfig.enable = false; nixConfig.enable = false;
pipeline = { pipeline = {
@ -255,13 +261,16 @@
before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\"" "./init"]; before_script = ["source setup_nix_ci \"gitlab-ci:pipeline:test:job-deps:test\"" "./init"];
script = ["echo Hello World!"]; script = ["echo Hello World!"];
after_script = ["./clean" "finalize_nix_ci"]; after_script = ["./clean" "finalize_nix_ci"];
cache = [{ cache = [
{
key = "simple"; key = "simple";
paths = ["~/random/"]; paths = ["~/random/"];
}{ }
{
key = "random"; key = "random";
paths = [".nix-cache/"]; paths = [".nix-cache/"];
}]; }
];
variables = { variables = {
SAMPLE = "working"; SAMPLE = "working";
HELLO = toString pkgs.hello; HELLO = toString pkgs.hello;
@ -269,7 +278,8 @@
}; };
}; };
}; };
actual = (mkPipeline { actual =
(mkPipeline {
name = "test"; name = "test";
nixConfig = { nixConfig = {
enable = true; enable = true;