From f812c409805459e33d960aa36d2c0b9fc0399b62 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 05:02:40 +0000 Subject: [PATCH 1/5] Initial plan From c365b44ff296a40ec5dad9496e4187f917b3cb22 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 05:06:39 +0000 Subject: [PATCH 2/5] Refactor packages into modular structure under packages/ directory Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com> --- flake.nix | 76 +-------------------------------- packages/default.nix | 29 +++++++++++++ packages/f/fwildclusterboot.nix | 30 +++++++++++++ packages/h/httpgd.nix | 17 ++++++++ packages/m/musicMetadata.nix | 9 ++++ packages/s/summclust.nix | 20 +++++++++ packages/s/synthdid.nix | 10 +++++ 7 files changed, 116 insertions(+), 75 deletions(-) create mode 100644 packages/default.nix create mode 100644 packages/f/fwildclusterboot.nix create mode 100644 packages/h/httpgd.nix create mode 100644 packages/m/musicMetadata.nix create mode 100644 packages/s/summclust.nix create mode 100644 packages/s/synthdid.nix diff --git a/flake.nix b/flake.nix index f8a48b7..880b358 100644 --- a/flake.nix +++ b/flake.nix @@ -40,81 +40,7 @@ extraRPackageDeps = { julia-fwildclusterboot = prev.julia-bin.withPackages ["WildBootTests" "StableRNGs"]; }; - extraRPackages = let - fetchfromGitHubJSONFile = path: prev.fetchFromGitHub (builtins.fromJSON (builtins.readFile path)); - in { - ## F - fwildclusterboot = - (prev.rPackages.buildRPackage { - name = "fwildclusterboot"; - src = fetchfromGitHubJSONFile ./versions/fwildclusterboot.json; - propagatedBuildInputs = builtins.attrValues { - inherit - (prev.rPackages) - collapse - dqrng - dreamerr - Formula - generics - gtools - JuliaConnectoR - Matrix - Rcpp - rlang - RcppArmadillo - RcppEigen - ; - inherit (final.extraRPackages) summclust; - }; - }).overrideAttrs (old: { - passthru = (old.passthru or {}) // {juliaPackages = ["WildBootTests" "StableRNGs"];}; - }); - - ## H - httpgd = prev.rPackages.buildRPackage { - name = "httpgd"; - src = fetchfromGitHubJSONFile ./versions/httpgd.json; - propagatedBuildInputs = builtins.attrValues { - inherit - (prev.rPackages) - unigd - cpp11 - AsioHeaders - ; - }; - }; - - ## M - musicMetadata = prev.rPackages.buildRPackage { - name = "musicMetadata"; - src = fetchfromGitHubJSONFile ./versions/musicMetadata.json; - }; - - ## S - summclust = prev.rPackages.buildRPackage { - name = "summclust"; - - src = fetchfromGitHubJSONFile ./versions/summclust.json; - - propagatedBuildInputs = builtins.attrValues { - inherit - (prev.rPackages) - dreamerr - MASS - collapse - generics - cli - rlang - ; - }; - }; - - synthdid = prev.rPackages.buildRPackage { - name = "synthdid"; - src = fetchfromGitHubJSONFile ./versions/synthdid.json; - propagatedBuildInputs = [prev.rPackages.mvtnorm]; - }; - }; + extraRPackages = import ./packages {inherit final prev;}; }; in { # Helper to install R with system dependencies if required diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..55313ec --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,29 @@ +{ + final, + prev, +}: +let + # Shared helper function to fetch from GitHub using JSON version files + fetchfromGitHubJSONFile = path: prev.fetchFromGitHub (builtins.fromJSON (builtins.readFile path)); + + # Reference to the versions directory at the repo root + versionsDir = ../versions; + + # Common arguments passed to all package modules + commonArgs = { + inherit final prev fetchfromGitHubJSONFile versionsDir; + }; +in { + ## F + fwildclusterboot = import ./f/fwildclusterboot.nix commonArgs; + + ## H + httpgd = import ./h/httpgd.nix commonArgs; + + ## M + musicMetadata = import ./m/musicMetadata.nix commonArgs; + + ## S + summclust = import ./s/summclust.nix commonArgs; + synthdid = import ./s/synthdid.nix commonArgs; +} diff --git a/packages/f/fwildclusterboot.nix b/packages/f/fwildclusterboot.nix new file mode 100644 index 0000000..cb0cdbd --- /dev/null +++ b/packages/f/fwildclusterboot.nix @@ -0,0 +1,30 @@ +{ + final, + prev, + fetchfromGitHubJSONFile, + versionsDir, +}: +(prev.rPackages.buildRPackage { + name = "fwildclusterboot"; + src = fetchfromGitHubJSONFile "${versionsDir}/fwildclusterboot.json"; + propagatedBuildInputs = builtins.attrValues { + inherit + (prev.rPackages) + collapse + dqrng + dreamerr + Formula + generics + gtools + JuliaConnectoR + Matrix + Rcpp + rlang + RcppArmadillo + RcppEigen + ; + inherit (final.extraRPackages) summclust; + }; +}).overrideAttrs (old: { + passthru = (old.passthru or {}) // {juliaPackages = ["WildBootTests" "StableRNGs"];}; +}) diff --git a/packages/h/httpgd.nix b/packages/h/httpgd.nix new file mode 100644 index 0000000..75e9f6f --- /dev/null +++ b/packages/h/httpgd.nix @@ -0,0 +1,17 @@ +{ + prev, + fetchfromGitHubJSONFile, + versionsDir, +}: +prev.rPackages.buildRPackage { + name = "httpgd"; + src = fetchfromGitHubJSONFile "${versionsDir}/httpgd.json"; + propagatedBuildInputs = builtins.attrValues { + inherit + (prev.rPackages) + unigd + cpp11 + AsioHeaders + ; + }; +} diff --git a/packages/m/musicMetadata.nix b/packages/m/musicMetadata.nix new file mode 100644 index 0000000..8dcf4ff --- /dev/null +++ b/packages/m/musicMetadata.nix @@ -0,0 +1,9 @@ +{ + prev, + fetchfromGitHubJSONFile, + versionsDir, +}: +prev.rPackages.buildRPackage { + name = "musicMetadata"; + src = fetchfromGitHubJSONFile "${versionsDir}/musicMetadata.json"; +} diff --git a/packages/s/summclust.nix b/packages/s/summclust.nix new file mode 100644 index 0000000..49fff68 --- /dev/null +++ b/packages/s/summclust.nix @@ -0,0 +1,20 @@ +{ + prev, + fetchfromGitHubJSONFile, + versionsDir, +}: +prev.rPackages.buildRPackage { + name = "summclust"; + src = fetchfromGitHubJSONFile "${versionsDir}/summclust.json"; + propagatedBuildInputs = builtins.attrValues { + inherit + (prev.rPackages) + dreamerr + MASS + collapse + generics + cli + rlang + ; + }; +} diff --git a/packages/s/synthdid.nix b/packages/s/synthdid.nix new file mode 100644 index 0000000..ed5a819 --- /dev/null +++ b/packages/s/synthdid.nix @@ -0,0 +1,10 @@ +{ + prev, + fetchfromGitHubJSONFile, + versionsDir, +}: +prev.rPackages.buildRPackage { + name = "synthdid"; + src = fetchfromGitHubJSONFile "${versionsDir}/synthdid.json"; + propagatedBuildInputs = [prev.rPackages.mvtnorm]; +} From e60999227de231d939fe1e34709a0bd7c5ec895e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 05:07:57 +0000 Subject: [PATCH 3/5] Update CI workflow to trigger on flake.nix and packages/ changes Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com> --- .github/workflows/check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bde6521..585d168 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -4,7 +4,9 @@ on: push: paths: - 'flake.lock' + - 'flake.nix' - 'versions/*.json' + - 'packages/**/*.nix' - '.github/workflows/*.yml' - 'test/*.R' concurrency: From 5831d95ce6fd3a7d2ad59dfe2898ad4b654fb18f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 05:47:48 +0000 Subject: [PATCH 4/5] Fix: Add 'final' parameter to all package modules for consistency Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com> --- packages/h/httpgd.nix | 1 + packages/m/musicMetadata.nix | 1 + packages/s/summclust.nix | 1 + packages/s/synthdid.nix | 1 + 4 files changed, 4 insertions(+) diff --git a/packages/h/httpgd.nix b/packages/h/httpgd.nix index 75e9f6f..a770049 100644 --- a/packages/h/httpgd.nix +++ b/packages/h/httpgd.nix @@ -1,4 +1,5 @@ { + final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/m/musicMetadata.nix b/packages/m/musicMetadata.nix index 8dcf4ff..77d527c 100644 --- a/packages/m/musicMetadata.nix +++ b/packages/m/musicMetadata.nix @@ -1,4 +1,5 @@ { + final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/s/summclust.nix b/packages/s/summclust.nix index 49fff68..c6367de 100644 --- a/packages/s/summclust.nix +++ b/packages/s/summclust.nix @@ -1,4 +1,5 @@ { + final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/s/synthdid.nix b/packages/s/synthdid.nix index ed5a819..103f7e5 100644 --- a/packages/s/synthdid.nix +++ b/packages/s/synthdid.nix @@ -1,4 +1,5 @@ { + final, prev, fetchfromGitHubJSONFile, versionsDir, From 789df109ed53aa0339da22968b52f10954ced584 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 05:49:50 +0000 Subject: [PATCH 5/5] Refactor: Pass 'final' only to packages that need it (fwildclusterboot) Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com> --- packages/default.nix | 21 +++++++++++++-------- packages/h/httpgd.nix | 1 - packages/m/musicMetadata.nix | 1 - packages/s/summclust.nix | 1 - packages/s/synthdid.nix | 1 - 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/default.nix b/packages/default.nix index 55313ec..be7a47e 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -9,21 +9,26 @@ let # Reference to the versions directory at the repo root versionsDir = ../versions; - # Common arguments passed to all package modules - commonArgs = { - inherit final prev fetchfromGitHubJSONFile versionsDir; + # Common arguments passed to package modules that don't need 'final' + baseArgs = { + inherit prev fetchfromGitHubJSONFile versionsDir; + }; + + # Arguments for packages that need access to 'final' (for cross-package dependencies) + argsWithFinal = baseArgs // { + inherit final; }; in { ## F - fwildclusterboot = import ./f/fwildclusterboot.nix commonArgs; + fwildclusterboot = import ./f/fwildclusterboot.nix argsWithFinal; ## H - httpgd = import ./h/httpgd.nix commonArgs; + httpgd = import ./h/httpgd.nix baseArgs; ## M - musicMetadata = import ./m/musicMetadata.nix commonArgs; + musicMetadata = import ./m/musicMetadata.nix baseArgs; ## S - summclust = import ./s/summclust.nix commonArgs; - synthdid = import ./s/synthdid.nix commonArgs; + summclust = import ./s/summclust.nix baseArgs; + synthdid = import ./s/synthdid.nix baseArgs; } diff --git a/packages/h/httpgd.nix b/packages/h/httpgd.nix index a770049..75e9f6f 100644 --- a/packages/h/httpgd.nix +++ b/packages/h/httpgd.nix @@ -1,5 +1,4 @@ { - final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/m/musicMetadata.nix b/packages/m/musicMetadata.nix index 77d527c..8dcf4ff 100644 --- a/packages/m/musicMetadata.nix +++ b/packages/m/musicMetadata.nix @@ -1,5 +1,4 @@ { - final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/s/summclust.nix b/packages/s/summclust.nix index c6367de..49fff68 100644 --- a/packages/s/summclust.nix +++ b/packages/s/summclust.nix @@ -1,5 +1,4 @@ { - final, prev, fetchfromGitHubJSONFile, versionsDir, diff --git a/packages/s/synthdid.nix b/packages/s/synthdid.nix index 103f7e5..ed5a819 100644 --- a/packages/s/synthdid.nix +++ b/packages/s/synthdid.nix @@ -1,5 +1,4 @@ { - final, prev, fetchfromGitHubJSONFile, versionsDir,