Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,32 @@ Shelffiles is a portable environment configuration system that uses Nix to manag

### Adding Packages

Edit the `packages.nix` file to add or remove packages:

```nix
pkgs: with pkgs; [
# Core utilities
git # Version control system
ripgrep # Fast text search tool
fzf # Command-line fuzzy finder

# Uncomment or add packages you need
# zsh # Z Shell
# neovim # Vim-based text editor
# nodejs # Node.js runtime
]
```
1. Copy the example package configuration to the repository root:
```bash
cp example/packages.nix packages.nix
```

After modifying the package list, rebuild the environment with:
2. Edit `packages.nix` to add or remove packages:
```nix
pkgs: with pkgs; [
# Core utilities
git # Version control system
ripgrep # Fast text search tool
fzf # Command-line fuzzy finder

# Uncomment or add packages you need
# zsh # Z Shell
# neovim # Vim-based text editor
# nodejs # Node.js runtime
]
```

```bash
nix build
```
3. Rebuild the environment:
```bash
nix build
```

> Note: If you want to keep your package configuration private, consider adding `/packages.nix` to your `.gitignore` file.
> Note: You must create `packages.nix` before running `nix build`. Copy from `example/packages.nix` and customize it. You can track your `packages.nix` in your own fork without causing merge conflicts when pulling upstream changes.

### Adding Configuration Files

Expand Down Expand Up @@ -120,7 +123,9 @@ shelffiles/
├── cache/ # XDG_CACHE_HOME
├── share/ # XDG_DATA_HOME
├── state/ # XDG_STATE_HOME
├── packages.nix # Package definitions
├── example/
│ └── packages.nix # Example package definitions (template)
├── packages.nix # User package definitions (copy from example/)
├── entrypoint/ # Shell-specific entrypoint scripts
│ ├── bash # Bash entrypoint
│ ├── fish # Fish entrypoint
Expand Down
14 changes: 14 additions & 0 deletions example/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pkgs: with pkgs; [
# Core utilities
# git # Version control system
# ripgrep # Fast text search tool
# fzf # Command-line fuzzy finder

# Uncomment or add packages you need
# zsh # Z Shell
# neovim # Vim-based text editor
# nodejs # Node.js runtime

# To customize: copy this file to the repository root
# cp example/packages.nix packages.nix
]
9 changes: 2 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
"x86_64-darwin"
];

# Load user packages or use default packages if user packages don't exist
loadPackages =
_: pkgs:
let
packagesPath = ./packages.nix;
in
import packagesPath pkgs;
# Load user packages from root packages.nix
loadPackages = _: pkgs: import ./packages.nix pkgs;
in
{
packages = nixpkgs.lib.genAttrs systems (system: {
Expand Down
2 changes: 0 additions & 2 deletions packages.nix

This file was deleted.