Refactor template: extract scripts, overlays, and hosts into separate modules

Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-11 19:26:17 +00:00
commit 3398a72241
17 changed files with 1185 additions and 422 deletions

View file

@ -0,0 +1,14 @@
# Project scripts overlay
config: final: prev: let
# Helper function to substitute config placeholders in scripts
substituteScript = scriptPath:
prev.lib.replaceStrings
["@defaultPackageName@"]
[config.defaultPackageName]
(builtins.readFile scriptPath);
in {
initPython = prev.writeShellScriptBin "initPython" (substituteScript ./scripts/initPython.sh);
initProject = prev.writeShellScriptBin "initProject" (substituteScript ./scripts/initProject.sh);
updateDeps = prev.writeShellScriptBin "updateDeps" (substituteScript ./scripts/updateDeps.sh);
activateDevenv = prev.writeShellScriptBin "activateDevenv" (substituteScript ./scripts/activateDevenv.sh);
}

View file

@ -0,0 +1,7 @@
# Python packages overlay
final: prev: {
python = prev.python3.withPackages (pyPackages:
with pyPackages; [
requests
]);
}

View file

@ -0,0 +1,20 @@
# R packages overlay
final: prev: let
reqPkgs = with final.rpkgs.rPackages;
[
broom
data_table
janitor
languageserver
reprex
styler
tidyverse
]
++ (with final.extraRPackages; [
httpgd
])
++ (prev.lib.optional (builtins.pathExists ./r-packages.nix) (import ./r-packages.nix final.rpkgs));
in {
quarto = final.rpkgs.quarto.override {extraRPackages = reqPkgs;};
rWrapper = final.rpkgs.rWrapper.override {packages = reqPkgs;};
}

View file

@ -0,0 +1,4 @@
# Rix overlay for R packages from rstats-on-nix
inputs: final: prev: {
rpkgs = inputs.rixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system};
}

View file

@ -0,0 +1,12 @@
# Extra theme packages overlay
config: final: prev: let
extraTheme = {
plugin = prev.vimPlugins."${config.theme.extraColorschemePackage.plugin}";
name = config.theme.extraColorschemePackage.name;
config = {
lua = config.theme.extraColorschemePackage.extraLua;
};
};
in {
inherit extraTheme;
}