Compare commits

..

37 commits

Author SHA1 Message Date
be5572e84d
Add build step for ed template in CI workflow 2026-02-16 11:01:54 +11:00
274972e8a4
Update flake.nix 2026-02-16 10:59:10 +11:00
35e550c477
Merge pull request #69 from dwinkler1/update_rde
Update RDE flake.lock
2026-02-16 09:53:55 +11:00
github-actions[bot]
1fca4c0330 [create-pull-request] automated change 2026-02-15 06:59:45 +00:00
github-actions[bot]
4662b867bd flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/c5c7f360c7954b422918b2136087f5d3a8f4937f?narHash=sha256-3LWIQnTBSV3eMliFhk1K5cEAJokJVnnoChY0lcDzqNM%3D' (2026-02-10)
  → 'github:dwinkler1/fran/68b189ab981adae06590ee1929a70c8b86afd2b8?narHash=sha256-DvHfkW3DctWV%2BYnigY4%2B5Stn9NgI38JqR2IScXDX8z8%3D' (2026-02-15)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/6c5e707c6b5339359a9a9e215c5e66d6d802fd7a?narHash=sha256-iKZMkr6Cm9JzWlRYW/VPoL0A9jVKtZYiU4zSrVeetIs%3D' (2026-02-11)
  → 'github:NixOS/nixpkgs/3aadb7ca9eac2891d52a9dec199d9580a6e2bf44?narHash=sha256-O1XDr7EWbRp%2BkHrNNgLWgIrB0/US5wvw9K6RERWAj6I%3D' (2026-02-14)
2026-02-15 06:59:44 +00:00
d8fb361e76
Merge pull request #68 from dwinkler1/update_rde
Update RDE flake.lock
2026-02-12 18:31:25 +11:00
github-actions[bot]
a1e803a023 [create-pull-request] automated change 2026-02-12 07:10:13 +00:00
github-actions[bot]
b362614076 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/2db38e08fdadcc0ce3232f7279bab59a15b94482?narHash=sha256-1jZvgZoAagZZB6NwGRv2T2ezPy%2BX6EFDsJm%2BYSlsvEs%3D' (2026-02-09)
  → 'github:NixOS/nixpkgs/6c5e707c6b5339359a9a9e215c5e66d6d802fd7a?narHash=sha256-iKZMkr6Cm9JzWlRYW/VPoL0A9jVKtZYiU4zSrVeetIs%3D' (2026-02-11)
2026-02-12 07:10:12 +00:00
341c830c87
Merge pull request #67 from dwinkler1/update_rde 2026-02-11 20:36:02 +11:00
github-actions[bot]
1376f8ddc5 [create-pull-request] automated change 2026-02-11 07:11:50 +00:00
github-actions[bot]
2863733742 flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/a3879317519fd3685f3b7679a1de4c5ae65a7cb9?narHash=sha256-czGb4RwTBahNNK9S7ySXeTWIrn/jKH%2B74hN/uIS2XrM%3D' (2026-01-19)
  → 'github:dwinkler1/fran/c5c7f360c7954b422918b2136087f5d3a8f4937f?narHash=sha256-3LWIQnTBSV3eMliFhk1K5cEAJokJVnnoChY0lcDzqNM%3D' (2026-02-10)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/fa83fd837f3098e3e678e6cf017b2b36102c7211?narHash=sha256-e7VO/kGLgRMbWtpBqdWl0uFg8Y2XWFMdz0uUJvlML8o%3D' (2026-01-28)
  → 'github:NixOS/nixpkgs/2db38e08fdadcc0ce3232f7279bab59a15b94482?narHash=sha256-1jZvgZoAagZZB6NwGRv2T2ezPy%2BX6EFDsJm%2BYSlsvEs%3D' (2026-02-09)
• Updated input 'nvimConfig':
    'github:dwinkler1/nvimConfig/f0d0d3c4ec0c0345508ac3217ec9bf999335fef4?narHash=sha256-skscpI6AkHV93iecNah21HSVr59AEGimA51kmQ7UOtg%3D' (2026-01-30)
  → 'github:dwinkler1/nvimConfig/8f5c05252e914cb3738039a7ec13eb7d5955227a?narHash=sha256-gem34C89cocBGuWLj7cdrAS5WkrOBp6V%2BycQM/RhcCw%3D' (2026-02-04)
• Updated input 'rixpkgs':
    'github:rstats-on-nix/nixpkgs/4cf98f12168c1974a040ea34756f8dec5cfc793e?narHash=sha256-Z63gLlvj2WnJoi/3/3oOLBipuYII%2BsfTT1C%2B8BTt%2B5c%3D' (2026-01-26)
  → 'github:rstats-on-nix/nixpkgs/0d3fe7afce51d2126fdccf0b717d8048b90e4781?narHash=sha256-Pi8f3LPTFmG7SZeAJEAamOWly1SZhEofT92uBqS4atY%3D' (2026-02-02)
2026-02-11 07:11:49 +00:00
Daniel Winkler
5646308c21 reorganization 2026-01-31 03:09:40 +11:00
Daniel Winkler
0d7caccf06 allow extra runtime deps 2026-01-31 02:56:31 +11:00
Daniel Winkler
a337a9cf1e do track R files 2026-01-31 02:39:43 +11:00
Daniel Winkler
785cdaaa91 added env vars 2026-01-31 02:38:50 +11:00
5acc6c196e
Add step to update dependencies in ed template 2026-01-31 00:57:46 +11:00
47260db047
Change flake directory path from 'rde' to 'ed' 2026-01-31 00:51:51 +11:00
Daniel Winkler
338a5a38dc moved to new default template 2026-01-31 00:46:49 +11:00
Daniel Winkler
94b25e5b5c corrected override inputs 2026-01-31 00:46:27 +11:00
f561def1a6
Merge pull request #66 from dwinkler1/update_rde
Update RDE flake.lock
2026-01-27 15:51:44 +11:00
github-actions[bot]
8d6ea0b0d5 [create-pull-request] automated change 2026-01-27 00:26:17 +00:00
d22cc8f331
Remove nvimcom input from fran in flake.nix
Removed nvimcom input from fran configuration.
2026-01-27 11:25:26 +11:00
4dc39abc1c
Merge pull request #64 from dwinkler1/update_rde
Update RDE flake.lock
2026-01-25 00:50:01 +11:00
github-actions[bot]
0f7687bc39 [create-pull-request] automated change 2026-01-24 06:40:55 +00:00
f76c289185
Merge pull request #65 from dwinkler1/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 5 to 6
2026-01-23 16:05:08 +11:00
dependabot[bot]
bb7dfcbb56
Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-19 07:17:03 +00:00
272d6b5898
Merge pull request #63 from dwinkler1/update_rde
Update RDE flake.lock
2026-01-18 23:32:14 +11:00
github-actions[bot]
c703bf420a [create-pull-request] automated change 2026-01-18 06:39:48 +00:00
dd81600b75
Merge pull request #55 from dwinkler1/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 5 to 6
2026-01-16 19:48:26 +11:00
9ec42ad1e9
Merge pull request #56 from dwinkler1/dependabot/github_actions/DeterminateSystems/update-flake-lock-28
Bump DeterminateSystems/update-flake-lock from 27 to 28
2026-01-16 19:48:15 +11:00
c3bc8f74a6 Cleanup 2026-01-16 19:47:23 +11:00
39311f1822 Update 2026-01-16 19:13:55 +11:00
beda7e9069
Merge pull request #57 from dwinkler1/update_rde 2026-01-13 21:40:25 +11:00
4a9b9a094a
Merge pull request #61 from dwinkler1/copilot/add-ci-checks-for-template 2026-01-13 21:33:56 +11:00
github-actions[bot]
703690472a [create-pull-request] automated change 2026-01-13 06:43:33 +00:00
dependabot[bot]
dc44024b1a
Bump DeterminateSystems/update-flake-lock from 27 to 28
Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 27 to 28.
- [Release notes](https://github.com/determinatesystems/update-flake-lock/releases)
- [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v27...v28)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-version: '28'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 07:01:30 +00:00
dependabot[bot]
c28df1df7d
Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 06:38:37 +00:00
14 changed files with 316 additions and 357 deletions

View file

@ -25,7 +25,7 @@ jobs:
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main - uses: wimpysworld/nothing-but-nix@main
with: with:
hatchet-protocol: 'carve' hatchet-protocol: 'carve'
@ -118,7 +118,7 @@ jobs:
test-with-python: test-with-python:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main - uses: wimpysworld/nothing-but-nix@main
with: with:
hatchet-protocol: 'carve' hatchet-protocol: 'carve'
@ -174,7 +174,7 @@ jobs:
test-with-julia: test-with-julia:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main - uses: wimpysworld/nothing-but-nix@main
with: with:
hatchet-protocol: 'carve' hatchet-protocol: 'carve'

View file

@ -14,7 +14,7 @@ jobs:
matrix: matrix:
os: [macos-latest] os: [macos-latest]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
with: with:
github_access_token: ${{ secrets.GITHUB_TOKEN }} github_access_token: ${{ secrets.GITHUB_TOKEN }}
@ -24,3 +24,4 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community extraPullNames: rstats-on-nix, nix-community
- run: nix build ./templates/rde - run: nix build ./templates/rde
- run: nix build ./templates/ed

View file

@ -10,7 +10,7 @@ jobs:
id-token: "write" id-token: "write"
contents: "read" contents: "read"
steps: steps:
- uses: "actions/checkout@v5" - uses: "actions/checkout@v6"
with: with:
persist-credentials: false persist-credentials: false
- uses: "DeterminateSystems/determinate-nix-action@v3" - uses: "DeterminateSystems/determinate-nix-action@v3"

View file

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main - uses: wimpysworld/nothing-but-nix@main
with: with:
hatchet-protocol: 'carve' hatchet-protocol: 'carve'
@ -23,12 +23,13 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community extraPullNames: rstats-on-nix, nix-community
- run: cd templates/rde/ && nix develop -c p-updateDeps - run: cd templates/rde/ && nix develop -c p-updateDeps
- run: cd templates/ed/ && nix develop -c updateR
- name: Update n flake.lock - name: Update n flake.lock
uses: DeterminateSystems/update-flake-lock@v27 uses: DeterminateSystems/update-flake-lock@v28
with: with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
branch: update_rde branch: update_rde
path-to-flake-dir: "templates/rde" path-to-flake-dir: "templates/ed"
pr-title: "Update RDE flake.lock" # Title of PR to be created pr-title: "Update RDE flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR pr-labels: | # Labels to be set on the PR
dependencies dependencies

View file

@ -6,7 +6,11 @@
path = ./templates/rde; path = ./templates/rde;
description = "Research Development Environment"; description = "Research Development Environment";
}; };
ed = {
path = ./templates/ed;
description = "Simple nvim Environment";
}; };
defaultTemplate = self.templates.rde; };
defaultTemplate = self.templates.ed;
}; };
} }

1
templates/ed/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
templates/ed/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.nvimcom

148
templates/ed/flake.lock generated Normal file
View file

@ -0,0 +1,148 @@
{
"nodes": {
"fran": {
"inputs": {
"nixpkgs": [
"rixpkgs"
]
},
"locked": {
"lastModified": 1771133455,
"narHash": "sha256-DvHfkW3DctWV+YnigY4+5Stn9NgI38JqR2IScXDX8z8=",
"owner": "dwinkler1",
"repo": "fran",
"rev": "68b189ab981adae06590ee1929a70c8b86afd2b8",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "fran",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771043024,
"narHash": "sha256-O1XDr7EWbRp+kHrNNgLWgIrB0/US5wvw9K6RERWAj6I=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3aadb7ca9eac2891d52a9dec199d9580a6e2bf44",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nvimConfig": {
"inputs": {
"fran": [
"fran"
],
"nixpkgs": [
"nixpkgs"
],
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references",
"plugins-r": "plugins-r",
"rixpkgs": [
"rixpkgs"
],
"wrappers": "wrappers"
},
"locked": {
"lastModified": 1770172480,
"narHash": "sha256-gem34C89cocBGuWLj7cdrAS5WkrOBp6V+ycQM/RhcCw=",
"owner": "dwinkler1",
"repo": "nvimConfig",
"rev": "8f5c05252e914cb3738039a7ec13eb7d5955227a",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nvimConfig",
"type": "github"
}
},
"plugins-cmp-pandoc-references": {
"flake": false,
"locked": {
"lastModified": 1743491695,
"narHash": "sha256-XsdneGNJzmRBggk8lz9JNDQYk7wbYfUAF2oZLXzFb9c=",
"owner": "jmbuhr",
"repo": "cmp-pandoc-references",
"rev": "130eae4f75029d6495808e0ea4b769fa1ce4c9ac",
"type": "github"
},
"original": {
"owner": "jmbuhr",
"repo": "cmp-pandoc-references",
"type": "github"
}
},
"plugins-r": {
"flake": false,
"locked": {
"lastModified": 1769736135,
"narHash": "sha256-T4QgcBL+LCXvrEiRE2JW4jtUKl8DKzFHk8czGUO1jgY=",
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "2701ec64f5485e17c0e057081a9ae2058d776464",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"rixpkgs": {
"locked": {
"lastModified": 1770035835,
"narHash": "sha256-Pi8f3LPTFmG7SZeAJEAamOWly1SZhEofT92uBqS4atY=",
"owner": "rstats-on-nix",
"repo": "nixpkgs",
"rev": "0d3fe7afce51d2126fdccf0b717d8048b90e4781",
"type": "github"
},
"original": {
"owner": "rstats-on-nix",
"ref": "2026-02-02",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"fran": "fran",
"nixpkgs": "nixpkgs",
"nvimConfig": "nvimConfig",
"rixpkgs": "rixpkgs"
}
},
"wrappers": {
"inputs": {
"nixpkgs": [
"nvimConfig",
"nixpkgs"
]
},
"locked": {
"lastModified": 1769745458,
"narHash": "sha256-Fq6THKEiAKx+wWQ4wTg9HvOAyD6i8JkWfHVQDZH7Byo=",
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"rev": "cc5e052dd1e93ae75dc06e3fabf46f0820c272f2",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nix-wrapper-modules",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

134
templates/ed/flake.nix Normal file
View file

@ -0,0 +1,134 @@
{
description = "Project Editor";
outputs = {
self,
nixpkgs,
nvimConfig,
...
} @ inputs: let
projectSettings = {pkgs}: {
cats = {
clickhouse = false;
gitPlugins = false;
julia = false;
lua = false;
markdown = false;
nix = true;
optional = false;
python = false;
r = false;
};
settings = let
# With `replace` packages are replaced otherwise they are merged with base packages
replace = pkgs.lib.mkForce;
in {
lang_packages = {
python = replace (
(with pkgs.python3Packages; [
duckdb
polars
])
++ (
if builtins.pathExists ./python-packages.nix
# p: with p; [ ... ]
then import ./python-packages.nix pkgs.python3Packages
else []
)
);
r = replace (
(with pkgs.rpkgs.rPackages; [
fixest
# pkgs.extraRPackages.musicMetadata
])
++ (
if builtins.pathExists ./r-packages.nix
# p: with p.rPackages; [ ... ]
then import ./r-packages.nix pkgs.rpkgs
else []
)
);
julia = replace ([
"StatsBase"
]
++ (
if builtins.pathExists ./julia-packages.nix
# [ ... ]
then import ./julia-packages.nix
else []
));
};
colorscheme = "kanagawa";
background = "dark";
wrapRc = true;
};
binName = "vv";
env = {
IS_PROJECT_EDITOR = "1";
R_LIBS_USER = "./.nvimcom";
};
extraPackages = with pkgs; [
cowsay
];
specs.extraLua = let
name = builtins.baseNameOf (builtins.toString ./.);
in {
data = pkgs.vimPlugins.mini-notify;
before = ["INIT_MAIN"];
config = ''
require("mini.notify").setup()
vim.notify = MiniNotify.make_notify()
vim.notify("Welcome to ${name}!")
'';
};
};
systems = nixpkgs.lib.systems.flakeExposed;
forAllSystems = nixpkgs.lib.genAttrs systems;
overlays = [inputs.nvimConfig.overlays.dependencies];
in {
packages = forAllSystems (system: let
pkgs = import nixpkgs {inherit system overlays;};
baseNvim = nvimConfig.packages.${system}.default;
nvim = (baseNvim.eval (projectSettings {inherit pkgs;})).config.wrapper;
default = nvim;
in {
default = nvim;
});
devShells = forAllSystems (system: let
pkgs = import nixpkgs {inherit system overlays;};
nv = self.packages.${system}.default;
in {
default = pkgs.mkShell {
packages = [nv pkgs.updateR];
};
});
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
rixpkgs.url = "github:dwinkler1/rixpkgs/nixpkgs";
fran = {
url = "github:dwinkler1/fran";
inputs = {
nixpkgs.follows = "rixpkgs";
};
};
nvimConfig = {
url = "github:dwinkler1/nvimConfig";
inputs = {
rixpkgs.follows = "rixpkgs";
nixpkgs.follows = "nixpkgs";
fran.follows = "fran";
};
};
};
}

View file

@ -367,11 +367,6 @@ The CI runs on:
This ensures that users can confidently use the template knowing that all advertised functionality has been verified. This ensures that users can confidently use the template knowing that all advertised functionality has been verified.
## Related Documentation
- [REFACTORING.md](REFACTORING.md) - Technical details about the modular structure
- [SUMMARY.md](SUMMARY.md) - Metrics and comparison with original template
## Usage ## Usage
Use this template with: Use this template with:

View file

@ -1,150 +0,0 @@
# Template Refactoring Summary
## Overview
This document summarizes the refactoring improvements made to the RDE (Research Development Environment) template flake.
## Changes Made
### 1. File Structure Reorganization
**Before**: Single 688-line `flake.nix` file
**After**: Modular structure with 17 files across 5 directories
```
templates/rde/
├── flake.nix (261 lines) - Main configuration
├── README.md - User documentation
├── REFACTORING.md - This file
├── overlays/ (5 files)
│ ├── r.nix - R package configuration
│ ├── python.nix - Python package configuration
│ ├── rix.nix - rstats-on-nix integration
│ ├── theme.nix - Neovim theme setup
│ └── project-scripts.nix - Script wrapper definitions
├── hosts/ (5 files)
│ ├── default.nix - Merges all host configs
│ ├── python.nix - Python command definitions
│ ├── julia.nix - Julia command definitions
│ ├── r.nix - R command definitions
│ └── utils.nix - Utility command definitions
├── lib/ (2 files)
│ ├── shell-hook.nix - Dev shell welcome message
│ └── mini-notify-config.lua - Neovim notification config
└── scripts/ (4 files)
├── initPython.sh - Python project initialization
├── initProject.sh - Project structure setup
├── updateDeps.sh - Dependency update script
└── activateDevenv.sh - Devenv activation
```
### 2. Key Improvements
#### Separation of Concerns
- **Config**: Main configuration stays in flake.nix
- **Overlays**: Package modifications isolated in overlays/
- **Hosts**: Command definitions organized by language in hosts/
- **Scripts**: Shell scripts extracted to scripts/ directory
- **Helpers**: Utility functions in lib/
#### Readability
- Reduced main file from 688 to 261 lines (62% reduction)
- Added strategic comments explaining key sections
- Extracted long inline strings to separate files
- Grouped related functionality together
#### Maintainability
- Language-specific changes isolated to dedicated files
- Easy to add new languages (create new host/overlay files)
- Easy to modify scripts without touching Nix code
- Clear separation between different concerns
#### Reusability
- Individual overlays can be reused in other projects
- Host definitions can be copied/modified independently
- Scripts can be tested/modified separately
- Modular design allows selective adoption
### 3. Specific Extractions
#### Shell Scripts (200+ lines → 4 files)
- `initPython.sh`: Python project initialization logic
- `initProject.sh`: Directory structure and git setup
- `updateDeps.sh`: Dependency update automation
- `activateDevenv.sh`: Devenv shell activation
#### Overlays (100+ lines → 5 files)
- `r.nix`: R package management with rix integration
- `python.nix`: Python package configuration
- `rix.nix`: rstats-on-nix package source
- `theme.nix`: Neovim colorscheme handling
- `project-scripts.nix`: Script wrapper generation
#### Host Definitions (200+ lines → 5 files)
- `python.nix`: marimo, ipy, py, initPython commands
- `julia.nix`: jl, pluto, initJl commands
- `r.nix`: R console command
- `utils.nix`: initProject, updateDeps, devenv commands
- `default.nix`: Merges all host configurations
#### Helper Functions (40+ lines → 2 files)
- `shell-hook.nix`: Dev shell welcome message generation
- `mini-notify-config.lua`: Neovim notification filtering
### 4. Added Documentation
#### README.md
- Overview of template purpose
- Directory structure explanation
- Benefits of modular design
- Configuration instructions
- Extension guidelines
- Usage examples
#### Inline Comments
- Section headers in flake.nix
- Explanation of key configuration blocks
- Purpose of each import
- Documentation of categories and settings
### 5. Benefits Achieved
1. **Maintainability**:
- Changes to one language don't affect others
- Easy to locate and modify specific functionality
- Clear ownership of different components
2. **Readability**:
- Main file is now scannable and understandable
- Related code grouped together
- Inline documentation guides users
3. **Testability**:
- Scripts can be tested independently
- Overlays can be verified in isolation
- Smaller files are easier to debug
4. **Extensibility**:
- Clear patterns for adding new languages
- Easy to add new commands
- Simple to customize per language
5. **Learning**:
- New users can understand the template structure
- Examples in each file guide modifications
- Documentation explains purpose and usage
## Migration Guide
For users of the old template:
1. The functionality remains identical
2. Configuration in the main config section is the same
3. All commands work exactly as before
4. To customize, now edit the specific file in the appropriate directory
## Future Improvements
Possible future enhancements:
- Add validation scripts for configuration
- Create unit tests for individual modules
- Add more language examples (Go, Rust, etc.)
- Create a configuration wizard script
- Add CI/CD integration examples

View file

@ -1,172 +0,0 @@
# Template Refactoring - Complete Summary
## 🎯 Objective Achieved
Successfully refactored the RDE template from a single 688-line file into a modular, maintainable structure.
## 📊 Key Metrics
| Aspect | Before | After | Improvement |
|--------|--------|-------|-------------|
| **Main file (flake.nix)** | 688 lines | 261 lines | **62% reduction** |
| **File structure** | 1 monolithic file | 17 modular files | **Better organized** |
| **Documentation** | 0 lines | 218 lines | **Fully documented** |
| **Directories** | 0 | 5 organized dirs | **Clear structure** |
## 📁 New Structure
```
templates/rde/
├── 📄 flake.nix (261 lines) # Main config - clean & commented
├── 📖 README.md # User guide
├── 📖 REFACTORING.md # Technical details
├── 📂 overlays/ # Package configurations
│ ├── r.nix # R packages
│ ├── python.nix # Python packages
│ ├── rix.nix # R nixpkgs source
│ ├── theme.nix # Neovim themes
│ └── project-scripts.nix # Script wrappers
├── 📂 hosts/ # Command definitions
│ ├── default.nix # Merger
│ ├── python.nix # Python commands
│ ├── julia.nix # Julia commands
│ ├── r.nix # R commands
│ └── utils.nix # Utility commands
├── 📂 lib/ # Helper functions
│ ├── shell-hook.nix # Welcome message
│ └── mini-notify-config.lua # Neovim config
└── 📂 scripts/ # Shell scripts
├── initPython.sh # Python init
├── initProject.sh # Project setup
├── updateDeps.sh # Update deps
└── activateDevenv.sh # Devenv activation
```
## ✨ Key Improvements
### 1. **Separation of Concerns**
- Configuration stays in main flake.nix
- Language-specific code in dedicated files
- Scripts separated from Nix code
- Helpers isolated in lib/
### 2. **Enhanced Readability**
- Main file reduced from 688 → 261 lines
- Strategic comments explain sections
- Clear naming conventions
- Logical grouping of related code
### 3. **Better Maintainability**
- Modify one language without affecting others
- Easy to locate specific functionality
- Clear patterns for adding features
- Reduced risk of breaking changes
### 4. **Improved Extensibility**
- Add new languages: create host + overlay files
- Add new commands: edit relevant host file
- Modify scripts: edit .sh files directly
- Customize behavior: clear config section
### 5. **Comprehensive Documentation**
- README.md: User-facing guide
- REFACTORING.md: Technical details
- Inline comments: Explain key sections
- Examples: Show how to extend
## 🔄 Backwards Compatibility
✅ **Zero Breaking Changes**
- All existing functionality preserved
- Same configuration interface
- All commands work identically
- Migration is seamless
## 🎓 Learning Benefits
### For Users
- Easier to understand template structure
- Clear examples for customization
- Self-documenting code organization
- Guided by inline comments
### For Developers
- Easy to modify individual components
- Clear separation aids debugging
- Modular structure enables testing
- Well-documented refactoring process
## 📈 Before & After Comparison
### Before Refactoring
```nix
{
description = "New Project";
outputs = { ... }: let
config = { ... };
# 200+ lines of inline bash scripts
initPython = ''
#!/usr/bin/env bash
# ... lots of bash code ...
'';
# 100+ lines of overlay definitions
rOverlay = final: prev: let
# ... complex overlay code ...
# 300+ lines of host definitions
hosts = {
marimo = let marimoInit = ''
# ... more inline bash ...
# ... continues for 688 lines total
```
### After Refactoring
```nix
{
description = "New Project";
outputs = { ... }: let
# Clear config section
config = { ... };
# Import from organized modules
rOverlay = import ./overlays/r.nix;
pythonOverlay = import ./overlays/python.nix;
# ... clean imports ...
# Main configuration
projectConfig = forSystems (system:
# ... focused on structure, not details
```
## 🚀 Next Steps
The template is now:
1. ✅ Well-organized and modular
2. ✅ Fully documented
3. ✅ Easy to maintain
4. ✅ Simple to extend
5. ✅ Ready for production use
## 💡 Usage
No changes required for existing users! The template works exactly as before, but now with:
- Better code organization
- Comprehensive documentation
- Easier customization options
- Clearer structure for learning
## 📝 Files Modified
- `flake.nix` - Simplified and reorganized
- Created `overlays/` - Package configurations
- Created `hosts/` - Command definitions
- Created `lib/` - Helper functions
- Created `scripts/` - Shell scripts
- Added `README.md` - User documentation
- Added `REFACTORING.md` - Technical guide
## 🎉 Success!
The refactoring is complete. The template is now significantly more maintainable, readable, and extensible while preserving all original functionality.

View file

@ -4,17 +4,14 @@
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"rixpkgs" "rixpkgs"
],
"nvimcom": [
"plugins-r"
] ]
}, },
"locked": { "locked": {
"lastModified": 1761271358, "lastModified": 1771133455,
"narHash": "sha256-Yf1u/FvSKCD0sr0xmTE/Cwgy7H/YW2L/1R7tbxtLfDw=", "narHash": "sha256-DvHfkW3DctWV+YnigY4+5Stn9NgI38JqR2IScXDX8z8=",
"owner": "dwinkler1", "owner": "dwinkler1",
"repo": "fran", "repo": "fran",
"rev": "3bcaf6aa8b74bb1f754e14d975d64bd970fdbe56", "rev": "68b189ab981adae06590ee1929a70c8b86afd2b8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -46,11 +43,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765425579, "lastModified": 1770172580,
"narHash": "sha256-XQLrlG8Uf1GOBy5EQlPP19foLfF3CY/ruQc9xonyGCQ=", "narHash": "sha256-l/fKPLdKxq7PLRbExDxsS4Esel4yos/NFJOFcDpsm2E=",
"owner": "dwinkler1", "owner": "dwinkler1",
"repo": "nixCatsConfig", "repo": "nixCatsConfig",
"rev": "7fc90930a9cb08aeccd575122f6fc1524ed2c71b", "rev": "98079a0844e53afd0c593c8f4d1ee5381baf36f0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -61,11 +58,11 @@
}, },
"nixCats_2": { "nixCats_2": {
"locked": { "locked": {
"lastModified": 1763330129, "lastModified": 1769085828,
"narHash": "sha256-KbOeWIF52SV53BOeETGO2C5ewaV2Ex9iaXH7G72gOr8=", "narHash": "sha256-TjhFIAtS628+/r3IuYWPcNa++mUMMDDG8PbSfFHXBiA=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "c81551ed87db2aefab30a12cf7425ff94dc0ad64", "rev": "43fbf4d12b0a613f1a792503da4bb2bf270173c7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -76,11 +73,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1765838191, "lastModified": 1771043024,
"narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=", "narHash": "sha256-O1XDr7EWbRp+kHrNNgLWgIrB0/US5wvw9K6RERWAj6I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6", "rev": "3aadb7ca9eac2891d52a9dec199d9580a6e2bf44",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -141,16 +138,16 @@
}, },
"rixpkgs": { "rixpkgs": {
"locked": { "locked": {
"lastModified": 1765802109, "lastModified": 1770035835,
"narHash": "sha256-Aru0TG1mEhIJiaXElFopn5lrAE+pyxfF0JelHOIY4FQ=", "narHash": "sha256-Pi8f3LPTFmG7SZeAJEAamOWly1SZhEofT92uBqS4atY=",
"owner": "rstats-on-nix", "owner": "rstats-on-nix",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "bdfc55ed37f7d1228a856be0f57876596b04477a", "rev": "0d3fe7afce51d2126fdccf0b717d8048b90e4781",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "rstats-on-nix", "owner": "rstats-on-nix",
"ref": "2025-12-15", "ref": "2026-02-02",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -219,7 +219,7 @@
}); });
}; };
inputs = { inputs = {
rixpkgs.url = "github:rstats-on-nix/nixpkgs/2025-12-15"; rixpkgs.url = "github:rstats-on-nix/nixpkgs/2026-02-02";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixCats = { nixCats = {
url = "github:dwinkler1/nixCatsConfig"; url = "github:dwinkler1/nixCatsConfig";
@ -237,7 +237,6 @@
url = "github:dwinkler1/fran"; url = "github:dwinkler1/fran";
inputs = { inputs = {
nixpkgs.follows = "rixpkgs"; nixpkgs.follows = "rixpkgs";
nvimcom.follows = "plugins-r";
}; };
}; };
## Git Plugins ## Git Plugins