Compare commits

...

151 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
copilot-swe-agent[bot]
3787de151c Remove basedpyright shell command test (LSP only available in Neovim)
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-13 10:26:07 +00:00
copilot-swe-agent[bot]
8efae381e9 Make quarto and uv available directly in dev shell
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-13 10:14:44 +00:00
github-actions[bot]
703690472a [create-pull-request] automated change 2026-01-13 06:43:33 +00:00
copilot-swe-agent[bot]
3777ab0c91 Add validation to ensure sed commands succeed in enabling languages
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:39:18 +00:00
copilot-swe-agent[bot]
ca5642d51f Improve CI robustness: use mktemp for directories and handle whitespace in sed
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:38:07 +00:00
copilot-swe-agent[bot]
4cd5a343e6 Add additional checks for Quarto, UV, and basedpyright; fix path handling
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:35:30 +00:00
copilot-swe-agent[bot]
0514ba1283 Add comprehensive CI documentation to README files
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:34:23 +00:00
copilot-swe-agent[bot]
cfccd9a010 Fix workflow to include all files and add PR triggers
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:33:25 +00:00
copilot-swe-agent[bot]
849225e22e Add comprehensive functionality tests to CI workflow
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:32:03 +00:00
copilot-swe-agent[bot]
0e775e8259 Initial plan 2026-01-11 20:28:31 +00:00
79665dd77e
Merge pull request #58 from dwinkler1/copilot/improve-template-readability
Refactor RDE template: extract 688-line monolith into modular structure
2026-01-12 07:12:56 +11:00
copilot-swe-agent[bot]
0273515951 Add robust command availability checks to all shell scripts
- Add check for @defaultPackageName@-devenv in activateDevenv.sh
- Add check for uv command in initPython.sh
- Add check for git command in initProject.sh (with graceful degradation)
- Add checks for wget, sed, nix in updateDeps.sh
- Provide clear error messages when commands are not available
- Prevent scripts from failing with cryptic errors when tools are missing

Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 20:11:12 +00:00
copilot-swe-agent[bot]
8fc712be60 Remove trailing whitespace from all files (nitpick)
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:58:58 +00:00
copilot-swe-agent[bot]
2a5a1acd62 Fix runtime errors and improve robustness in host configs and scripts
- Fix KeyError in julia.nix when Project.toml lacks deps table
- Fix incorrect uv args in python.nix (remove --run + --add-flags combination)
- Remove redundant 'uv add ipython' from sync branch in python.nix
- Fix relative paths in project-scripts.nix (./scripts -> ../scripts)
- Fix initProject.sh to check file existence before git add
- Add RVER validation in updateDeps.sh with proper error handling
- Add tool availability checks in updateDeps.sh (uv, julia, devenv)
- Add flake.nix backup before modification in updateDeps.sh
- Ensure updateDeps.sh runs from repository root

Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:48:19 +00:00
copilot-swe-agent[bot]
40095ac868 Add comprehensive inline documentation to all modules and enhance README
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:40:13 +00:00
copilot-swe-agent[bot]
c19248f706 Add comprehensive SUMMARY.md with complete refactoring overview
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:33:15 +00:00
copilot-swe-agent[bot]
cc69aa34f8 Add clarifying comments based on code review feedback
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:32:05 +00:00
copilot-swe-agent[bot]
496c238a12 Add inline comments and extract Lua config for better clarity
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:30:14 +00:00
copilot-swe-agent[bot]
eaecb56186 Extract shell hook to lib/shell-hook.nix for better organization
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:28:09 +00:00
c29efd219c
Merge pull request #60 from dwinkler1/copilot/setup-copilot-instructions
Add GitHub Copilot instructions for repository context
2026-01-12 06:27:25 +11:00
copilot-swe-agent[bot]
3398a72241 Refactor template: extract scripts, overlays, and hosts into separate modules
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:26:17 +00:00
copilot-swe-agent[bot]
42619ade95 Add GitHub Copilot instructions
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
2026-01-11 19:24:26 +00:00
copilot-swe-agent[bot]
3259b58a2e Initial plan 2026-01-11 19:21:19 +00:00
copilot-swe-agent[bot]
5e8f07c560 Initial plan 2026-01-11 19:19:58 +00:00
2a7530817e
Merge pull request #54 from dwinkler1/update_rde 2025-12-20 23:28:40 +11:00
github-actions[bot]
52594bfec2 [create-pull-request] automated change 2025-12-18 06:41:49 +00:00
7bb988ef7d fixed R.nvim 2025-12-11 15:00:29 +11:00
5c22c25853 pin R.nvim to compatible version 2025-12-03 11:33:19 +11: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
3d5cddab45
Merge pull request #53 from dwinkler1/update_rde 2025-10-03 22:45:58 +10:00
github-actions[bot]
8a1f4683e9 [create-pull-request] automated change 2025-10-03 06:34:35 +00:00
497776759e
Merge pull request #52 from dwinkler1/update_rde 2025-10-02 08:04:26 +10:00
github-actions[bot]
c70cb27d3d [create-pull-request] automated change 2025-09-30 06:37:00 +00:00
1deb1b02ff
Merge pull request #51 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-30 09:51:23 +10:00
github-actions[bot]
8c6f283cde [create-pull-request] automated change 2025-09-29 06:37:36 +00:00
e4f74dedf4
Merge pull request #50 from dwinkler1/update_rde 2025-09-27 01:39:51 +10:00
github-actions[bot]
6e4902ab96 [create-pull-request] automated change 2025-09-26 06:35:13 +00:00
6a4c78453c
Merge pull request #49 from dwinkler1/update_rde 2025-09-24 00:25:46 +10:00
github-actions[bot]
0c2ccb0d4a [create-pull-request] automated change 2025-09-23 06:36:24 +00:00
57e2e03d4e
Merge pull request #48 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-22 23:56:23 +10:00
github-actions[bot]
8bae293da4 [create-pull-request] automated change 2025-09-22 06:37:59 +00:00
6d7384424f
Merge pull request #47 from dwinkler1/update_rde 2025-09-20 17:11:42 +10:00
github-actions[bot]
ef83c56fde [create-pull-request] automated change 2025-09-20 06:32:50 +00:00
d2c6f18e54
Merge pull request #46 from dwinkler1/update_rde 2025-09-19 19:34:24 +10:00
github-actions[bot]
14a8607392 [create-pull-request] automated change 2025-09-19 06:35:17 +00:00
aaa2996a67
Merge pull request #45 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-18 22:59:46 +10:00
github-actions[bot]
2a1f500f39 [create-pull-request] automated change 2025-09-18 06:35:25 +00:00
6fc3e1a52e
Merge pull request #44 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-17 19:39:16 +10:00
github-actions[bot]
b30d239c2a [create-pull-request] automated change 2025-09-17 06:36:22 +00:00
47d480dc63
Merge pull request #43 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-17 10:45:42 +10:00
github-actions[bot]
77f0408435 [create-pull-request] automated change 2025-09-16 06:35:52 +00:00
df9d53a033
Merge pull request #42 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-15 20:25:13 +10:00
github-actions[bot]
8afc72cda7 [create-pull-request] automated change 2025-09-14 06:32:33 +00:00
fca8dbd2e8
Merge pull request #41 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-13 17:12:33 +10:00
github-actions[bot]
c526b5d753 [create-pull-request] automated change 2025-09-13 06:31:48 +00:00
97eea5e6e8
Change cron schedule in update.yml
Updated cron schedule to run at 6 AM instead of 3 AM.
2025-09-11 22:36:42 +10:00
c46dc25eae
Merge pull request #39 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-11 22:35:59 +10:00
github-actions[bot]
491da07860 [create-pull-request] automated change 2025-09-11 03:31:28 +00:00
aaa81f9ab4
Merge pull request #40 from dwinkler1/dependabot/github_actions/cachix/cachix-action-16
Bump cachix/cachix-action from 14 to 16
2025-09-08 19:10:25 +10:00
dependabot[bot]
22efe17864
Bump cachix/cachix-action from 14 to 16
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 14 to 16.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v14...v16)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-version: '16'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 06:45:13 +00:00
e2de945cd2
Replace Nix installation steps in workflow 2025-09-08 13:55:45 +10:00
a72562371a trying new update script 2025-09-08 13:45:28 +10:00
f0b60b014a restrict supported systems 2025-09-08 13:39:18 +10:00
790c9ed1c8 update R 2025-09-08 13:31:51 +10:00
489d326dc3
Merge pull request #38 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-07 13:50:44 +10:00
github-actions[bot]
cdf034d455 flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/4d1a0913467710324e8a8c8f851a5add44adec52?narHash=sha256-Eq8CdGjq15ZBa33YI4aQvpYUK9TSka62hWBk1myzgNg%3D' (2025-09-05)
  → 'github:dwinkler1/fran/7967225036991a461d94f9a49f354c1452b975a9?narHash=sha256-MxNO6iiSzmyPPvtdViBUvF4ZZi3BrVB8E%2BWMMKoaF%2B8%3D' (2025-09-06)
• Updated input 'nixCats':
    'github:dwinkler1/nixCatsConfig/f636793576b2615fa2ea0ff076362d22d5ed589e?narHash=sha256-u5M3O3dDSkqiXAyxRYeJ01Vk4hAkcH/GFKUAc1B3Yfg%3D' (2025-09-04)
  → 'github:dwinkler1/nixCatsConfig/ee97b138b525d7dae853acbef3c73b18f7c4885e?narHash=sha256-WX6TrqmyKmSG2tBudY1LL1SRjHQfzi5V2N3QPFfs9eM%3D' (2025-09-06)
2025-09-07 03:31:09 +00:00
8ad62e2708
Merge pull request #37 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-07 01:00:46 +10:00
github-actions[bot]
d8c600888e flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/92983243843c29118843fac3ed1a9bc6b28c4fd5?narHash=sha256-vHgDwk7ME24csmOl/%2BqkBuDEewpAgaMa8UBnuP8G0bQ%3D' (2025-09-04)
  → 'github:dwinkler1/fran/4d1a0913467710324e8a8c8f851a5add44adec52?narHash=sha256-Eq8CdGjq15ZBa33YI4aQvpYUK9TSka62hWBk1myzgNg%3D' (2025-09-05)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/aaff8c16d7fc04991cac6245bee1baa31f72b1e1?narHash=sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2%2BcIGmhz3nrE%3D' (2025-09-02)
  → 'github:nixos/nixpkgs/c6a788f552b7b7af703b1a29802a7233c0067908?narHash=sha256-6n/n1GZQ/vi%2BLhFXMSyoseKdNfc2QQaSBXJdgamrbkE%3D' (2025-09-03)
2025-09-06 03:22:56 +00:00
cb0e4bfb41
Merge pull request #36 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-05 17:37:11 +10:00
github-actions[bot]
eafd4d608a flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/d1276a058255d97e2bda16004c551df10dbf1809?narHash=sha256-k1A6Ztiyb1jcJ0gwBbllL4F6AH%2Br1x6xCJNKC40CiNg%3D' (2025-09-03)
  → 'github:dwinkler1/fran/92983243843c29118843fac3ed1a9bc6b28c4fd5?narHash=sha256-vHgDwk7ME24csmOl/%2BqkBuDEewpAgaMa8UBnuP8G0bQ%3D' (2025-09-04)
• Updated input 'nixCats':
    'github:dwinkler1/nixCatsConfig/8f59d306490283fe65b58e51395f50a4cf485988?narHash=sha256-qo4smKLTdXY7oDsULuFH2qvOkCvPo/n5tAC4M5XU3aM%3D' (2025-09-03)
  → 'github:dwinkler1/nixCatsConfig/f636793576b2615fa2ea0ff076362d22d5ed589e?narHash=sha256-u5M3O3dDSkqiXAyxRYeJ01Vk4hAkcH/GFKUAc1B3Yfg%3D' (2025-09-04)
2025-09-05 03:28:13 +00:00
2a38363866
Merge pull request #35 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-04 21:48:59 +10:00
github-actions[bot]
7b3831e01e flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/a6016c972b5a8d998ae89b301ad8025901568aae?narHash=sha256-z2lefHNhOChWtqALYx3zgAjohJj9aosfm/ZTs%2BpvdOk%3D' (2025-09-02)
  → 'github:dwinkler1/fran/d1276a058255d97e2bda16004c551df10dbf1809?narHash=sha256-k1A6Ztiyb1jcJ0gwBbllL4F6AH%2Br1x6xCJNKC40CiNg%3D' (2025-09-03)
• Updated input 'nixCats':
    'github:dwinkler1/nixCatsConfig/1e4a5d4f2c085906ee007bc52534aa16db596bf6?narHash=sha256-triGhbuBx/cAUfimHQ6qrAzTKkxVTSpL9US52z7q/lo%3D' (2025-09-02)
  → 'github:dwinkler1/nixCatsConfig/8f59d306490283fe65b58e51395f50a4cf485988?narHash=sha256-qo4smKLTdXY7oDsULuFH2qvOkCvPo/n5tAC4M5XU3aM%3D' (2025-09-03)
2025-09-04 03:24:27 +00:00
e4497d06da
Merge pull request #34 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-03 14:16:36 +10:00
github-actions[bot]
0ee79f5340 flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/dbc32c7da72f2986610550bf8d44520b9de831bf?narHash=sha256-a/RyuBb%2BONDYfBCtRNWsuAnH6GexVmI43koyL6nv2MU%3D' (2025-09-01)
  → 'github:dwinkler1/fran/a6016c972b5a8d998ae89b301ad8025901568aae?narHash=sha256-z2lefHNhOChWtqALYx3zgAjohJj9aosfm/ZTs%2BpvdOk%3D' (2025-09-02)
• Updated input 'nixCats':
    'github:dwinkler1/nixCatsConfig/30d08812e5988f7bdb475366d5be4fefe8478ccd?narHash=sha256-UyQFQzoVaUjkv79CvPBRNDWrw0N7sZ6FDi4aBvHXcN8%3D' (2025-09-01)
  → 'github:dwinkler1/nixCatsConfig/1e4a5d4f2c085906ee007bc52534aa16db596bf6?narHash=sha256-triGhbuBx/cAUfimHQ6qrAzTKkxVTSpL9US52z7q/lo%3D' (2025-09-02)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/58dcbf1ec551914c3756c267b8b9c8c86baa1b2f?narHash=sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg%3D' (2025-09-01)
  → 'github:nixos/nixpkgs/aaff8c16d7fc04991cac6245bee1baa31f72b1e1?narHash=sha256-12V64nKG/O/guxSYnr5/nq1EfqwJCdD2%2BcIGmhz3nrE%3D' (2025-09-02)
2025-09-03 03:23:26 +00:00
03c4194f9a
Merge pull request #33 from dwinkler1/update_rde
Update RDE flake.lock
2025-09-02 21:55:16 +10:00
github-actions[bot]
8264dbb3f1 flake.lock: Update
Flake lock file updates:

• Updated input 'fran':
    'github:dwinkler1/fran/9130864022d7bfd97e36858c2a06ea4c2e90e6f4?narHash=sha256-9X2HF/XV28ePXlLvSHtYL2FN/KLQI8yzYTJ059XTc4k%3D' (2025-09-01)
  → 'github:dwinkler1/fran/dbc32c7da72f2986610550bf8d44520b9de831bf?narHash=sha256-a/RyuBb%2BONDYfBCtRNWsuAnH6GexVmI43koyL6nv2MU%3D' (2025-09-01)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/37ff64b7108517f8b6ba5705ee5085eac636a249?narHash=sha256-mBecwgUTWRgClJYqcF%2By4O1bY8PQHqeDpB%2BzsAn%2B/zA%3D' (2025-08-31)
  → 'github:nixos/nixpkgs/58dcbf1ec551914c3756c267b8b9c8c86baa1b2f?narHash=sha256-6FWagzm0b7I/IGigOv9pr6LL7NQ86mextfE8g8Q6HBg%3D' (2025-09-01)
2025-09-02 03:36:26 +00:00
77de361e53 parsing optional r-packages file 2025-09-01 18:30:59 +10:00
66bde1c473 remove devenv stuff 2025-09-01 18:25:44 +10:00
7d7f9aff73 remove devenv stuff 2025-09-01 18:25:06 +10:00
32ed13ca57 removed gitignore 2025-09-01 18:24:36 +10:00
08e48987d4 up 2025-09-01 18:03:50 +10:00
dcc5a73ee4 added fran 2025-09-01 18:03:01 +10:00
df0a95b35a up 2025-09-01 15:24:10 +10:00
d034d1a299 R is updated to weekly rstats-on-nix version 2025-09-01 15:23:45 +10:00
99614a96af new colors 2025-09-01 14:53:51 +10:00
af32e7a267 devenv options 2025-09-01 12:19:25 +10:00
eb6493192f added devenv 2025-09-01 01:27:11 +10:00
7499da9b92 moved config before inputs 2025-08-30 23:09:58 +10:00
49fce77750 disable julia by default 2025-08-30 23:04:58 +10:00
35df7b482f added theme config 2025-08-30 22:58:57 +10:00
7f8b3a491a added pluto notebooks 2025-08-30 17:07:08 +10:00
46ef4ce5f1 Optimize deps 2025-08-29 15:44:54 +10:00
b2b325f16a
Update check_macos.yml 2025-08-29 15:18:55 +10:00
b171648c44
Add extraPullNames to cachix-action 2025-08-29 14:42:35 +10:00
a0e2cd046e
Merge pull request #30 from dwinkler1/update_rde
Update RDE flake.lock
2025-08-29 14:30:47 +10:00
1c17367ab7
Replace magic-nix-cache-action with cachix-action 2025-08-29 14:30:21 +10:00
github-actions[bot]
ebe1c9e4a2 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/ddd1826f294a0ee5fdc198ab72c8306a0ea73aa9?narHash=sha256-Om8adB1lfkU7D33VpR%2B/haZ2gI5r3Q%2BZbIPzE5sYnwE%3D' (2025-08-27)
  → 'github:nixos/nixpkgs/aca2499b79170038df0dbaec8bf2f689b506ad32?narHash=sha256-tzo7YvAsGlzo4WiIHT0ooR59VHu%2BaKRQdHk7sIyoia4%3D' (2025-08-28)
2025-08-29 03:32:01 +00:00
ab0489e3cf
Merge pull request #29 from dwinkler1/update_rde
Update RDE flake.lock
2025-08-29 00:50:31 +10:00
github-actions[bot]
bec061723d flake.lock: Update
Flake lock file updates:

• Updated input 'nixCats':
    'github:dwinkler1/nixCatsConfig/e39a1272ef82cd467fb0c29d0b8a0ccdca672f67?narHash=sha256-REv%2BGIfWkyCIHfcPzotqpaSHha0LPZ300KsJL%2B9kP40%3D' (2025-08-28)
  → 'github:dwinkler1/nixCatsConfig/c1aa16d681ac53298477e78097fefabdaacc16a7?narHash=sha256-Y06QA/XZ8%2B4nmjwZfFUWMf80slfIxOnylLn8GCmXjew%3D' (2025-08-28)
2025-08-28 14:06:58 +00:00
bf84a83a00 add flake files to git in any case 2025-08-28 23:38:07 +10:00
99109f23b4 better python settings 2025-08-28 23:25:41 +10:00
11ca7d9ed8 fix julia init and all disabled by default 2025-08-28 23:18:50 +10:00
2bcda70c9a better init 2025-08-28 23:14:25 +10:00
35f6c850a0 better python init message 2025-08-28 22:53:08 +10:00
9d69fc9892 rename init function 2025-08-28 22:48:57 +10:00
0306d14d0b only create dirs that do not exist 2025-08-28 22:37:08 +10:00
a0d9b64a38 exporting ipython and better message 2025-08-28 22:12:37 +10:00
d993212660 better git message 2025-08-28 21:53:50 +10:00
4a15e54051 adding flake to git by default 2025-08-28 21:51:34 +10:00
15220f9d21 initialize git when setting up project 2025-08-28 21:46:37 +10:00
32d3fe5ed7 Default package name set by config 2025-08-28 21:38:37 +10:00
33c0955da7 update default template 2025-08-28 21:25:11 +10:00
cdbaf520a4 Update CI 2025-08-28 21:23:49 +10:00
2e8a70ce5f Rebrading 2025-08-28 21:21:26 +10:00
e19f843e06 removed old templates 2025-08-28 21:20:19 +10:00
144eebbcfa Working template 2025-08-28 21:19:49 +10:00
88 changed files with 2424 additions and 4468 deletions

194
.github/copilot-instructions.md vendored Normal file
View file

@ -0,0 +1,194 @@
# GitHub Copilot Instructions for np Repository
## Repository Overview
This repository provides Nix flake templates for setting up Research Development Environments (RDE). The primary template is located in `templates/rde/` and is designed for data science and research projects supporting R, Python, and Julia.
## Project Structure
- `flake.nix` - Root flake defining available templates
- `templates/rde/` - Main RDE template with Neovim-based development environment
- `flake.nix` - Template flake configuration with language support and tooling
- `flake.lock` - Locked dependencies for reproducibility
- `.envrc` - direnv configuration for automatic environment loading
- `.github/workflows/` - CI/CD workflows for testing and updates
- `check.yml` - Tests RDE template on Ubuntu
- `check_macos.yml` - Tests RDE template on macOS
- `update.yml` - Automated daily dependency updates
## Key Technologies
- **Nix Flakes**: Reproducible development environments
- **nixCats**: Custom Neovim configuration framework
- **direnv**: Automatic environment loading
- **Cachix**: Binary cache for faster builds (using `rde`, `rstats-on-nix`, and `nix-community` caches)
## Language Support
The RDE template supports multiple languages, controlled via `config.enabledLanguages` in `templates/rde/flake.nix`:
- **R**: R wrapper, Quarto, air-formatter, language server, and custom R packages via overlays
- **Python**: Python 3, basedpyright LSP, UV package manager
- **Julia**: Julia REPL with Pluto.jl support
## Development Commands
The template provides project-specific commands (prefix with package name, default is `p`):
- `p` - Launch Neovim
- `p-g` - Launch Neovide GUI
- `p-initProject` - Initialize project structure (data/, src/, docs/)
- `p-updateDeps` - Update all dependencies (flake inputs, R packages, Python packages)
- `p-r` - Launch R console
- `p-py` / `p-ipy` - Launch Python/IPython REPL
- `p-marimo` - Launch Marimo notebook
- `p-jl` - Launch Julia REPL
- `p-pluto` - Launch Pluto.jl notebook
- `p-devenv` - Devenv integration (when enabled)
## Nix Flake Conventions
### Configuration Structure
The RDE template uses a centralized `config` object at the top of `flake.nix`:
```nix
config = rec {
defaultPackageName = "p";
enabledLanguages = { julia = false; python = false; r = true; };
enabledPackages = { gitPlugins = enabledLanguages.r; devenv = false; };
theme = { colorscheme = "kanagawa"; background = "dark"; };
};
```
### Overlays Pattern
The template uses multiple overlays to extend nixpkgs:
- `rOverlay` - Adds R packages via rix/rstats-on-nix
- `pythonOverlay` - Configures Python packages
- `rixOverlay` - Integrates R package snapshots from rstats-on-nix
- `projectScriptsOverlay` - Custom shell scripts for project management
- `extraPkgOverlay` - Additional theme and plugin configuration
### Package Categories
nixCats uses categories to organize functionality:
- `lspsAndRuntimeDeps` - Language servers and runtime dependencies
- `startupPlugins` - Neovim plugins loaded at startup
- `optionalPlugins` - Plugins loaded on demand
- `environmentVariables` - Language-specific environment setup
- `extraWrapperArgs` - Additional wrapper arguments (e.g., unset PYTHONPATH for Python)
## Testing & CI/CD
### Local Testing
```bash
# Build the RDE template
nix build ./templates/rde
# Check the RDE template
nix flake check ./templates/rde
# Enter development shell
nix develop ./templates/rde
```
### CI Workflows
- **check.yml**: Runs on pushes to `templates/rde/flake.lock`, builds and checks the template on Ubuntu
- **check_macos.yml**: Tests on macOS when `update_rde` branch is pushed
- **update.yml**: Daily cron job that updates dependencies via `p-updateDeps` and creates PRs
## Dependency Management
### R Packages
R packages are managed through rstats-on-nix pinned snapshots. The date is specified in the `rixpkgs.url` input:
```nix
rixpkgs.url = "github:rstats-on-nix/nixpkgs/2025-12-15";
```
Custom R packages can be added in `rOverlay` or via `r-packages.nix` file.
### Python Packages
Python packages use UV for management with nixpkgs Python as the interpreter:
- Environment variables force UV to use nix Python: `UV_PYTHON_DOWNLOADS = "never"` and `UV_PYTHON = pkgs.python.interpreter`
- PYTHONPATH is explicitly unset via `extraWrapperArgs`
### Flake Inputs
Dependencies are tracked in `flake.lock`. Key inputs include:
- `nixpkgs` - NixOS 25.11
- `rixpkgs` - R package snapshots from rstats-on-nix
- `nixCats` - Custom Neovim configuration framework
- `fran` - Extra R packages overlay
- Plugin inputs for R.nvim ecosystem
## Coding Style & Conventions
1. **Nix Code**:
- Use `rec` for recursive attribute sets when needed
- Prefer `let...in` for local bindings
- Use `lib.optional` and `lib.optionalString` for conditional inclusion
- Keep configuration at the top of the file for easy customization
2. **Shell Scripts** (in overlays):
- Always use `set -euo pipefail` for safety
- Provide user-friendly output with emojis and clear messages
- Check for existing files/directories before creating
3. **Workflows**:
- Use `workflow_dispatch` for manual triggering
- Configure concurrency to cancel in-progress runs
- Use Cachix for binary caching with multiple caches
## Common Patterns
### Adding a New Language
1. Add to `config.enabledLanguages`
2. Create overlay for language-specific packages
3. Add to `categoryDefinitions.lspsAndRuntimeDeps`
4. Add command aliases in `packageDefinitions.hosts`
5. Update `shellHook` with available commands
### Adding Custom Scripts
Add to `projectScriptsOverlay`:
```nix
myScript = prev.writeShellScriptBin "myScript" ''
#!/usr/bin/env bash
set -euo pipefail
# script content
'';
```
### Plugin Integration
For git-based plugins:
1. Add flake input with `flake = false`
2. Reference in nixCats inputs
3. Add to `startupPlugins` or `optionalPlugins` categories
## Important Notes
- The template creates a `.gitignore` that excludes data files by default
- R packages are installed to project-local `.Rlibs/` directory
- Python UV is configured to never download Python, always using nixpkgs version
- The template supports multiple platforms: x86_64-linux, aarch64-linux, aarch64-darwin
- Neovim is wrapped with language-specific environment variables and PATH additions
## File Generation
When asked to initialize projects or generate common files, follow the patterns in:
- `initProjectScript` for project structure
- `.gitignore` template for what to exclude
- `README.md` template for documentation structure

View file

@ -1,9 +1,20 @@
name: "Test template" name: "Test RDE template"
on: on:
workflow_dispatch: # allows manual triggering workflow_dispatch: # allows manual triggering
push: push:
paths: paths:
- 'templates/n/flake.lock' - 'templates/rde/flake.lock'
- 'templates/rde/**/*.nix'
- 'templates/rde/**/*.sh'
- 'templates/rde/**/*.lua'
- '.github/workflows/check.yml'
pull_request:
paths:
- 'templates/rde/flake.lock'
- 'templates/rde/**/*.nix'
- 'templates/rde/**/*.sh'
- 'templates/rde/**/*.lua'
- '.github/workflows/check.yml'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -14,13 +25,199 @@ 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'
- 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 }}
- uses: DeterminateSystems/magic-nix-cache-action@main - uses: cachix/cachix-action@v16
- run: nix build ./templates/n with:
- run: nix flake check ./templates/n name: rde
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community
# - uses: DeterminateSystems/magic-nix-cache-action@main
# Build and basic checks
- name: Build template
run: nix build ./templates/rde
- name: Run flake check
run: nix flake check ./templates/rde
# Test development shell functionality
- name: Test dev shell enters successfully
run: |
cd templates/rde
nix develop --command bash -c "echo 'Dev shell works'"
# Test R functionality (default enabled)
- name: Test R command is available
run: |
cd templates/rde
nix develop --command bash -c "which p-r"
- name: Test R launches and runs basic command
run: |
cd templates/rde
nix develop --command bash -c "p-r --version"
- name: Test R can execute simple code
run: |
cd templates/rde
nix develop --command bash -c "p-r -e 'print(1+1)'"
- name: Test Quarto is available in R environment
run: |
cd templates/rde
nix develop --command bash -c "quarto --version"
# Test Neovim functionality
- name: Test Neovim command is available
run: |
cd templates/rde
nix develop --command bash -c "which p"
- name: Test Neovim launches in headless mode
run: |
cd templates/rde
nix develop --command bash -c "p --headless --version"
# Test utility commands
- name: Test p-initProject command is available
run: |
cd templates/rde
nix develop --command bash -c "which p-initProject"
- name: Test p-initProject creates project structure
run: |
TEST_DIR=$(mktemp -d)
cd "$TEST_DIR"
nix develop $GITHUB_WORKSPACE/templates/rde --command bash -c "p-initProject"
# Verify directories were created
test -d data/raw || exit 1
test -d data/processed || exit 1
test -d src || exit 1
test -f README.md || exit 1
test -f .gitignore || exit 1
echo "Project structure created successfully"
# Cleanup
rm -rf "$TEST_DIR"
- name: Test p-updateDeps command is available
run: |
cd templates/rde
nix develop --command bash -c "which p-updateDeps"
# Test that package is built correctly
- name: Test default package can be run
run: |
cd templates/rde
nix run . -- --headless --version
test-with-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main
with:
hatchet-protocol: 'carve'
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: rde
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community
# Create a temporary directory with Python enabled
- name: Setup test directory with Python enabled
run: |
TEST_DIR=$(mktemp -d)
cp -r templates/rde/. "$TEST_DIR/"
cd "$TEST_DIR"
# Enable Python in the config (handle variations in whitespace)
sed -i 's/python[[:space:]]*=[[:space:]]*false;/python = true;/' flake.nix
# Verify the change was successful
grep -q "python[[:space:]]*=[[:space:]]*true;" flake.nix || {
echo "Error: Failed to enable Python in flake.nix"
exit 1
}
echo "TEST_PYTHON_DIR=$TEST_DIR" >> $GITHUB_ENV
- name: Build with Python enabled
run: |
cd "$TEST_PYTHON_DIR"
nix build
- name: Test Python commands are available
run: |
cd "$TEST_PYTHON_DIR"
nix develop --command bash -c "which p-py && which p-ipy && which p-initPython"
- name: Test Python launches
run: |
cd "$TEST_PYTHON_DIR"
nix develop --command bash -c "p-py --version"
- name: Test Python can execute code
run: |
cd "$TEST_PYTHON_DIR"
nix develop --command bash -c "p-py -c 'print(1+1)'"
- name: Test UV package manager is available
run: |
cd "$TEST_PYTHON_DIR"
nix develop --command bash -c "uv --version"
test-with-julia:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: wimpysworld/nothing-but-nix@main
with:
hatchet-protocol: 'carve'
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: rde
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community
# Create a temporary directory with Julia enabled
- name: Setup test directory with Julia enabled
run: |
TEST_DIR=$(mktemp -d)
cp -r templates/rde/. "$TEST_DIR/"
cd "$TEST_DIR"
# Enable Julia in the config (handle variations in whitespace)
sed -i 's/julia[[:space:]]*=[[:space:]]*false;/julia = true;/' flake.nix
# Verify the change was successful
grep -q "julia[[:space:]]*=[[:space:]]*true;" flake.nix || {
echo "Error: Failed to enable Julia in flake.nix"
exit 1
}
echo "TEST_JULIA_DIR=$TEST_DIR" >> $GITHUB_ENV
- name: Build with Julia enabled
run: |
cd "$TEST_JULIA_DIR"
nix build
- name: Test Julia commands are available
run: |
cd "$TEST_JULIA_DIR"
nix develop --command bash -c "which p-jl && which p-initJl"
- name: Test Julia launches
run: |
cd "$TEST_JULIA_DIR"
nix develop --command bash -c "p-jl --version"
- name: Test Julia can execute code
run: |
cd "$TEST_JULIA_DIR"
nix develop --command bash -c "p-jl -e 'println(1+1)'"

View file

@ -3,7 +3,7 @@ on:
workflow_dispatch: # allows manual triggering workflow_dispatch: # allows manual triggering
push: push:
branches: branches:
- 'update_n' - 'update_rde'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -14,9 +14,14 @@ 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 }}
- uses: DeterminateSystems/magic-nix-cache-action@main - uses: cachix/cachix-action@v16
- run: nix build ./templates/n with:
name: rde
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community
- 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

@ -3,24 +3,34 @@ name: update-flake-lock
on: on:
workflow_dispatch: # allows manual triggering workflow_dispatch: # allows manual triggering
schedule: schedule:
- cron: '0 3 * * *' - cron: '0 6 * * *'
jobs: jobs:
lockfile: lockfile:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Determinate Nix - uses: wimpysworld/nothing-but-nix@main
uses: DeterminateSystems/determinate-nix-action@v3 with:
- uses: DeterminateSystems/magic-nix-cache-action@main hatchet-protocol: 'carve'
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: rde
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: rstats-on-nix, nix-community
- 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_n branch: update_rde
path-to-flake-dir: "templates/n" path-to-flake-dir: "templates/ed"
pr-title: "Update n 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
automated automated

70
README.md Normal file
View file

@ -0,0 +1,70 @@
# Nix Project Templates (np)
A collection of Nix flake templates for reproducible development environments.
## Templates
### RDE (Research Development Environment)
The default template for data science and research projects with support for R, Python, and Julia.
**Quick start:**
```bash
nix flake init -t github:dwinkler1/np#rde
nix develop
```
**Features:**
- 🔬 Multi-language support (R, Python, Julia)
- 📦 Reproducible with Nix
- 🎨 Neovim-based IDE with LSP support
- 📊 Research-focused workflows
- 🔧 Modular and customizable
See [templates/rde/README.md](templates/rde/README.md) for full documentation.
## CI/CD
All templates are automatically tested to ensure functionality:
- **Build Tests**: Templates build successfully on Linux and macOS
- **Functionality Tests**: All commands and language support are verified
- **Configuration Tests**: Multiple configurations (R, Python, Julia) are tested
- **Automated Updates**: Dependencies are updated daily via automated PRs
### CI Workflows
- `.github/workflows/check.yml` - Comprehensive functionality tests (Ubuntu)
- `.github/workflows/check_macos.yml` - macOS compatibility tests
- `.github/workflows/update.yml` - Automated dependency updates
## Usage
1. **Initialize a new project:**
```bash
nix flake init -t github:dwinkler1/np#rde
```
2. **Enter development environment:**
```bash
nix develop
# or with direnv
echo "use flake" > .envrc && direnv allow
```
3. **Start working:**
```bash
p-initProject # Create project structure
p # Launch Neovim
```
## Contributing
Contributions are welcome! Please ensure:
- All templates pass CI tests
- Documentation is updated for new features
- Code follows existing patterns
## License
See [LICENSE](LICENSE) file for details.

View file

@ -2,23 +2,15 @@
description = "Project Templates"; description = "Project Templates";
outputs = {self}: { outputs = {self}: {
templates = { templates = {
n = { rde = {
path = ./templates/n; path = ./templates/rde;
description = "Minimal Development environment"; description = "Research Development Environment";
}; };
r = { ed = {
path = ./templates/r; path = ./templates/ed;
description = "R development environment"; description = "Simple nvim Environment";
};
sci = {
path = ./templates/sci;
description = "Scientific computing environment (Julia, Python, R)";
};
sci_minimal = {
path = ./templates/sci_minimal;
description = "Scientific computing environment (Julia, Python, R) without folder structure";
}; };
}; };
defaultTemplate = self.templates.n; defaultTemplate = self.templates.ed;
}; };
} }

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";
};
};
};
}

199
templates/n/flake.lock generated
View file

@ -1,199 +0,0 @@
{
"nodes": {
"nixCats": {
"inputs": {
"nixCats": "nixCats_2",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-unstable": "nixpkgs-unstable",
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references",
"plugins-cmp-r": "plugins-cmp-r",
"plugins-r": "plugins-r",
"rixpkgs": [
"rixpkgs"
]
},
"locked": {
"lastModified": 1756305715,
"narHash": "sha256-GuNro+bHHMde1X2uoaDS0UwJa1aaVTDvG4KmQOmCAWE=",
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"rev": "e0f5193d7299c36724d17728511260e0d453f0dc",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"type": "github"
}
},
"nixCats_2": {
"locked": {
"lastModified": 1756094250,
"narHash": "sha256-Bkghd2NdQqQfKwSftABMDjnfRMFTJXA/XvvfKVonV/Q=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "7496b06144a15e44301aacea31c3e1ccdb81546e",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1756159630,
"narHash": "sha256-ohMvsjtSVdT/bruXf5ClBh8ZYXRmD4krmjKrXhEvwMg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "84c256e42600cb0fdf25763b48d28df2f25a0c8b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1756159630,
"narHash": "sha256-ohMvsjtSVdT/bruXf5ClBh8ZYXRmD4krmjKrXhEvwMg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "84c256e42600cb0fdf25763b48d28df2f25a0c8b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"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-cmp-pandoc-references_2": {
"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-cmp-r": {
"flake": false,
"locked": {
"lastModified": 1746709841,
"narHash": "sha256-TwmLSILu1H3RyRivCQlbsgUN4dsEqO1E8Hx71N/lFws=",
"owner": "R-nvim",
"repo": "cmp-r",
"rev": "602f399c4efde01147cadfebcc884b7aa154f8b7",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "cmp-r",
"type": "github"
}
},
"plugins-cmp-r_2": {
"flake": false,
"locked": {
"lastModified": 1746709841,
"narHash": "sha256-TwmLSILu1H3RyRivCQlbsgUN4dsEqO1E8Hx71N/lFws=",
"owner": "R-nvim",
"repo": "cmp-r",
"rev": "602f399c4efde01147cadfebcc884b7aa154f8b7",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "cmp-r",
"type": "github"
}
},
"plugins-r": {
"flake": false,
"locked": {
"lastModified": 1755532199,
"narHash": "sha256-mb8HCaMasPUP9JZUkH1sPrtdbhM2HMUkJEKDsRt6wTs=",
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "fd992e1c13ad3df794a30af2e937b994bf7bf4db",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"plugins-r_2": {
"flake": false,
"locked": {
"lastModified": 1755532199,
"narHash": "sha256-mb8HCaMasPUP9JZUkH1sPrtdbhM2HMUkJEKDsRt6wTs=",
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "fd992e1c13ad3df794a30af2e937b994bf7bf4db",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"rixpkgs": {
"locked": {
"lastModified": 1754915244,
"narHash": "sha256-WtdFq/HbvAgq03AMhSAJW35go6R5bqhGNf2KBzXqH2U=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-08-11.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-08-11.tar.gz"
}
},
"root": {
"inputs": {
"nixCats": "nixCats",
"nixpkgs": "nixpkgs",
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references_2",
"plugins-cmp-r": "plugins-cmp-r_2",
"plugins-r": "plugins-r_2",
"rixpkgs": "rixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,314 +0,0 @@
{
description = "New Project";
inputs = {
rixpkgs.url = "https://github.com/rstats-on-nix/nixpkgs/archive/2025-08-11.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixCats.url = "github:dwinkler1/nixCatsConfig";
nixCats.inputs.nixpkgs.follows = "nixpkgs";
nixCats.inputs.rixpkgs.follows = "rixpkgs";
## All git packages managed per project
"plugins-r" = {
url = "github:R-nvim/R.nvim";
flake = false;
};
"plugins-cmp-r" = {
url = "github:R-nvim/cmp-r";
flake = false;
};
"plugins-cmp-pandoc-references" = {
url = "github:jmbuhr/cmp-pandoc-references";
flake = false;
};
};
outputs = {
self,
nixpkgs,
nixCats,
...
} @ inputs: let
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
defaultPackageName = "p";
projectConfig = forSystems (
system: let
inherit (nixCats) utils;
inherit defaultPackageName;
prevPackage = nixCats.packages.${system}.default;
finalPackage = prevPackage.override (prev: {
name = defaultPackageName;
dependencyOverlays =
prev.dependencyOverlays
++ [
(utils.standardPluginOverlay inputs)
## Pull in local rix copy
(final: prev: {
rpkgs = inputs.rixpkgs.legacyPackages.${prev.system};
})
## Define project level R packages
(
final: prev: let
reqPkgs = with prev.rpkgs.rPackages; [
Hmisc
Rcpp
arm
broom
car
data_table
devtools
janitor
konfound
languageserver
quarto
reprex
styler
tidyverse
(buildRPackage {
name = "nvimcom";
src = inputs.plugins-r;
sourceRoot = "source/nvimcom";
buildInputs = with prev.rpkgs; [
R
stdenv.cc.cc
gnumake
];
propagatedBuildInputs = [];
})
];
in {
quarto = prev.rpkgs.quarto.override {extraRPackages = reqPkgs;};
rWrapper = prev.rpkgs.rWrapper.override {packages = reqPkgs;};
}
)
## Define project level Python Packages
## Only use if uv should not be used
(
final: prev: let
reqPkgs = pyPackages:
with pyPackages; [
numpy
polars
requests
];
in {
python = prev.python3.withPackages reqPkgs;
}
)
];
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
{
pkgs,
settings,
categories,
name,
extra,
mkPlugin,
...
} @ packageDef: {
lspsAndRuntimeDeps = {
project = with pkgs; [
];
julia = with pkgs; [
julia-bin
];
python = with pkgs; [
python
nodejs
pyright
uv
];
r = with pkgs; [
rWrapper
quarto
air-formatter
];
};
startupPlugins = {
project = with pkgs.vimPlugins; [
];
gitPlugins = with pkgs.neovimPlugins; [
{
plugin = r;
config.lua = "vim.notify('Using project local R plugin')";
}
];
};
optionalPlugins = {
project = with pkgs.vimPlugins; [
];
gitPlugins = with pkgs.neovimPlugins; [
cmp-r
cmp-pandoc-references
];
};
optionalLuaPreInit = {
project = [
''
local predicate = function(notif)
if not (notif.data.source == "lsp_progress" and notif.data.client_name == "lua_ls") then
return true
end
-- Filter out some LSP progress notifications from 'lua_ls'
return notif.msg:find("Diagnosing") == nil and notif.msg:find("semantic tokens") == nil
end
local custom_sort = function(notif_arr)
return MiniNotify.default_sort(vim.tbl_filter(predicate, notif_arr))
end
require("mini.notify").setup({ content = { sort = custom_sort } })
vim.notify = MiniNotify.make_notify()
''
];
};
optionalLuaAdditions = {
project = [
"vim.notify('Project loaded: ${name}')"
];
};
sharedLibraries = {
project = {
};
};
environmentVariables = {
project = {
};
julia = {
JULIA_NUM_THREADS = "auto";
};
python = {
# Prevent uv from managing Python downloads
UV_PYTHON_DOWNLOADS = "never";
# Force uv to use nixpkgs Python interpreter
UV_PYTHON = pkgs.python.interpreter;
};
r = {
R_LIBS_USER = "./.Rlibs";
};
};
extraWrapperArgs = {
python = [
"--unset PYTHONPATH"
];
};
}
);
packageDefinitions =
prev.packageDefinitions
// {
"${defaultPackageName}" = utils.mergeCatDefs prev.packageDefinitions.n (
{
pkgs,
name,
...
}: {
settings = {
suffix-path = false;
suffix-LD = false;
# your alias may not conflict with your other packages.
aliases = ["pvim"];
hosts = {
g = {
enable = true;
path = {
value = "${pkgs.neovide}/bin/neovide";
args = [
"--add-flags"
"--neovim-bin ${name}"
];
};
};
m = let
preHookInit = ''
# Check if pyproject.toml exists
if [ ! -f "pyproject.toml" ]; then
echo "pyproject.toml not found. Initializing new UV project..."
# Initialize UV project
uv init
# Check if uv init was successful
if [ $? -eq 0 ]; then
echo "UV project initialized successfully."
# Add marimo dependency
echo "Adding marimo dependency..."
uv add marimo
if [ $? -eq 0 ]; then
echo "Marimo added successfully!"
else
echo "Error: Failed to add marimo dependency."
exit 1
fi
else
echo "Error: Failed to initialize UV project."
exit 1
fi
else
echo "pyproject.toml already exists. Syncing...."
uv sync
fi
'';
in {
enable = true;
path = {
value = "${pkgs.uv}/bin/uv";
args = [
"--run"
"${preHookInit}"
"--add-flags"
"run marimo edit"
];
};
};
jl = {
enable = false;
path = {
value = "${pkgs.julia-bin}/bin/julia";
args = ["--add-flags" "--project=@."];
};
};
r = {
enable = true;
path = {
value = "${pkgs.rWrapper}/bin/R";
args = ["--add-flags" "--no-save --no-restore"];
};
};
node.enable = true;
perl.enable = true;
ruby.enable = true;
};
};
categories = {
julia = false;
python = false;
r = true;
project = true;
gitPlugins = true;
};
}
);
};
});
in
utils.mkAllWithDefault finalPackage
);
in {
packages = projectConfig;
devShells = forSystems (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.mkShell {
name = defaultPackageName;
packages = [projectConfig.${system}.default];
inputsFrom = [];
shellHook = ''
'';
};
});
};
}

View file

@ -1,2 +0,0 @@
data/*
!data/.gitkeep

View file

@ -1,199 +0,0 @@
# zk configuration file
#
# Uncomment the properties you want to customize.
# NOTE SETTINGS
#
# Defines the default options used when generating new notes.
[note]
# Language used when writing notes.
# This is used to generate slugs or with date formats.
#language = "en"
# The default title used for new note, if no `--title` flag is provided.
#default-title = "Untitled"
# Template used to generate a note's filename, without extension.
extension = "md"
filename = "docs/{{slug title}}-{{format-date now '%Y-%m-%d'}}-{{id}}"
language = "en"
# The file extension used for the notes.
#extension = "md"
# Template used to generate a note's content.
# If not an absolute path or "~/unix/path", it's relative to .zk/templates/
template = "default.md"
# Path globs ignored while indexing existing notes.
#exclude = [
# "drafts/*",
# "log.md"
#]
# Configure random ID generation.
# The charset used for random IDs. You can use:
# * letters: only letters from a to z.
# * numbers: 0 to 9
# * alphanum: letters + numbers
# * hex: hexadecimal, from a to f and 0 to 9
# * custom string: will use any character from the provided value
#id-charset = "alphanum"
# Length of the generated IDs.
#id-length = 4
# Letter case for the random IDs, among lower, upper or mixed.
#id-case = "lower"
# EXTRA VARIABLES
#
# A dictionary of variables you can use for any custom values when generating
# new notes. They are accessible in templates with {{extra.<key>}}
[extra]
#key = "value"
# GROUP OVERRIDES
#
# You can override global settings from [note] and [extra] for a particular
# group of notes by declaring a [group."<name>"] section.
#
# Specify the list of directories which will automatically belong to the group
# with the optional `paths` property.
#
# Omitting `paths` is equivalent to providing a single path equal to the name of
# the group. This can be useful to quickly declare a group by the name of the
# directory it applies to.
#[group."<NAME>"]
#paths = ["<DIR1>", "<DIR2>"]
#[group."<NAME>".note]
#filename = "{{format-date now}}"
#[group."<NAME>".extra]
#key = "value"
# MARKDOWN SETTINGS
[format.markdown]
# Format used to generate links between notes.
# Either "wiki", "markdown" or a custom template. Default is "markdown".
link-format = "wiki"
# Indicates whether a link's path will be percent-encoded.
# Defaults to true for "markdown" format and false for "wiki" format.
#link-encode-path = true
# Indicates whether a link's path file extension will be removed.
# Defaults to true.
#link-drop-extension = true
# Enable support for #hashtags.
hashtags = false
# Enable support for :colon:separated:tags:.
colon-tags = true
# Enable support for Bear's #multi-word tags#
# Hashtags must be enabled for multi-word tags to work.
multiword-tags = false
# EXTERNAL TOOLS
[tool]
# Default editor used to open notes. When not set, the EDITOR or VISUAL
# environment variables are used.
#editor = "vim"
# Pager used to scroll through long output. If you want to disable paging
# altogether, set it to an empty string "".
#pager = "less -FIRX"
# Command used to preview a note during interactive fzf mode.
# Set it to an empty string "" to disable preview.
# bat is a great tool to render Markdown document with syntax highlighting.
#https://github.com/sharkdp/bat
#fzf-preview = "bat -p --color always {-1}"
# LSP
#
# Configure basic editor integration for LSP-compatible editors.
# See https://github.com/zk-org/zk/blob/main/docs/editors-integration.md
#
[lsp]
[lsp.diagnostics]
# Each diagnostic can have for value: none, hint, info, warning, error
# Report titles of wiki-links as hints.
wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"
[lsp.completion]
# Customize the completion pop-up of your LSP client.
# Show the note title in the completion pop-up, or fallback on its path if empty.
#note-label = "{{title-or-path}}"
# Filter out the completion pop-up using the note title or its path.
#note-filter-text = "{{title}} {{path}}"
# Show the note filename without extension as detail.
#note-detail = "{{filename-stem}}"
# NAMED FILTERS
#
# A named filter is a set of note filtering options used frequently together.
#
[filter]
# Matches the notes created the last two weeks. For example:
# $ zk list recents --limit 15
# $ zk edit recents --interactive
#recents = "--sort created- --created-after 'last two weeks'"
# COMMAND ALIASES
#
# Aliases are user commands called with `zk <alias> [<flags>] [<args>]`.
#
# The alias will be executed with `$SHELL -c`, please refer to your shell's
# man page to see the available syntax. In most shells:
# * $@ can be used to expand all the provided flags and arguments
# * you can pipe commands together with the usual | character
#
[alias]
# Here are a few aliases to get you started.
# Shortcut to a command.
#ls = "zk list $@"
# Default flags for an existing command.
#list = "zk list --quiet $@"
# Edit the last modified note.
#editlast = "zk edit --limit 1 --sort modified- $@"
# Edit the notes selected interactively among the notes created the last two weeks.
# This alias doesn't take any argument, so we don't use $@.
#recent = "zk edit --sort created- --created-after 'last two weeks' --interactive"
# Print paths separated with colons for the notes found with the given
# arguments. This can be useful to expand a complex search query into a flag
# taking only paths. For example:
# zk list --link-to "`zk path -m potatoe`"
#path = "zk list --quiet --format {{path}} --delimiter , $@"
# Show a random note.
#lucky = "zk list --quiet --format full --sort random --limit 1"
# Returns the Git history for the notes found with the given arguments.
# Note the use of a pipe and the location of $@.
#hist = "zk list --format path --delimiter0 --quiet $@ | xargs -t -0 git log --patch --"
# Edit this configuration file.
#conf = '$EDITOR "$ZK_NOTEBOOK_DIR/.zk/config.toml"'

Binary file not shown.

View file

@ -1,3 +0,0 @@
# {{title}}
{{content}}

View file

@ -1,4 +0,0 @@
rverurl := 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv'
update-r-version:
RVER=$( wget -qO- {{rverurl}} | tail -n 2 | head -n 1 | cut -d',' -f4 | tr -d '"' ) &&\
sed -i "s|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\.tar\.gz\";|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/$RVER.tar.gz\";|" flake.nix

103
templates/r/flake.lock generated
View file

@ -1,103 +0,0 @@
{
"nodes": {
"nCats": {
"inputs": {
"nixCats": "nixCats",
"nixpkgs": [
"nixpkgs"
],
"plugins-r": "plugins-r",
"rixpkgs": "rixpkgs"
},
"locked": {
"lastModified": 1748733634,
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"rev": "7e7ab54f9ab73daf585ef881aa30da1686aab524",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"type": "github"
}
},
"nixCats": {
"locked": {
"lastModified": 1748230488,
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "2a2f15a6c085524ac121f5da9a73ee2155c53d70",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1748662220,
"owner": "nixos",
"repo": "nixpkgs",
"rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"plugins-r": {
"flake": false,
"locked": {
"lastModified": 1748371931,
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "382858fcf23aabbf47ff06279baf69d52260b939",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"rixpkgs": {
"locked": {
"lastModified": 1746476429,
"narHash": "sha256-KHNAOy8ILpIlz5rtwxURpcVOqbWRMoT/rXRgpy1pyG8=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
}
},
"rixpkgs_2": {
"locked": {
"lastModified": 1747664360,
"narHash": "sha256-DskCWKtHNGApsP3PI/HB+fETs3qXpwul3PtSgTb++N4=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
}
},
"root": {
"inputs": {
"nCats": "nCats",
"nixpkgs": "nixpkgs",
"rixpkgs": "rixpkgs_2"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,71 +0,0 @@
{
description = "Project Template";
inputs = {
rixpkgs.url = "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nCats.url = "github:dwinkler1/nixCatsConfig";
nCats.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
nCats,
...
} @ inputs: let
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
in {
packages = forSystems (
system: let
inherit (nCats) utils;
finalPackage = nCats.packages.${system}.default.override (prev: {
dependencyOverlays =
prev.dependencyOverlays
++ [
(utils.standardPluginOverlay inputs)
(final: prev: {
rpkgs = inputs.rixpkgs.legacyPackages.${system};
})
(import (builtins.path {
path = ./rpkgs.nix;
name = "my-rpackages";
}))
];
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
{
pkgs,
settings,
categories,
name,
extra,
mkPlugin,
...
} @ packageDef: {
lspsAndRuntimeDeps.rdev = with pkgs; [
rWrapper
just
wget
];
}
);
packageDefinitions =
prev.packageDefinitions
// {
nixCats = utils.mergeCatDefs prev.packageDefinitions.nixCats (
{...}: {
settings = {
suffix-path = false;
suffix-LD = false;
};
categories = {
rdev = true;
};
}
);
};
});
in
utils.mkAllWithDefault finalPackage
);
};
}

View file

@ -1,34 +0,0 @@
final: prev: let
reqPkgs = with prev.rpkgs.rPackages; [
Hmisc
broom
data_table
dplyr
ggplot2
gt
janitor
psych
tidyr
languageserver
(buildRPackage {
name = "nvimcom";
src = prev.rpkgs.fetchFromGitHub {
owner = "R-nvim";
repo = "R.nvim";
rev = "382858fcf23aabbf47ff06279baf69d52260b939";
sha256 = "sha256-j2rXXO7246Nh8U6XyX43nNTbrire9ta9Ono9Yr+Eh9M=";
};
sourceRoot = "source/nvimcom";
buildInputs = with prev.rpkgs; [
R
stdenv.cc.cc
gnumake
];
propagatedBuildInputs = [];
})
];
in {
quarto = prev.rpkgs.quarto.override {extraRPackages = reqPkgs;};
rWrapper = prev.rpkgs.rWrapper.override {packages = reqPkgs;};
radianWrapper = prev.rpkgs.radianWrapper.override {packages = reqPkgs;};
}

3
templates/rde/.envrc Normal file
View file

@ -0,0 +1,3 @@
export DIRENV_WARN_TIMEOUT=20s
use flake

378
templates/rde/README.md Normal file
View file

@ -0,0 +1,378 @@
# Research Development Environment (RDE) Template
A modular Nix flake template for reproducible research environments with support for R, Python, and Julia. Designed for data science, statistical analysis, and computational research.
## Features
- 🔬 **Multi-language support**: R, Python, Julia with integrated tooling
- 📦 **Reproducible**: Nix ensures consistent environments across machines
- 🎨 **Neovim-based**: Powerful editor with LSP, completion, and more
- 📊 **Research-focused**: Pre-configured for data analysis workflows
- 🔧 **Modular**: Enable only the languages you need
- 📝 **Documented**: Comprehensive inline documentation
## Quick Start
### Installation
```bash
# Initialize a new project with this template
nix flake init -t github:dwinkler1/np#rde
# Enter the development environment
nix develop
# Or use direnv for automatic activation
echo "use flake" > .envrc
direnv allow
```
### First Steps
```bash
# Initialize project structure (creates directories, git repo)
p-initProject
# Enable Python (if needed)
# Edit flake.nix: set enabledLanguages.python = true
# Initialize Python project
p-initPython
# Update all dependencies
p-updateDeps
```
## Structure
The template is organized into several directories for better maintainability:
```
templates/rde/
├── flake.nix # Main flake configuration (261 lines)
├── README.md # This file
├── overlays/ # Nix overlays for packages
│ ├── r.nix # R packages configuration
│ ├── python.nix # Python packages configuration
│ ├── rix.nix # rstats-on-nix integration
│ ├── theme.nix # Neovim theme configuration
│ └── project-scripts.nix # Project initialization scripts
├── hosts/ # Host/command configurations
│ ├── default.nix # Merges all host configs
│ ├── python.nix # Python commands (marimo, ipy, etc.)
│ ├── julia.nix # Julia commands (jl, pluto, etc.)
│ ├── r.nix # R commands
│ └── utils.nix # Utility commands (initProject, etc.)
├── lib/ # Helper functions
│ ├── shell-hook.nix # Dev shell welcome message
│ └── mini-notify-config.lua # Neovim notification filtering
└── scripts/ # Shell scripts
├── initPython.sh # Initialize Python project
├── initProject.sh # Initialize project structure
├── updateDeps.sh # Update all dependencies
└── activateDevenv.sh # Activate devenv shell
```
## Configuration
Edit the `config` section in `flake.nix` to customize your environment:
### Basic Settings
```nix
config = rec {
# Name for your project commands (e.g., myproject-r, myproject-py)
defaultPackageName = "p";
# Enable/disable language support
enabledLanguages = {
julia = false; # Julia with Pluto notebooks
python = false; # Python with uv package manager
r = true; # R with tidyverse and friends
};
# Additional features
enabledPackages = {
gitPlugins = enabledLanguages.r; # R.nvim plugin
devenv = false; # Additional dev environment
};
# Neovim color scheme
theme = rec {
colorscheme = "kanagawa"; # cyberdream, onedark, tokyonight, kanagawa
background = "dark"; # dark or light
};
};
```
### Language-Specific Configuration
#### R Configuration
Edit `overlays/r.nix` to add/remove R packages:
```nix
reqPkgs = with final.rpkgs.rPackages; [
tidyverse # Add your packages here
data_table
# ... more packages
];
```
Or create `r-packages.nix` in your project:
```nix
rpkgs: with rpkgs.rPackages; [
ggplot2
dplyr
]
```
#### Python Configuration
Python packages are managed via `uv`:
```bash
# Add packages to your project
uv add numpy pandas matplotlib
# Or edit pyproject.toml directly
```
#### Julia Configuration
Julia packages use the built-in package manager:
```bash
# In Julia REPL (p-jl)
using Pkg
Pkg.add("DataFrames")
```
## Available Commands
Commands are prefixed with your `defaultPackageName` (default: `p`).
### Editor
- `p` or `p-pvim`: Launch Neovim
- `p-g`: Launch Neovide (GUI)
### R (when enabled)
- `p-r`: R console with pre-loaded packages
- Includes: tidyverse, data.table, languageserver, quarto
### Python (when enabled)
- `p-py`: Python interpreter
- `p-ipy`: IPython REPL (enhanced interactive shell)
- `p-marimo`: Marimo notebooks (reactive notebooks)
- `p-initPython`: Initialize Python project with uv
### Julia (when enabled)
- `p-jl`: Julia REPL with project environment
- `p-pluto`: Pluto.jl notebooks (reactive notebooks)
- `p-initJl`: Initialize Julia project
### Utilities
- `p-initProject`: Create project directory structure
- `p-updateDeps`: Update all dependencies (R, Python, Julia, flake)
## Project Workflow
### 1. Initialize Project
```bash
# Create standardized directory structure
p-initProject
# Creates:
# - data/{raw,processed,interim}/
# - docs/
# - figures/
# - tables/
# - src/{analysis,data_prep,explore,utils}/
# - .gitignore
# - README.md
```
### 2. Set Up Language Environment
**For R:**
```bash
# R is enabled by default
# Just start using it
p-r
```
**For Python:**
```bash
# 1. Enable in flake.nix
# 2. Initialize project
p-initPython
# 3. Add packages
uv add numpy pandas scikit-learn
```
**For Julia:**
```bash
# 1. Enable in flake.nix
# 2. Initialize project
p-initJl
# 3. Packages are managed in Julia REPL
```
### 3. Development
```bash
# Start Neovim
p
# Or use notebooks
p-marimo # Python notebooks
p-pluto # Julia notebooks
# R scripts work with p (Neovim has R support)
```
### 4. Keep Dependencies Updated
```bash
# Update everything at once
p-updateDeps
# This updates:
# - R packages (rixpkgs snapshot)
# - Python packages (via uv)
# - Julia packages (via Pkg)
# - Flake inputs
```
## Benefits of This Structure
1. **Modularity**: Each component is in its own file, making it easier to understand and modify
2. **Maintainability**: Changes to one language or feature don't affect others
3. **Readability**: Main flake.nix is ~261 lines instead of 688 (62% reduction)
4. **Reusability**: Individual modules can be easily reused or replaced
5. **Testability**: Smaller files are easier to test and debug
6. **Documentation**: Comprehensive inline comments explain how everything works
## Extending the Template
### Add New R Packages
**System-wide** (edit `overlays/r.nix`):
```nix
reqPkgs = with final.rpkgs.rPackages; [
tidyverse
yourNewPackage # Add here
];
```
**Project-specific** (create `r-packages.nix`):
```nix
rpkgs: with rpkgs.rPackages; [
projectSpecificPackage
]
```
### Add New Python Packages
```bash
uv add package-name
```
### Add New Commands
Edit the appropriate file in `hosts/`:
- `hosts/python.nix` - Python commands
- `hosts/julia.nix` - Julia commands
- `hosts/r.nix` - R commands
- `hosts/utils.nix` - General utilities
### Add New Scripts
1. Create script in `scripts/`
2. Add to `overlays/project-scripts.nix`
3. Add to appropriate host file
### Customize Neovim
The template uses a pre-configured Neovim (nixCats). To customize:
- Edit theme in `config.theme` section
- Add plugins in `flake.nix` categoryDefinitions
- Modify LSP settings in `categoryDefinitions.lspsAndRuntimeDeps`
## Troubleshooting
### Nix Build Fails
```bash
# Update flake inputs
nix flake update
# Clear cache
nix-collect-garbage
```
### Python Packages Not Found
```bash
# Sync environment
uv sync
# Or re-initialize
p-initPython
```
### R Packages Not Available
```bash
# Update R snapshot
p-updateDeps
# Or check overlays/r.nix for package name
```
## CI and Testing
This template is automatically tested on every change to ensure all functionality works correctly. The CI workflow (`.github/workflows/check.yml`) runs comprehensive tests including:
### Default Configuration Tests (R enabled)
- ✅ Template builds successfully
- ✅ Flake check passes
- ✅ Development shell enters without errors
- ✅ Neovim launches in headless mode
- ✅ R console is available and runs code
- ✅ Utility commands (initProject, updateDeps) are available
- ✅ Project structure creation works correctly
### Python Configuration Tests
- ✅ Template builds with Python enabled
- ✅ Python commands (p-py, p-ipy, p-initPython) are available
- ✅ Python interpreter launches and executes code
### Julia Configuration Tests
- ✅ Template builds with Julia enabled
- ✅ Julia commands (p-jl, p-initJl) are available
- ✅ Julia REPL launches and executes code
The CI runs on:
- Every push to template files (`.nix`, `.sh`, `.lua`, `flake.lock`)
- Every pull request affecting the template
- Manual dispatch for testing
This ensures that users can confidently use the template knowing that all advertised functionality has been verified.
## Usage
Use this template with:
```bash
nix flake init -t github:dwinkler1/np#rde
```
Then run `direnv allow` or enter the dev shell with `nix develop`.

169
templates/rde/flake.lock generated Normal file
View file

@ -0,0 +1,169 @@
{
"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"
}
},
"nixCats": {
"inputs": {
"fran": [
"fran"
],
"nixCats": "nixCats_2",
"nixpkgs": [
"nixpkgs"
],
"plugins-cmp-pandoc-references": [
"plugins-cmp-pandoc-references"
],
"plugins-cmp-r": [
"plugins-cmp-r"
],
"plugins-r": [
"plugins-r"
],
"rixpkgs": [
"rixpkgs"
]
},
"locked": {
"lastModified": 1770172580,
"narHash": "sha256-l/fKPLdKxq7PLRbExDxsS4Esel4yos/NFJOFcDpsm2E=",
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"rev": "98079a0844e53afd0c593c8f4d1ee5381baf36f0",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"type": "github"
}
},
"nixCats_2": {
"locked": {
"lastModified": 1769085828,
"narHash": "sha256-TjhFIAtS628+/r3IuYWPcNa++mUMMDDG8PbSfFHXBiA=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "43fbf4d12b0a613f1a792503da4bb2bf270173c7",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"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"
}
},
"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-cmp-r": {
"flake": false,
"locked": {
"lastModified": 1764700377,
"narHash": "sha256-xb7VFWM/BKAkN7fg62y8n618t2qkQjdYbPwhBhLJwtk=",
"owner": "R-nvim",
"repo": "cmp-r",
"rev": "70bfe8f4c062acc10266e24825439c009a0b1b89",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "cmp-r",
"type": "github"
}
},
"plugins-r": {
"flake": false,
"locked": {
"lastModified": 1763419698,
"narHash": "sha256-GUnRsFF6MlUcFfEsNmm0zXauG3+Pf22OOJNXszOvs+M=",
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "b40fca202f26be4c83875dae489c655f2b834df6",
"type": "github"
},
"original": {
"owner": "R-nvim",
"ref": "v0.99.1",
"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",
"nixCats": "nixCats",
"nixpkgs": "nixpkgs",
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references",
"plugins-cmp-r": "plugins-cmp-r",
"plugins-r": "plugins-r",
"rixpkgs": "rixpkgs"
}
}
},
"root": "root",
"version": 7
}

266
templates/rde/flake.nix Normal file
View file

@ -0,0 +1,266 @@
{
description = "New Project";
outputs = {
self,
nixpkgs,
nixCats,
...
} @ inputs: let
#######################
### PROJECT CONFIG ####
#######################
## Set options below:
config = rec {
## Set project name
defaultPackageName = "p";
## Enable languages
enabledLanguages = {
julia = false;
python = false;
r = true;
};
## Enable packages
enabledPackages = {
## Plugins loaded via flake input
### Always enable when R is enabled
### You can use your own R installation and just enable the plugin
gitPlugins = enabledLanguages.r;
## Create additional dev shells in the project
devenv = false;
};
theme = rec {
## set colortheme and background here
### "cyberdream", "onedark", and "tokyonight" are pre-installed
colorscheme = "kanagawa";
background = "dark";
## Add other colortheme packages and config here
## The default is a best guess
extraColorschemePackage = rec {
name = colorscheme;
extraLua = ''
vim.notify("Loading ${colorscheme} with extra config...")
require('${name}').setup({
commentStyle = {italic = false},
keywordStyle = {italic = false},
theme = 'dragon'
})
'';
plugin = name + "-nvim";
};
};
};
###################################
## ⬆️ BASIC CONFIG ABOVE HERE ⬆️ ##
###################################
# Import overlays from separate files
# Each overlay adds specific packages or configurations
rOverlay = import ./overlays/r.nix;
pythonOverlay = import ./overlays/python.nix;
rixOverlay = import ./overlays/rix.nix inputs;
extraPkgOverlay = import ./overlays/theme.nix config;
projectScriptsOverlay = import ./overlays/project-scripts.nix config;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forSystems = nixpkgs.lib.genAttrs supportedSystems;
# Main package configuration
# This configures the Neovim environment with language support
projectConfig = forSystems (
system: let
inherit (nixCats) utils;
inherit (config) defaultPackageName;
prevPackage = nixCats.packages.${system}.default;
finalPackage = prevPackage.override (prev: {
name = config.defaultPackageName;
dependencyOverlays =
prev.dependencyOverlays
++ [
(utils.standardPluginOverlay inputs)
extraPkgOverlay
rixOverlay
inputs.fran.overlays.default
rOverlay
pythonOverlay
projectScriptsOverlay
];
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
{
pkgs,
settings,
categories,
name,
extra,
mkPlugin,
...
} @ packageDef: {
# Language servers and runtime dependencies
lspsAndRuntimeDeps = {
project = with pkgs; [];
julia = with pkgs; [julia-bin];
python = with pkgs; [python nodejs basedpyright uv];
r = with pkgs; [rWrapper quarto air-formatter];
};
# Plugins that load automatically
startupPlugins = {
project = with pkgs.vimPlugins; [pkgs.extraTheme];
gitPlugins = with pkgs.neovimPlugins; [
{
plugin = r;
config.lua = "vim.notify('Using project local R plugin')";
}
];
};
# Plugins that load on-demand
optionalPlugins = {
project = with pkgs.vimPlugins; [];
gitPlugins = with pkgs.neovimPlugins; [
cmp-r
cmp-pandoc-references
];
};
# Lua code to run before main config
optionalLuaPreInit = {
project = [
(builtins.readFile ./lib/mini-notify-config.lua)
];
};
# Lua code to run after main config
optionalLuaAdditions = {
project = ["vim.notify('Project loaded: ${name}')"];
};
sharedLibraries = {
project = {};
};
# Environment variables for each language
environmentVariables = {
project = {};
julia = {JULIA_NUM_THREADS = "auto";};
python = {
UV_PYTHON_DOWNLOADS = "never";
UV_PYTHON = pkgs.python.interpreter;
};
r = {R_LIBS_USER = "./.Rlibs";};
};
extraWrapperArgs = {
python = ["--unset PYTHONPATH"];
};
}
);
packageDefinitions =
prev.packageDefinitions
// {
# Main package definition
# This creates the command with configured languages and tools
"${config.defaultPackageName}" = utils.mergeCatDefs prev.packageDefinitions.n (
{
pkgs,
name,
...
}: {
settings = {
suffix-path = false;
suffix-LD = false;
aliases = ["pvim"];
# Import all host commands from hosts/ directory
hosts = import ./hosts config pkgs;
};
# Enable/disable features based on config
categories = {
julia = config.enabledLanguages.julia;
python = config.enabledLanguages.python;
r = config.enabledLanguages.r;
project = true;
gitPlugins = config.enabledPackages.gitPlugins;
background = config.theme.background;
colorscheme = config.theme.colorscheme;
};
}
);
};
});
in
utils.mkAllWithDefault finalPackage
);
in {
packages = projectConfig;
# Development shell configuration
devShells = forSystems (system: let
pkgs = import nixpkgs {inherit system;};
# Language-specific packages that should be available in shell
languagePackages = with pkgs;
[]
++ (if config.enabledLanguages.r then [quarto] else [])
++ (if config.enabledLanguages.python then [uv] else [])
++ (if config.enabledLanguages.julia then [] else []);
in {
default = pkgs.mkShell {
name = config.defaultPackageName;
packages = [projectConfig.${system}.default] ++ languagePackages;
inputsFrom = [];
# Welcome message when entering the shell
shellHook = import ./lib/shell-hook.nix config pkgs;
};
});
};
inputs = {
rixpkgs.url = "github:rstats-on-nix/nixpkgs/2026-02-02";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nixCats = {
url = "github:dwinkler1/nixCatsConfig";
inputs = {
nixpkgs.follows = "nixpkgs";
rixpkgs.follows = "rixpkgs";
fran.follows = "fran";
plugins-cmp-pandoc-references.follows = "plugins-cmp-pandoc-references";
plugins-cmp-r.follows = "plugins-cmp-r";
plugins-r.follows = "plugins-r";
};
};
## Extra R packages
fran = {
url = "github:dwinkler1/fran";
inputs = {
nixpkgs.follows = "rixpkgs";
};
};
## Git Plugins
"plugins-r" = {
url = "github:R-nvim/R.nvim/v0.99.1";
flake = false;
};
"plugins-cmp-r" = {
url = "github:R-nvim/cmp-r";
flake = false;
};
"plugins-cmp-pandoc-references" = {
url = "github:jmbuhr/cmp-pandoc-references";
flake = false;
};
};
nixConfig = {
extra-substituters = [
"https://rstats-on-nix.cachix.org"
"https://rde.cachix.org"
];
extra-trusted-public-keys = [
"rstats-on-nix.cachix.org-1:vdiiVgocg6WeJrODIqdprZRUrhi1JzhBnXv7aWI6+F0="
"rde.cachix.org-1:yRxQYM+69N/dVER6HNWRjsjytZnJVXLS/+t/LI9d1D4="
];
};
}

View file

@ -0,0 +1,27 @@
# Merges all host configurations from separate modules
#
# This file combines host definitions from language-specific modules.
# It serves as the single entry point for all command definitions.
#
# Structure:
# - python.nix: Python commands (marimo, ipy, py, initPython)
# - julia.nix: Julia commands (jl, pluto, initJl)
# - r.nix: R commands (r console)
# - utils.nix: Utility commands (initProject, updateDeps, etc.)
#
# Usage:
# This file is imported in flake.nix:
# hosts = import ./hosts config pkgs;
#
# The merged result provides all commands in a single attribute set.
# Commands are enabled/disabled based on config.enabledLanguages settings.
config: pkgs: let
# Import individual host modules
pythonHosts = import ./python.nix config pkgs;
juliaHosts = import ./julia.nix config pkgs;
rHosts = import ./r.nix config pkgs;
utilsHosts = import ./utils.nix config pkgs;
in
# Merge all hosts into single attribute set
# Later definitions override earlier ones in case of conflicts
pythonHosts // juliaHosts // rHosts // utilsHosts

View file

@ -0,0 +1,66 @@
# Julia-related host configurations
#
# This module defines all Julia-related commands available in the dev shell.
# Julia is configured with project-local package management.
#
# Available commands (when Julia is enabled):
# - <name>-jl: Launch Julia REPL with project environment
# - <name>-pluto: Launch Pluto.jl notebook server
# - <name>-initJl: Initialize Julia project and install Pluto
#
# How it works:
# - All commands use --project=. to activate local Project.toml
# - JULIA_NUM_THREADS=auto enables multi-threading
# - Packages are managed via Julia's built-in Pkg manager
#
# Project setup:
# 1. Run <name>-initJl to create Project.toml
# 2. Add packages: julia --project=. -e 'using Pkg; Pkg.add("PackageName")'
# 3. Packages are stored in Project.toml and Manifest.toml
#
# Dependencies: julia-bin (configured in flake.nix)
config: pkgs: {
# jl: Julia REPL with project environment
# Activates local Project.toml for package management
# Use Pkg.add("PackageName") to install packages
jl = {
enable = config.enabledLanguages.julia;
path = {
value = "${pkgs.julia-bin}/bin/julia";
args = ["--add-flags" "--project=."];
};
};
# initJl: Initialize Julia project
# Creates Project.toml and installs Pluto.jl notebook
# Run this once to set up Julia package management
initJl = {
enable = config.enabledLanguages.julia;
path = {
value = "${pkgs.julia-bin}/bin/julia";
args = ["--add-flags" "--project=. -e 'using Pkg; Pkg.instantiate(); Pkg.add(\"Pluto\")'"];
};
};
# pluto: Launch Pluto.jl interactive notebook
# Auto-installs Pluto if not present in Project.toml
# Opens browser with notebook interface
# Notebooks are reactive - cells update automatically
pluto = let
runPluto = ''
import Pkg; import TOML; Pkg.instantiate();
proj = isfile("Project.toml") ? TOML.parsefile(Base.active_project()) : Dict();
deps = get(proj, "deps", Dict());
if !haskey(deps, "Pluto")
Pkg.add("Pluto");
end
import Pluto; Pluto.run();
'';
in {
enable = config.enabledLanguages.julia;
path = {
value = "${pkgs.julia-bin}/bin/julia";
args = ["--add-flags" "--project=. -e '${runPluto}'"];
};
};
}

View file

@ -0,0 +1,96 @@
# Python-related host configurations
#
# This module defines all Python-related commands available in the dev shell.
# Each command is configured with enable conditions and execution paths.
#
# Available commands (when Python is enabled):
# - <name>-marimo: Launch Marimo notebook (interactive Python notebooks)
# - <name>-py: Run Python interpreter
# - <name>-ipy: Launch IPython REPL (enhanced interactive shell)
# - <name>-initPython: Initialize Python project with uv
#
# How it works:
# - Commands are enabled based on config.enabledLanguages.python
# - UV (Python package manager) handles project dependencies
# - Each command auto-initializes project if pyproject.toml doesn't exist
#
# Dependencies: uv, python, nodejs, basedpyright (configured in flake.nix)
config: pkgs: {
# Marimo: Interactive notebook environment for Python
# Auto-initializes UV project and installs marimo on first run
marimo = let
marimoInit = ''
set -euo pipefail
if [[ ! -f "pyproject.toml" ]]; then
echo "🐍 Initializing UV project..."
uv init
echo "📦 Adding Marimo..."
uv add marimo
echo "--------------------------------------------------------------------------"
echo " Python project initialized!"
echo "run 'uv add PACKAGE' to add more python packages."
echo "--------------------------------------------------------------------------"
else
echo "--------------------------------------------------------------------------"
echo "🔄 Syncing existing project..."
uv sync
echo "🐍 Launching Marimo..."
echo "--------------------------------------------------------------------------"
fi
uv run marimo edit "$@"
'';
in {
enable = config.enabledLanguages.python;
path = {
value = "${pkgs.writeShellScriptBin "marimo-wrapper" marimoInit}/bin/marimo-wrapper";
};
};
# py: Standard Python interpreter
# Direct access to Python REPL for quick experiments
py = {
enable = config.enabledLanguages.python;
path = {
value = "${pkgs.python.interpreter}";
};
};
# ipy: IPython - Enhanced interactive Python shell
# Features: syntax highlighting, tab completion, magic commands
# Auto-initializes UV project and installs IPython on first run
ipy = let
ipythonInit = ''
set -euo pipefail
if [[ ! -f "pyproject.toml" ]]; then
echo "🐍 Initializing UV project..."
uv init
echo "📦 Adding IPython..."
uv add ipython
echo "--------------------------------------------------------------------------"
echo " Python project initialized!"
echo "run 'uv add PACKAGE' to add more python packages."
echo "--------------------------------------------------------------------------"
else
echo "--------------------------------------------------------------------------"
echo "🔄 Syncing existing project..."
uv sync
echo "🐍 Launching IPython..."
echo "--------------------------------------------------------------------------"
fi
uv run ipython "$@"
'';
in {
enable = config.enabledLanguages.python;
path = {
value = "${pkgs.writeShellScriptBin "ipy-wrapper" ipythonInit}/bin/ipy-wrapper";
};
};
# initPython: Initialize Python project
# Creates pyproject.toml and adds IPython and Marimo
# Use this to set up Python tooling in an existing project
initPython = {
enable = config.enabledLanguages.python;
path.value = "${pkgs.initPython}/bin/initPython";
};
}

31
templates/rde/hosts/r.nix Normal file
View file

@ -0,0 +1,31 @@
# R-related host configurations
#
# This module defines R-related commands available in the dev shell.
# R is configured with project-local package library and Quarto support.
#
# Available commands (when R is enabled):
# - <name>-r: Launch R console with packages
#
# How it works:
# - Uses rWrapper which includes all packages from overlays/r.nix
# - R_LIBS_USER=./.Rlibs enables project-local package installation
# - --no-save --no-restore ensures clean session startup
#
# Package management:
# - System packages: Edit overlays/r.nix
# - Project packages: Install with install.packages() in R
# - Custom packages: Create r-packages.nix in project root
#
# Dependencies: rWrapper, quarto, air-formatter (configured in flake.nix)
config: pkgs: {
# r: R console with pre-configured packages
# Includes tidyverse, data.table, and other common packages
# Session starts without saving/restoring workspace
r = {
enable = config.enabledLanguages.r;
path = {
value = "${pkgs.rWrapper}/bin/R";
args = ["--add-flags" "--no-save --no-restore"];
};
};
}

View file

@ -0,0 +1,90 @@
# Utility and common host configurations
#
# This module defines general-purpose commands and utilities.
# These commands are available regardless of enabled languages.
#
# Available commands:
# - <name>: Launch Neovim editor (default command)
# - <name>-g: Launch Neovide (GUI for Neovim)
# - <name>-initProject: Initialize project directory structure
# - <name>-updateDeps: Update all dependencies (R, Python, Julia, flake)
# - <name>-initDevenv: Initialize devenv project (if enabled)
# - <name>-devenv: Run devenv commands (if enabled)
# - <name>-activateDevenv: Activate devenv shell (if enabled)
#
# Note: node, perl, ruby are also available but have minimal configuration
#
# Dependencies: neovide, devenv (if enabled), project scripts
config: pkgs: {
# g: Neovide - GUI frontend for Neovim
# Provides smooth scrolling, animations, and GUI features
# Automatically connects to the configured Neovim instance
g = {
enable = true;
path = {
value = "${pkgs.neovide}/bin/neovide";
args = [
"--add-flags"
"--neovim-bin ${config.defaultPackageName}"
];
};
};
# initProject: Initialize research project structure
# Creates standardized directory layout for data analysis
# Sets up: data/, docs/, figures/, tables/, src/
# Also initializes git repository and .gitignore
initProject = {
enable = true;
path = {
value = "${pkgs.initProject}/bin/initProject";
};
};
# initDevenv: Initialize devenv project
# Devenv provides additional development environment features
# Only available if config.enabledPackages.devenv = true
initDevenv = {
enable = config.enabledPackages.devenv;
path = {
value = "${pkgs.devenv}/bin/devenv";
args = ["--add-flags" "init"];
};
};
# activateDevenv: Activate devenv shell
# Automatically runs when entering dev shell if devenv.nix exists
# Only available if config.enabledPackages.devenv = true
activateDevenv = {
enable = config.enabledPackages.devenv;
path = {
value = "${pkgs.activateDevenv}/bin/activateDevenv";
};
};
# devenv: Run devenv commands
# Access to full devenv CLI for managing development environments
# Only available if config.enabledPackages.devenv = true
devenv = {
enable = config.enabledPackages.devenv;
path = {
value = "${pkgs.devenv}/bin/devenv";
};
};
# updateDeps: Update all project dependencies
# Updates: R packages (rixpkgs), Python (uv), Julia (Pkg), flake inputs
# Automatically detects which languages are in use
updateDeps = {
enable = true;
path = {
value = "${pkgs.updateDeps}/bin/updateDeps";
};
};
# Additional language runtimes with minimal configuration
# These are available but not heavily used by this template
node.enable = true; # Node.js runtime (used by some LSPs)
perl.enable = true; # Perl runtime
ruby.enable = true; # Ruby runtime
}

View file

@ -0,0 +1,42 @@
-- Neovim notification configuration using mini.notify
--
-- This file configures the mini.notify plugin to filter out verbose LSP messages.
-- It reduces noise from the Lua language server during development.
--
-- What it does:
-- - Sets up mini.notify as the notification handler
-- - Filters out "Diagnosing" and "semantic tokens" messages from lua_ls
-- - Keeps all other notifications visible
--
-- Usage:
-- Loaded automatically via flake.nix:
-- optionalLuaPreInit.project = [(builtins.readFile ./lib/mini-notify-config.lua)]
--
-- Customization:
-- - Add more patterns to filter in the predicate function
-- - Filter notifications from other LSP servers by client_name
-- - Adjust notification display settings in setup() call
-- Predicate function to filter notifications
-- Returns true if notification should be shown, false to hide it
local predicate = function(notif)
-- Keep all non-LSP notifications
if not (notif.data.source == "lsp_progress" and notif.data.client_name == "lua_ls") then
return true
end
-- Filter out specific verbose LSP progress notifications from lua_ls
-- These messages are too frequent and not useful during development
return notif.msg:find("Diagnosing") == nil and notif.msg:find("semantic tokens") == nil
end
-- Custom sort function that applies filtering
-- Filters notification array before sorting
local custom_sort = function(notif_arr)
return MiniNotify.default_sort(vim.tbl_filter(predicate, notif_arr))
end
-- Initialize mini.notify with custom configuration
require("mini.notify").setup({ content = { sort = custom_sort } })
-- Set mini.notify as the default notification handler
vim.notify = MiniNotify.make_notify()

View file

@ -0,0 +1,56 @@
# Shell hook configuration
#
# This module generates the welcome message displayed when entering the dev shell.
# It provides information about available commands and how to get started.
#
# The message includes:
# - Project name and welcome banner
# - Quick start instructions (initProject, updateDeps)
# - List of all available commands based on enabled languages
# - Instructions for editing configuration
#
# Commands are conditionally shown based on config.enabledLanguages settings.
# This ensures users only see commands relevant to their configuration.
#
# Usage:
# Imported in flake.nix as:
# shellHook = import ./lib/shell-hook.nix config pkgs;
#
# Generates the help message displayed when entering the dev shell
config: pkgs: let
inherit (config) defaultPackageName enabledLanguages enabledPackages;
# Build dynamic list of available commands based on enabled languages
# Filters out empty strings for disabled languages
shellCmds = pkgs.lib.concatLines (pkgs.lib.filter (cmd: cmd != "") [
(pkgs.lib.optionalString enabledLanguages.r " - ${defaultPackageName}-r: Launch R console")
(pkgs.lib.optionalString enabledLanguages.julia " - ${defaultPackageName}-jl: Launch Julia REPL")
(pkgs.lib.optionalString enabledLanguages.julia " - ${defaultPackageName}-pluto: Launch Pluto.jl notebook")
(pkgs.lib.optionalString enabledLanguages.julia " - ${defaultPackageName}-initJl: Init existing Julia project")
(pkgs.lib.optionalString enabledLanguages.python " - ${defaultPackageName}-marimo: Launch Marimo notebook")
(pkgs.lib.optionalString enabledLanguages.python " - ${defaultPackageName}-py: Run python")
(pkgs.lib.optionalString enabledLanguages.python " - ${defaultPackageName}-ipy: Launch IPython REPL")
(pkgs.lib.optionalString enabledLanguages.python " - ${defaultPackageName}-initPython: Init python project")
(pkgs.lib.optionalString enabledPackages.devenv " - ${defaultPackageName}-initDevenv: Init devenv project")
(pkgs.lib.optionalString enabledPackages.devenv " - ${defaultPackageName}-devenv: Run devenv")
" "
"To adjust options run: ${defaultPackageName} flake.nix"
]);
in ''
echo ""
echo "=========================================================================="
echo "🎯 ${defaultPackageName} Development Environment"
echo "---"
echo "📝 Run '${defaultPackageName}-initProject' to set up project structure"
echo "🔄 Run '${defaultPackageName}-updateDeps' to update all dependencies"
echo "---"
echo "🚀 Available commands:"
echo " - ${defaultPackageName}: Launch Neovim"
echo " - ${defaultPackageName}-g: Launch Neovide"
echo "${shellCmds}"
echo "=========================================================================="
echo ""
# Auto-activate devenv shell if devenv.nix exists (can be disabled in config)
${pkgs.lib.optionalString enabledPackages.devenv "${defaultPackageName}-activateDevenv"}
echo ""
''

View file

@ -0,0 +1,39 @@
# Project scripts overlay
#
# This overlay wraps shell scripts from the scripts/ directory as Nix packages.
# Scripts are made available as executable commands with the project name prefix.
#
# How it works:
# 1. Reads shell scripts from scripts/ directory
# 2. Substitutes @defaultPackageName@ with actual package name
# 3. Creates executable packages via writeShellScriptBin
# 4. Scripts become available as: <packageName>-<scriptName>
#
# Available scripts:
# - initPython: Initialize Python project with uv
# - initProject: Set up project directory structure
# - updateDeps: Update all dependencies (R, Python, Julia, flake)
# - activateDevenv: Activate devenv shell if available
#
# Usage: Scripts are automatically available in the dev shell
config: final: prev: let
# Helper function to substitute config placeholders in scripts
# Replaces @defaultPackageName@ with the actual package name from config
substituteScript = scriptPath:
prev.lib.replaceStrings
["@defaultPackageName@"]
[config.defaultPackageName]
(builtins.readFile scriptPath);
in {
# Python project initialization (creates pyproject.toml, adds packages)
initPython = prev.writeShellScriptBin "initPython" (substituteScript ../scripts/initPython.sh);
# Project structure setup (creates directories, git repo, .gitignore)
initProject = prev.writeShellScriptBin "initProject" (substituteScript ../scripts/initProject.sh);
# Update all dependencies (R packages, Python packages, flake inputs)
updateDeps = prev.writeShellScriptBin "updateDeps" (substituteScript ../scripts/updateDeps.sh);
# Activate devenv environment if devenv.nix exists
activateDevenv = prev.writeShellScriptBin "activateDevenv" (substituteScript ../scripts/activateDevenv.sh);
}

View file

@ -0,0 +1,22 @@
# Python packages overlay
#
# This overlay configures the Python environment with essential packages.
# Note: Most Python packages should be managed via uv (pyproject.toml)
# This overlay is for packages needed at the system level.
#
# Usage:
# - Add system-level Python packages to the list below
# - For project-specific packages, use uv (e.g., 'uv add package-name')
# - The Python interpreter is available via pkgs.python
#
# Example additions:
# - numpy, pandas, scipy for scientific computing
# - pytest, black, mypy for development tools
final: prev: {
# Python 3 with system-level packages
python = prev.python3.withPackages (pyPackages:
with pyPackages; [
requests # HTTP library for making API calls
# Add more system-level packages here
]);
}

View file

@ -0,0 +1,39 @@
# R packages overlay
#
# This overlay configures the R environment with essential packages for data analysis.
# It combines packages from rstats-on-nix (rpkgs) with custom packages.
#
# Usage:
# - Edit the package list below to add/remove R packages
# - Create r-packages.nix in your project root to add custom packages
# - Custom file format: rpkgs: with rpkgs.rPackages; [ package1 package2 ]
#
# The overlay exports:
# - quarto: Quarto with R packages
# - rWrapper: R executable with all packages available
final: prev: let
# Core R packages for data analysis and development
reqPkgs = with final.rpkgs.rPackages;
[
broom # Tidy model outputs
data_table # Fast data manipulation
janitor # Data cleaning helpers
languageserver # LSP for IDE support
reprex # Reproducible examples
styler # Code formatting
tidyverse # Data science ecosystem
]
# Additional packages from fran overlay
++ (with final.extraRPackages; [
httpgd # HTTP graphics device for interactive plots
])
# Import custom R packages from project root if file exists
# Users can create r-packages.nix in their project to add more packages
# Example r-packages.nix: rpkgs: with rpkgs.rPackages; [ ggplot2 dplyr ]
++ (prev.lib.optional (builtins.pathExists ./r-packages.nix) (import ./r-packages.nix final.rpkgs));
in {
# Quarto with R support and all required packages
quarto = final.rpkgs.quarto.override {extraRPackages = reqPkgs;};
# R wrapper with all packages pre-loaded
rWrapper = final.rpkgs.rWrapper.override {packages = reqPkgs;};
}

View file

@ -0,0 +1,21 @@
# Rix overlay for R packages from rstats-on-nix
#
# This overlay provides access to R packages from the rstats-on-nix project.
# rstats-on-nix maintains snapshots of CRAN packages built with Nix.
#
# Purpose:
# - Provides reproducible R package versions
# - Ensures binary cache availability for faster builds
# - Maintained by the rstats-on-nix community
#
# The rpkgs attribute gives access to:
# - rpkgs.rPackages: All CRAN packages
# - rpkgs.quarto: Quarto publishing system
# - rpkgs.rWrapper: R with package management
#
# Update the R snapshot date in flake.nix inputs section:
# rixpkgs.url = "github:rstats-on-nix/nixpkgs/YYYY-MM-DD"
inputs: final: prev: {
# R packages from rstats-on-nix for the current system
rpkgs = inputs.rixpkgs.legacyPackages.${prev.stdenv.hostPlatform.system};
}

View file

@ -0,0 +1,30 @@
# Extra theme packages overlay
#
# This overlay configures the Neovim color scheme based on user configuration.
# It transforms the theme config from flake.nix into a Neovim plugin structure.
#
# Usage:
# - Configure theme in flake.nix config.theme section
# - Specify colorscheme name, background (dark/light)
# - Add custom Lua configuration in extraColorschemePackage
#
# The overlay exports:
# - extraTheme: Plugin structure with theme configuration
#
# Built-in themes: cyberdream, onedark, tokyonight, kanagawa
config: final: prev: let
# Transform user theme config into Neovim plugin format
extraTheme = {
# Get the plugin package from nixpkgs
plugin = prev.vimPlugins."${config.theme.extraColorschemePackage.plugin}";
# Theme name for identification
name = config.theme.extraColorschemePackage.name;
# Lua configuration to run when theme loads
config = {
lua = config.theme.extraColorschemePackage.extraLua;
};
};
in {
# Export theme for use in Neovim configuration
inherit extraTheme;
}

View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -f "devenv.nix" ]]; then
echo "🚀 Activating devenv environment..."
if ! command -v @defaultPackageName@-devenv &> /dev/null; then
echo "❌ Command '@defaultPackageName@-devenv' not found."
echo "Ensure devenv is properly configured in your environment."
exit 1
fi
exec @defaultPackageName@-devenv shell
else
echo "❌ No devenv.nix file found in the current directory."
echo "To create one, run '@defaultPackageName@-initDevenv'"
exit 1
fi

View file

@ -0,0 +1,120 @@
#!/usr/bin/env bash
set -euo pipefail
PROJECT_NAME="${1:-@defaultPackageName@}"
echo "🚀 Setting up project: $PROJECT_NAME"
# Create directory structure
directories=(
"data/raw"
"data/processed"
"data/interim"
"docs"
"figures"
"tables"
"src/analysis"
"src/data_prep"
"src/explore"
"src/utils"
)
for dir in "${directories[@]}"; do
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"
echo "✓ Created $dir/"
fi
done
# Create essential files
if [[ ! -f "README.md" ]]; then
cat > README.md << 'EOF'
# RDE
## Project Structure
- `data/`: Data files (gitignored)
- `docs/`: Documentation
- `figures/`: Output figures
- `tables/`: Output tables
- `src/`: Source code
EOF
fi
# Initialize git
if [[ ! -d ".git" ]]; then
if ! command -v git &> /dev/null; then
echo "⚠️ Warning: 'git' command not found. Skipping git initialization."
echo "Install git to enable version control."
else
git init
echo "✓ Initialized Git repository"
fi
fi
# Check if files exist and are not already staged/tracked before adding
if command -v git &> /dev/null && [[ -d ".git" ]]; then
if [[ -f "flake.nix" ]] && ! git diff --cached --name-only 2>/dev/null | grep -q "flake.nix" &&
! git ls-files --error-unmatch flake.nix >/dev/null 2>&1; then
echo "✓ Adding flake.nix to Git repository"
git add flake.nix
elif [[ -f "flake.nix" ]]; then
echo "✓ flake.nix already tracked/staged in Git"
fi
if [[ -f "flake.lock" ]] && ! git diff --cached --name-only 2>/dev/null | grep -q "flake.lock" &&
! git ls-files --error-unmatch flake.lock >/dev/null 2>&1; then
echo "✓ Adding flake.lock to Git repository"
git add flake.lock
elif [[ -f "flake.lock" ]]; then
echo "✓ flake.lock already tracked/staged in Git"
fi
fi
# Create .gitignore
if [[ ! -f ".gitignore" ]]; then
cat > .gitignore << 'EOF'
# Data files
data/
*.csv
*.docx
*.xlsx
*.parquet
# R specific
.Rproj.user/
.Rhistory
.RData
.Ruserdata
*.Rproj
.Rlibs/
# Python specific
__pycache__/
*.pyc
.pytest_cache/
.venv/
# Jupyter
.ipynb_checkpoints/
# IDE
.vscode/
.idea/
# OS
.DS_Store
Thumbs.db
# Devenv
.devenv*
devenv.local.nix
# direnv
.direnv
# pre-commit
.pre-commit-config.yaml
EOF
fi
echo "✅ Project setup completed successfully!"

View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
# Check if uv command is available
if ! command -v uv &> /dev/null; then
echo "❌ Command 'uv' not found."
echo "UV is required for Python project management."
echo "Ensure UV is properly installed in your environment."
exit 1
fi
if [[ ! -f "pyproject.toml" ]]; then
echo "🐍 Initializing UV project..."
uv init
echo "📦 Adding IPython and Marimo..."
uv add ipython
uv add marimo
echo "--------------------------------------------------------------------------"
echo "✅ Python project initialized!"
echo "run 'uv add PACKAGE' to add more python packages."
echo "--------------------------------------------------------------------------"
else
echo "--------------------------------------------------------------------------"
echo "🔄 Existing Python project detected."
echo "📦 Ensuring IPython and Marimo are installed..."
uv add ipython
uv add marimo
echo "Run '@defaultPackageName@-updateDeps' to update dependencies."
echo "--------------------------------------------------------------------------"
fi

View file

@ -0,0 +1,98 @@
#!/usr/bin/env bash
set -euo pipefail
echo "🔄 Updating project dependencies..."
# Check for required commands
if ! command -v wget &> /dev/null; then
echo "❌ Error: 'wget' command not found."
echo "Please install wget to fetch R version information."
exit 1
fi
if ! command -v sed &> /dev/null; then
echo "❌ Error: 'sed' command not found."
echo "Please install sed to update flake.nix."
exit 1
fi
if ! command -v nix &> /dev/null; then
echo "❌ Error: 'nix' command not found."
echo "Please install Nix to update flake inputs."
exit 1
fi
# Ensure we're in the repository root
if [[ ! -f "flake.nix" ]]; then
# Try to find git root
if command -v git &> /dev/null && git rev-parse --show-toplevel >/dev/null 2>&1; then
cd "$(git rev-parse --show-toplevel)"
if [[ ! -f "flake.nix" ]]; then
echo "❌ Error: flake.nix not found in repository root"
exit 1
fi
else
echo "❌ Error: Not in a git repository and flake.nix not found"
exit 1
fi
fi
# Fetch latest R version from rstats-on-nix
# This command chain: downloads CSV, extracts last line, gets 4th field (date), removes quotes
echo "📡 Fetching latest R version from rstats-on-nix..."
RVER=$( wget -qO- 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv' | tail -n 1 | head -n 1 | cut -d',' -f4 | tr -d '"' )
# Validate RVER matches YYYY-MM-DD format
if [[ ! "$RVER" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
echo "❌ Error: Failed to fetch valid R version date. Got: '$RVER'"
exit 1
fi
echo "✅ R date is $RVER"
# Create backup of flake.nix before modifying
cp flake.nix flake.nix.backup
# Update rixpkgs date in flake.nix
if sed -i "s|rixpkgs.url = \"github:rstats-on-nix/nixpkgs/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\";|rixpkgs.url = \"github:rstats-on-nix/nixpkgs/$RVER\";|" flake.nix; then
echo "✅ Updated rixpkgs date in flake.nix"
rm flake.nix.backup
else
echo "⚠️ Warning: Failed to update flake.nix, restoring backup"
mv flake.nix.backup flake.nix
fi
nix flake update
echo "✅ Flake inputs updated"
# Update Python dependencies if pyproject.toml exists and uv is available
if [[ -f "pyproject.toml" ]]; then
if command -v uv >/dev/null 2>&1; then
uv sync --upgrade
echo "✅ Python dependencies updated"
else
echo " pyproject.toml found but uv command not available, skipping Python update"
fi
fi
# Update Julia dependencies if Project.toml exists and julia is available
if [[ -f "Project.toml" ]]; then
if command -v @defaultPackageName@-jl >/dev/null 2>&1; then
@defaultPackageName@-jl -e "using Pkg; Pkg.update()"
echo "✅ Julia dependencies updated"
else
echo " Project.toml found but @defaultPackageName@-jl command not available, skipping Julia update"
fi
fi
# Update devenv dependencies if devenv.nix exists and devenv is available
if [[ -f "devenv.nix" ]]; then
if command -v devenv >/dev/null 2>&1; then
devenv update
echo "✅ Devenv dependencies updated"
else
echo " devenv.nix found but devenv command not available, skipping devenv update"
fi
fi
echo "🎉 All dependencies updated!"

View file

@ -1,5 +0,0 @@
data
!data/raw/.gitkeep
!data/processed/.gitkeep
.venv
__marimo__

View file

@ -1,67 +0,0 @@
[formatting]
line_length = 79
[keymap]
preset = "vim"
[keymap.overrides]
[runtime]
auto_instantiate = true
std_stream_max_bytes = 1000000
on_cell_change = "autorun"
reactive_tests = true
default_sql_output = "auto"
auto_reload = "off"
watcher_on_save = "lazy"
output_max_bytes = 8000000
[language_servers.pylsp]
enable_pydocstyle = false
enable_flake8 = false
enable_ruff = true
enable_mypy = true
enable_pylint = false
enabled = true
enable_pyflakes = false
[experimental]
[completion]
activate_on_typing = true
copilot = "github"
[server]
browser = "default"
follow_symlink = false
[ai]
rules = ""
[ai.google]
[ai.bedrock]
[ai.open_ai]
[ai.anthropic]
[diagnostics]
[package_management]
manager = "uv"
[snippets]
include_default_snippets = true
custom_paths = []
[display]
default_table_page_size = 10
code_editor_font_size = 14
cell_output = "below"
dataframes = "rich"
theme = "dark"
default_width = "medium"
[save]
format_on_save = false
autosave = "after_delay"
autosave_delay = 1000

View file

@ -1 +0,0 @@
3.12

View file

@ -1,199 +0,0 @@
# zk configuration file
#
# Uncomment the properties you want to customize.
# NOTE SETTINGS
#
# Defines the default options used when generating new notes.
[note]
# Language used when writing notes.
# This is used to generate slugs or with date formats.
#language = "en"
# The default title used for new note, if no `--title` flag is provided.
#default-title = "Untitled"
# Template used to generate a note's filename, without extension.
extension = "md"
filename = "docs/{{slug title}}-{{format-date now '%Y-%m-%d'}}-{{id}}"
language = "en"
# The file extension used for the notes.
#extension = "md"
# Template used to generate a note's content.
# If not an absolute path or "~/unix/path", it's relative to .zk/templates/
template = "default.md"
# Path globs ignored while indexing existing notes.
#exclude = [
# "drafts/*",
# "log.md"
#]
# Configure random ID generation.
# The charset used for random IDs. You can use:
# * letters: only letters from a to z.
# * numbers: 0 to 9
# * alphanum: letters + numbers
# * hex: hexadecimal, from a to f and 0 to 9
# * custom string: will use any character from the provided value
#id-charset = "alphanum"
# Length of the generated IDs.
#id-length = 4
# Letter case for the random IDs, among lower, upper or mixed.
#id-case = "lower"
# EXTRA VARIABLES
#
# A dictionary of variables you can use for any custom values when generating
# new notes. They are accessible in templates with {{extra.<key>}}
[extra]
#key = "value"
# GROUP OVERRIDES
#
# You can override global settings from [note] and [extra] for a particular
# group of notes by declaring a [group."<name>"] section.
#
# Specify the list of directories which will automatically belong to the group
# with the optional `paths` property.
#
# Omitting `paths` is equivalent to providing a single path equal to the name of
# the group. This can be useful to quickly declare a group by the name of the
# directory it applies to.
#[group."<NAME>"]
#paths = ["<DIR1>", "<DIR2>"]
#[group."<NAME>".note]
#filename = "{{format-date now}}"
#[group."<NAME>".extra]
#key = "value"
# MARKDOWN SETTINGS
[format.markdown]
# Format used to generate links between notes.
# Either "wiki", "markdown" or a custom template. Default is "markdown".
link-format = "wiki"
# Indicates whether a link's path will be percent-encoded.
# Defaults to true for "markdown" format and false for "wiki" format.
#link-encode-path = true
# Indicates whether a link's path file extension will be removed.
# Defaults to true.
#link-drop-extension = true
# Enable support for #hashtags.
hashtags = false
# Enable support for :colon:separated:tags:.
colon-tags = true
# Enable support for Bear's #multi-word tags#
# Hashtags must be enabled for multi-word tags to work.
multiword-tags = false
# EXTERNAL TOOLS
[tool]
# Default editor used to open notes. When not set, the EDITOR or VISUAL
# environment variables are used.
#editor = "vim"
# Pager used to scroll through long output. If you want to disable paging
# altogether, set it to an empty string "".
#pager = "less -FIRX"
# Command used to preview a note during interactive fzf mode.
# Set it to an empty string "" to disable preview.
# bat is a great tool to render Markdown document with syntax highlighting.
#https://github.com/sharkdp/bat
#fzf-preview = "bat -p --color always {-1}"
# LSP
#
# Configure basic editor integration for LSP-compatible editors.
# See https://github.com/zk-org/zk/blob/main/docs/editors-integration.md
#
[lsp]
[lsp.diagnostics]
# Each diagnostic can have for value: none, hint, info, warning, error
# Report titles of wiki-links as hints.
wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"
[lsp.completion]
# Customize the completion pop-up of your LSP client.
# Show the note title in the completion pop-up, or fallback on its path if empty.
#note-label = "{{title-or-path}}"
# Filter out the completion pop-up using the note title or its path.
#note-filter-text = "{{title}} {{path}}"
# Show the note filename without extension as detail.
#note-detail = "{{filename-stem}}"
# NAMED FILTERS
#
# A named filter is a set of note filtering options used frequently together.
#
[filter]
# Matches the notes created the last two weeks. For example:
# $ zk list recents --limit 15
# $ zk edit recents --interactive
#recents = "--sort created- --created-after 'last two weeks'"
# COMMAND ALIASES
#
# Aliases are user commands called with `zk <alias> [<flags>] [<args>]`.
#
# The alias will be executed with `$SHELL -c`, please refer to your shell's
# man page to see the available syntax. In most shells:
# * $@ can be used to expand all the provided flags and arguments
# * you can pipe commands together with the usual | character
#
[alias]
# Here are a few aliases to get you started.
# Shortcut to a command.
#ls = "zk list $@"
# Default flags for an existing command.
#list = "zk list --quiet $@"
# Edit the last modified note.
#editlast = "zk edit --limit 1 --sort modified- $@"
# Edit the notes selected interactively among the notes created the last two weeks.
# This alias doesn't take any argument, so we don't use $@.
#recent = "zk edit --sort created- --created-after 'last two weeks' --interactive"
# Print paths separated with colons for the notes found with the given
# arguments. This can be useful to expand a complex search query into a flag
# taking only paths. For example:
# zk list --link-to "`zk path -m potatoe`"
#path = "zk list --quiet --format {{path}} --delimiter , $@"
# Show a random note.
#lucky = "zk list --quiet --format full --sort random --limit 1"
# Returns the Git history for the notes found with the given arguments.
# Note the use of a pipe and the location of $@.
#hist = "zk list --format path --delimiter0 --quiet $@ | xargs -t -0 git log --patch --"
# Edit this configuration file.
#conf = '$EDITOR "$ZK_NOTEBOOK_DIR/.zk/config.toml"'

Binary file not shown.

View file

@ -1,3 +0,0 @@
# {{title}}
{{content}}

View file

@ -1,4 +0,0 @@
rverurl := 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv'
update-r-version:
RVER=$( wget -qO- {{rverurl}} | tail -n 2 | head -n 1 | cut -d',' -f4 | tr -d '"' ) &&\
sed -i "s|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\.tar\.gz\";|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/$RVER.tar.gz\";|" flake.nix

121
templates/sci/flake.lock generated
View file

@ -1,121 +0,0 @@
{
"nodes": {
"nCats": {
"inputs": {
"nixCats": "nixCats",
"nixpkgs": [
"nixpkgs"
],
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references",
"plugins-r": "plugins-r",
"rixpkgs": "rixpkgs"
},
"locked": {
"lastModified": 1750580429,
"narHash": "sha256-JK+bWsMRFyCHseiIS9olgpRM1McJ4vM1HwSCG49+M3E=",
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"rev": "5037594b13921e6c83acec8de704e47669ceca41",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"type": "github"
}
},
"nixCats": {
"locked": {
"lastModified": 1750385661,
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "04379fef2fbd4c9d8f4c9a6203cef135ab0b1acd",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1750731501,
"narHash": "sha256-Ah4qq+SbwMaGkuXCibyg+Fwn00el4KmI3XFX6htfDuk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "69dfebb3d175bde602f612915c5576a41b18486b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"plugins-cmp-pandoc-references": {
"flake": false,
"locked": {
"lastModified": 1743491695,
"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": 1749130465,
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "65f772c012240bc1a1706da11049d2c9801275dc",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"rixpkgs": {
"locked": {
"lastModified": 1746476429,
"narHash": "sha256-KHNAOy8ILpIlz5rtwxURpcVOqbWRMoT/rXRgpy1pyG8=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
}
},
"rixpkgs_2": {
"locked": {
"lastModified": 1747664360,
"narHash": "sha256-DskCWKtHNGApsP3PI/HB+fETs3qXpwul3PtSgTb++N4=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
}
},
"root": {
"inputs": {
"nCats": "nCats",
"nixpkgs": "nixpkgs",
"rixpkgs": "rixpkgs_2"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,140 +0,0 @@
{
description = "Project Template";
inputs = {
rixpkgs.url = "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nCats.url = "github:dwinkler1/nixCatsConfig";
nCats.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
nCats,
...
} @ inputs: let
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
in {
packages = forSystems (
system: let
inherit (nCats) utils;
finalPackage = nCats.packages.${system}.default.override (prev: {
dependencyOverlays =
prev.dependencyOverlays
++ [
(utils.standardPluginOverlay inputs)
(final: prev: {
rpkgs = inputs.rixpkgs.legacyPackages.${system};
})
(import (builtins.path {
path = ./rpkgs.nix;
name = "my-rpackages";
}))
(import (builtins.path {
path = ./pypkgs.nix;
name = "my-pypackages";
}))
];
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
{
pkgs,
settings,
categories,
name,
extra,
mkPlugin,
...
} @ packageDef: {
lspsAndRuntimeDeps = {
meta = with pkgs; [
just
wget
gh
];
rdev = with pkgs; [
rWrapper
];
pydev = with pkgs; [
py
uv
pyright
nodejs
];
jldev = with pkgs; [
julia-bin
];
quarto = with pkgs; [
quarto
];
};
environmentVariables = {
rdev = {
R_LIBS_USER = "./.Rlibs";
};
pydev = {
# Prevent uv from managing Python downloads
UV_PYTHON_DOWNLOADS = "never";
# Force uv to use nixpkgs Python interpreter
UV_PYTHON = pkgs.py.interpreter;
};
};
extraWrapperArgs = {
pydev = [
"--unset PYTHONPATH"
];
};
bashBeforeWrapper = {
pydev = [
"export UV_PYTHON=${pkgs.py.interpreter}"
"export UV_PYTHON_DOWNLOADS=\"never\""
"${pkgs.uv}/bin/uv sync"
];
};
}
);
packageDefinitions =
prev.packageDefinitions
// {
nixCats = utils.mergeCatDefs prev.packageDefinitions.nixCats (
{pkgs, name, ...}: {
settings = {
suffix-path = false;
suffix-LD = false;
hosts = {
python3.enable = true;
marimo = {
enable = true;
path = {
value = "${pkgs.uv}/bin/uv";
args = ["--add-flags" "run marimo edit"];
};
};
neovide = {
enable = true;
path = {
value = "${pkgs.neovide}/bin/neovide";
args = [
"--add-flags"
"--neovim-bin ${name}"
];
};
};
};
};
categories = {
meta = true;
rdev = true;
pydev = true;
jldev = true;
quarto = true;
};
}
);
};
});
in
utils.mkAllWithDefault finalPackage
);
};
}

View file

@ -1,8 +0,0 @@
final: prev: let
reqPkgs = (pyPackages: with pyPackages;[
requests
]);
in {
py = prev.python3.withPackages reqPkgs;
}

View file

@ -1,16 +0,0 @@
[project]
name = "sci"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"marimo[recommended]>=0.13.15",
"polars>=1.30.0",
"pytest>=8.3.5",
"python-lsp-ruff>=2.2.2",
"python-lsp-server>=1.12.2",
"vegafusion>=2.0.2",
"vl-convert-python>=1.8.0",
"websockets>=15.0.1",
]

View file

@ -1 +0,0 @@
{ "venvPath": ".", "venv": ".venv" }

View file

@ -1,35 +0,0 @@
final: prev: let
reqPkgs = with prev.rpkgs.rPackages; [
Hmisc
broom
data_table
dplyr
ggplot2
gt
janitor
psych
tidyr
quarto
languageserver
(buildRPackage {
name = "nvimcom";
src = prev.rpkgs.fetchFromGitHub {
owner = "R-nvim";
repo = "R.nvim";
rev = "382858fcf23aabbf47ff06279baf69d52260b939";
sha256 = "sha256-j2rXXO7246Nh8U6XyX43nNTbrire9ta9Ono9Yr+Eh9M=";
};
sourceRoot = "source/nvimcom";
buildInputs = with prev.rpkgs; [
R
stdenv.cc.cc
gnumake
];
propagatedBuildInputs = [];
})
];
in {
quarto = prev.rpkgs.quarto.override {extraRPackages = reqPkgs;};
rWrapper = prev.rpkgs.rWrapper.override {packages = reqPkgs;};
radianWrapper = prev.rpkgs.radianWrapper.override {packages = reqPkgs;};
}

1152
templates/sci/uv.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +0,0 @@
data
!data/raw/.gitkeep
!data/processed/.gitkeep
.venv
__marimo__

View file

@ -1,67 +0,0 @@
[formatting]
line_length = 79
[keymap]
preset = "vim"
[keymap.overrides]
[runtime]
auto_instantiate = true
std_stream_max_bytes = 1000000
on_cell_change = "autorun"
reactive_tests = true
default_sql_output = "auto"
auto_reload = "off"
watcher_on_save = "lazy"
output_max_bytes = 8000000
[language_servers.pylsp]
enable_pydocstyle = false
enable_flake8 = false
enable_ruff = true
enable_mypy = true
enable_pylint = false
enabled = true
enable_pyflakes = false
[experimental]
[completion]
activate_on_typing = true
copilot = "github"
[server]
browser = "default"
follow_symlink = false
[ai]
rules = ""
[ai.google]
[ai.bedrock]
[ai.open_ai]
[ai.anthropic]
[diagnostics]
[package_management]
manager = "uv"
[snippets]
include_default_snippets = true
custom_paths = []
[display]
default_table_page_size = 10
code_editor_font_size = 14
cell_output = "below"
dataframes = "rich"
theme = "dark"
default_width = "medium"
[save]
format_on_save = false
autosave = "after_delay"
autosave_delay = 1000

View file

@ -1 +0,0 @@
3.12

View file

@ -1,199 +0,0 @@
# zk configuration file
#
# Uncomment the properties you want to customize.
# NOTE SETTINGS
#
# Defines the default options used when generating new notes.
[note]
# Language used when writing notes.
# This is used to generate slugs or with date formats.
#language = "en"
# The default title used for new note, if no `--title` flag is provided.
#default-title = "Untitled"
# Template used to generate a note's filename, without extension.
extension = "md"
filename = "docs/{{slug title}}-{{format-date now '%Y-%m-%d'}}-{{id}}"
language = "en"
# The file extension used for the notes.
#extension = "md"
# Template used to generate a note's content.
# If not an absolute path or "~/unix/path", it's relative to .zk/templates/
template = "default.md"
# Path globs ignored while indexing existing notes.
#exclude = [
# "drafts/*",
# "log.md"
#]
# Configure random ID generation.
# The charset used for random IDs. You can use:
# * letters: only letters from a to z.
# * numbers: 0 to 9
# * alphanum: letters + numbers
# * hex: hexadecimal, from a to f and 0 to 9
# * custom string: will use any character from the provided value
#id-charset = "alphanum"
# Length of the generated IDs.
#id-length = 4
# Letter case for the random IDs, among lower, upper or mixed.
#id-case = "lower"
# EXTRA VARIABLES
#
# A dictionary of variables you can use for any custom values when generating
# new notes. They are accessible in templates with {{extra.<key>}}
[extra]
#key = "value"
# GROUP OVERRIDES
#
# You can override global settings from [note] and [extra] for a particular
# group of notes by declaring a [group."<name>"] section.
#
# Specify the list of directories which will automatically belong to the group
# with the optional `paths` property.
#
# Omitting `paths` is equivalent to providing a single path equal to the name of
# the group. This can be useful to quickly declare a group by the name of the
# directory it applies to.
#[group."<NAME>"]
#paths = ["<DIR1>", "<DIR2>"]
#[group."<NAME>".note]
#filename = "{{format-date now}}"
#[group."<NAME>".extra]
#key = "value"
# MARKDOWN SETTINGS
[format.markdown]
# Format used to generate links between notes.
# Either "wiki", "markdown" or a custom template. Default is "markdown".
link-format = "wiki"
# Indicates whether a link's path will be percent-encoded.
# Defaults to true for "markdown" format and false for "wiki" format.
#link-encode-path = true
# Indicates whether a link's path file extension will be removed.
# Defaults to true.
#link-drop-extension = true
# Enable support for #hashtags.
hashtags = false
# Enable support for :colon:separated:tags:.
colon-tags = true
# Enable support for Bear's #multi-word tags#
# Hashtags must be enabled for multi-word tags to work.
multiword-tags = false
# EXTERNAL TOOLS
[tool]
# Default editor used to open notes. When not set, the EDITOR or VISUAL
# environment variables are used.
#editor = "vim"
# Pager used to scroll through long output. If you want to disable paging
# altogether, set it to an empty string "".
#pager = "less -FIRX"
# Command used to preview a note during interactive fzf mode.
# Set it to an empty string "" to disable preview.
# bat is a great tool to render Markdown document with syntax highlighting.
#https://github.com/sharkdp/bat
#fzf-preview = "bat -p --color always {-1}"
# LSP
#
# Configure basic editor integration for LSP-compatible editors.
# See https://github.com/zk-org/zk/blob/main/docs/editors-integration.md
#
[lsp]
[lsp.diagnostics]
# Each diagnostic can have for value: none, hint, info, warning, error
# Report titles of wiki-links as hints.
wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"
[lsp.completion]
# Customize the completion pop-up of your LSP client.
# Show the note title in the completion pop-up, or fallback on its path if empty.
#note-label = "{{title-or-path}}"
# Filter out the completion pop-up using the note title or its path.
#note-filter-text = "{{title}} {{path}}"
# Show the note filename without extension as detail.
#note-detail = "{{filename-stem}}"
# NAMED FILTERS
#
# A named filter is a set of note filtering options used frequently together.
#
[filter]
# Matches the notes created the last two weeks. For example:
# $ zk list recents --limit 15
# $ zk edit recents --interactive
#recents = "--sort created- --created-after 'last two weeks'"
# COMMAND ALIASES
#
# Aliases are user commands called with `zk <alias> [<flags>] [<args>]`.
#
# The alias will be executed with `$SHELL -c`, please refer to your shell's
# man page to see the available syntax. In most shells:
# * $@ can be used to expand all the provided flags and arguments
# * you can pipe commands together with the usual | character
#
[alias]
# Here are a few aliases to get you started.
# Shortcut to a command.
#ls = "zk list $@"
# Default flags for an existing command.
#list = "zk list --quiet $@"
# Edit the last modified note.
#editlast = "zk edit --limit 1 --sort modified- $@"
# Edit the notes selected interactively among the notes created the last two weeks.
# This alias doesn't take any argument, so we don't use $@.
#recent = "zk edit --sort created- --created-after 'last two weeks' --interactive"
# Print paths separated with colons for the notes found with the given
# arguments. This can be useful to expand a complex search query into a flag
# taking only paths. For example:
# zk list --link-to "`zk path -m potatoe`"
#path = "zk list --quiet --format {{path}} --delimiter , $@"
# Show a random note.
#lucky = "zk list --quiet --format full --sort random --limit 1"
# Returns the Git history for the notes found with the given arguments.
# Note the use of a pipe and the location of $@.
#hist = "zk list --format path --delimiter0 --quiet $@ | xargs -t -0 git log --patch --"
# Edit this configuration file.
#conf = '$EDITOR "$ZK_NOTEBOOK_DIR/.zk/config.toml"'

View file

@ -1,3 +0,0 @@
# {{title}}
{{content}}

View file

@ -1,4 +0,0 @@
rverurl := 'https://raw.githubusercontent.com/ropensci/rix/refs/heads/main/inst/extdata/available_df.csv'
update-r-version:
RVER=$( wget -qO- {{rverurl}} | tail -n 2 | head -n 1 | cut -d',' -f4 | tr -d '"' ) &&\
sed -i "s|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\.tar\.gz\";|rixpkgs.url = \"https://github.com/rstats-on-nix/nixpkgs/archive/$RVER.tar.gz\";|" flake.nix

View file

@ -1,121 +0,0 @@
{
"nodes": {
"nCats": {
"inputs": {
"nixCats": "nixCats",
"nixpkgs": [
"nixpkgs"
],
"plugins-cmp-pandoc-references": "plugins-cmp-pandoc-references",
"plugins-r": "plugins-r",
"rixpkgs": "rixpkgs"
},
"locked": {
"lastModified": 1750580429,
"narHash": "sha256-JK+bWsMRFyCHseiIS9olgpRM1McJ4vM1HwSCG49+M3E=",
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"rev": "5037594b13921e6c83acec8de704e47669ceca41",
"type": "github"
},
"original": {
"owner": "dwinkler1",
"repo": "nixCatsConfig",
"type": "github"
}
},
"nixCats": {
"locked": {
"lastModified": 1750385661,
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "04379fef2fbd4c9d8f4c9a6203cef135ab0b1acd",
"type": "github"
},
"original": {
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1750731501,
"narHash": "sha256-Ah4qq+SbwMaGkuXCibyg+Fwn00el4KmI3XFX6htfDuk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "69dfebb3d175bde602f612915c5576a41b18486b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"plugins-cmp-pandoc-references": {
"flake": false,
"locked": {
"lastModified": 1743491695,
"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": 1749130465,
"owner": "R-nvim",
"repo": "R.nvim",
"rev": "65f772c012240bc1a1706da11049d2c9801275dc",
"type": "github"
},
"original": {
"owner": "R-nvim",
"repo": "R.nvim",
"type": "github"
}
},
"rixpkgs": {
"locked": {
"lastModified": 1746476429,
"narHash": "sha256-KHNAOy8ILpIlz5rtwxURpcVOqbWRMoT/rXRgpy1pyG8=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-04-29.tar.gz"
}
},
"rixpkgs_2": {
"locked": {
"lastModified": 1747664360,
"narHash": "sha256-DskCWKtHNGApsP3PI/HB+fETs3qXpwul3PtSgTb++N4=",
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz"
}
},
"root": {
"inputs": {
"nCats": "nCats",
"nixpkgs": "nixpkgs",
"rixpkgs": "rixpkgs_2"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,140 +0,0 @@
{
description = "Project Template";
inputs = {
rixpkgs.url = "https://github.com/rstats-on-nix/nixpkgs/archive/2025-05-19.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nCats.url = "github:dwinkler1/nixCatsConfig";
nCats.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
nCats,
...
} @ inputs: let
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
in {
packages = forSystems (
system: let
inherit (nCats) utils;
finalPackage = nCats.packages.${system}.default.override (prev: {
dependencyOverlays =
prev.dependencyOverlays
++ [
(utils.standardPluginOverlay inputs)
(final: prev: {
rpkgs = inputs.rixpkgs.legacyPackages.${system};
})
(import (builtins.path {
path = ./rpkgs.nix;
name = "my-rpackages";
}))
(import (builtins.path {
path = ./pypkgs.nix;
name = "my-pypackages";
}))
];
categoryDefinitions = utils.mergeCatDefs prev.categoryDefinitions (
{
pkgs,
settings,
categories,
name,
extra,
mkPlugin,
...
} @ packageDef: {
lspsAndRuntimeDeps = {
meta = with pkgs; [
just
wget
gh
];
rdev = with pkgs; [
rWrapper
];
pydev = with pkgs; [
py
uv
pyright
nodejs
];
jldev = with pkgs; [
julia-bin
];
quarto = with pkgs; [
quarto
];
};
environmentVariables = {
rdev = {
R_LIBS_USER = "./.Rlibs";
};
pydev = {
# Prevent uv from managing Python downloads
UV_PYTHON_DOWNLOADS = "never";
# Force uv to use nixpkgs Python interpreter
UV_PYTHON = pkgs.py.interpreter;
};
};
extraWrapperArgs = {
pydev = [
"--unset PYTHONPATH"
];
};
bashBeforeWrapper = {
pydev = [
"export UV_PYTHON=${pkgs.py.interpreter}"
"export UV_PYTHON_DOWNLOADS=\"never\""
"${pkgs.uv}/bin/uv sync"
];
};
}
);
packageDefinitions =
prev.packageDefinitions
// {
nixCats = utils.mergeCatDefs prev.packageDefinitions.nixCats (
{pkgs, name, ...}: {
settings = {
suffix-path = false;
suffix-LD = false;
hosts = {
python3.enable = true;
marimo = {
enable = true;
path = {
value = "${pkgs.uv}/bin/uv";
args = ["--add-flags" "run marimo edit"];
};
};
neovide = {
enable = true;
path = {
value = "${pkgs.neovide}/bin/neovide";
args = [
"--add-flags"
"--neovim-bin ${name}"
];
};
};
};
};
categories = {
meta = true;
rdev = true;
pydev = true;
jldev = true;
quarto = true;
};
}
);
};
});
in
utils.mkAllWithDefault finalPackage
);
};
}

View file

@ -1,8 +0,0 @@
final: prev: let
reqPkgs = (pyPackages: with pyPackages;[
requests
]);
in {
py = prev.python3.withPackages reqPkgs;
}

View file

@ -1,16 +0,0 @@
[project]
name = "sci"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"marimo[recommended]>=0.13.15",
"polars>=1.30.0",
"pytest>=8.3.5",
"python-lsp-ruff>=2.2.2",
"python-lsp-server>=1.12.2",
"vegafusion>=2.0.2",
"vl-convert-python>=1.8.0",
"websockets>=15.0.1",
]

View file

@ -1 +0,0 @@
{ "venvPath": ".", "venv": ".venv" }

View file

@ -1,35 +0,0 @@
final: prev: let
reqPkgs = with prev.rpkgs.rPackages; [
Hmisc
broom
data_table
dplyr
ggplot2
gt
janitor
psych
tidyr
quarto
languageserver
(buildRPackage {
name = "nvimcom";
src = prev.rpkgs.fetchFromGitHub {
owner = "R-nvim";
repo = "R.nvim";
rev = "382858fcf23aabbf47ff06279baf69d52260b939";
sha256 = "sha256-j2rXXO7246Nh8U6XyX43nNTbrire9ta9Ono9Yr+Eh9M=";
};
sourceRoot = "source/nvimcom";
buildInputs = with prev.rpkgs; [
R
stdenv.cc.cc
gnumake
];
propagatedBuildInputs = [];
})
];
in {
quarto = prev.rpkgs.quarto.override {extraRPackages = reqPkgs;};
rWrapper = prev.rpkgs.rWrapper.override {packages = reqPkgs;};
radianWrapper = prev.rpkgs.radianWrapper.override {packages = reqPkgs;};
}

File diff suppressed because it is too large Load diff