Skip to content

wiki-nixos/nix-hm-config

 
 

Repository files navigation

Nix Home-Manager dotfiles

Important

Make sure curl and openssl is already installed.

create ~/.condig/nix/nix.conf

mkdir -p ~/.config/nix
cat <<EOF >>~/.config/nix/nix.conf
experimental-features = nix-command flakes
use-xdg-base-directories = true
cores = 0 # use all available cores
max-jobs = 10
auto-optimise-store = true
warn-dirty = false
http-connections = 50
trusted-users = charles
use-case-hack = true # only for macOS
EOF

Install nix(DeterminateSystems/nix-installer)

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

and open another shell.

Check Nix XDG Location

Expand here
```bash
nix_state_home=${XDG_STATE_HOME-$HOME/.local/state}/nix

if [[! -d $nix_state_home]]; then
mkdir -p $nix_state_home
fi

if [[-f $HOME/.nix-profile]]; then
mv $HOME/.nix-profile $nix_state_home/profile
fi
if [[-f $HOME/.nix-defexpr]]; then
mv $HOME/.nix-defexpr $nix_state_home/defexpr
fi
if [[-f $HOME/.nix-channels]]; then
mv $HOME/.nix-channels $nix_state_home/channels
fi
```

Install home-manager

nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz hm
nix-channel --update
nix-env -iA unstable.git
git clone https://github.com/CharlesChiuGit/nix-hm-config.git ~/.config/home-manager
cd ~/.config/home-manager && nix build
# add `trusted-users `: trusted-users = charles in `/etc/nix/nix.conf`
~/.config/home-manager/result/bin/home-manager switch --flake ~/.config/home-manager --impure
home-manager switch --impure # this will prevent current generations get clean up w/ gc`

ref: https://github.com/ryantm/home-manager-template/blob/master/README.md

ref: https://github.com/the-argus/spicetify-nix/blob/master/home-manager-install.md

Uninstall Nix

Resources

About

Nix home manager config on non-NixOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 83.0%
  • Nix 15.4%
  • Other 1.6%