mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 14:30:59 -05:00
Extract shell hook to lib/shell-hook.nix for better organization
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
This commit is contained in:
parent
3398a72241
commit
eaecb56186
4 changed files with 47 additions and 728 deletions
|
|
@ -8,7 +8,7 @@ The template is organized into several directories for better maintainability:
|
|||
|
||||
```
|
||||
templates/rde/
|
||||
├── flake.nix # Main flake configuration (290 lines)
|
||||
├── flake.nix # Main flake configuration (258 lines)
|
||||
├── overlays/ # Nix overlays for packages
|
||||
│ ├── r.nix # R packages configuration
|
||||
│ ├── python.nix # Python packages configuration
|
||||
|
|
@ -21,6 +21,8 @@ templates/rde/
|
|||
│ ├── 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
|
||||
└── scripts/ # Shell scripts
|
||||
├── initPython.sh # Initialize Python project
|
||||
├── initProject.sh # Initialize project structure
|
||||
|
|
@ -32,7 +34,7 @@ templates/rde/
|
|||
|
||||
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 now ~290 lines instead of 688
|
||||
3. **Readability**: Main flake.nix is now ~258 lines instead of 688 (62.5% reduction)
|
||||
4. **Reusability**: Individual modules can be easily reused or replaced
|
||||
5. **Testability**: Smaller files are easier to test and debug
|
||||
|
||||
|
|
@ -53,6 +55,7 @@ To add new functionality:
|
|||
- **New commands**: Add host configs in `hosts/`
|
||||
- **New scripts**: Add shell scripts in `scripts/`
|
||||
- **New languages**: Create new host and overlay files
|
||||
- **Modify shell welcome**: Edit `lib/shell-hook.nix`
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue