diff --git a/README.md b/README.md index 2b8e498..a84b178 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/example/packages.nix b/example/packages.nix new file mode 100644 index 0000000..176246c --- /dev/null +++ b/example/packages.nix @@ -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 +] diff --git a/flake.nix b/flake.nix index f72f173..7f53688 100644 --- a/flake.nix +++ b/flake.nix @@ -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: { diff --git a/packages.nix b/packages.nix deleted file mode 100644 index af32951..0000000 --- a/packages.nix +++ /dev/null @@ -1,2 +0,0 @@ -pkgs: with pkgs; [ -]