3.1 KiB
3.1 KiB
Nix Home Manager Configuration
This repository contains a Nix home-manager flake for configuring a user environment on a remote Linux system with Nix installed. The configuration is designed for user tbingmann and includes custom Bash settings and direnv support.
Features
- Custom Bash configuration with useful aliases and functions
- direnv integration for project-specific environment variables
- Git configuration
- Essential command-line utilities
Prerequisites
- Nix package manager installed on the remote system
- Flakes enabled in Nix configuration
Enabling Required Experimental Features
If you encounter errors about experimental features being disabled, you need to enable them. There are several ways to do this:
-
Temporary solution - Add flags to each command:
nix --extra-experimental-features "nix-command flakes" <command> -
Permanent solution - Create or edit your
nix.conffile:For a single user:
mkdir -p ~/.config/nix echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.confFor system-wide configuration (requires sudo):
sudo mkdir -p /etc/nix echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf
Installation
Local Installation
- Clone this repository to your remote machine:
git clone https://g.t1.xyz/tb/nix-ebay-home.git ~/nix-home
cd ~/nix-home
- Apply the configuration:
# If home-manager is not installeds
nix run github:nix-community/home-manager/release-25.05 -- switch --flake .#tbingmann
Alternatively, if you have home-manager installed:
home-manager switch --flake .#tbingmann
Direct Installation from Git Repository
You can apply the configuration directly from a Git repository without cloning:
# If home-manager is not installed
nix --no-write-lock-file run github:nix-community/home-manager/release-25.05 -- switch --flake 'git+https://g.t1.xyz/tb/nix-ebay-home.git#tbingmann'
# If home-manager is installed
home-manager --no-write-lock-file switch --flake 'git+https://g.t1.xyz/tb/nix-ebay-home.git#tbingmann'
Usage
Updating
To update the configuration:
Local repository:
- Modify the configuration files (
flake.nix,home.nix) - Run
home-manager switch --flake .#tbingmann
From remote Git repository:
# Pull latest changes from the repository
git -C ~/.config/home-manager pull
# Apply the updated configuration
home-manager switch --flake ~/.config/home-manager#tbingmann
# Or directly without pulling first
home-manager --no-write-lock-file switch --flake 'git+https://g.t1.xyz/tb/nix-ebay-home.git#tbingmann'
Customization
- Edit
home.nixto customize your home environment - Modify Bash configuration in the
programs.bashsection - Add or remove packages in the
home.packagessection
Troubleshooting
If you encounter issues:
- Check that Nix flakes are enabled
- Ensure you're using the correct username in the configuration
- Run with
--debugflag for more information:
home-manager switch --flake .#tbingmann --debug