Install Nix with the following command
sh <(curl -L https://nixos.org/nix/install)
Download home-manager channel
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --update
Fetch home-manager binary
nix-shell '<home-manager>' -A install
Test home-manager to ensure this is installed.
home-manager
Create your file in your gitrepo
cat > /Users/miguel.bernadin/git/bernadinm/nix-config/hosts/mbp/work/configuration.nix <<EOF
{ config, pkgs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "miguel.bernadin";
home.homeDirectory = "/home/miguel.bernadin";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";
}
EOF
export NIX_PATH=/nix/var/nix/profiles/per-user/$(whoami)/channels:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
home-manager switch -f ~/git/bernadinm/nix-config/hosts/mbp/work/configuration.nix