-
Install Nix.
-
Install Home manager – I recommend using the
unstable
channel version. -
Update
~/.config/home-manager/home.nix
to something like (don't forget to change thehome.username
value):{ config, lib, pkgs, ... }: let gist = builtins.fetchurl { url = "https://gist.github.com/aduh95/affe5ba977acaaa8f480bc7d98161ec9/raw/home.nix"; sha256 = lib.fakeHash; }; importedGist = (import "${gist}") { inherit config; inherit lib; inherit pkgs; }; in { # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "TODO"; home.homeDirectory = "/Users/${home.username}"; home.stateVersion = importedGist.home.stateVersion; home.packages = importedGist.home.packages; home.sessionPath = [ "/nix/var/nix/profiles/default/bin" "$HOME/.nix-profile/bin" ]; home.sessionVariables = { EDITOR = "vim"; }; inherit (importedGist) programs; }
-
Run
nix-channel --update && home-manager switch
. It should complain about unmatched hash. Replacelib.fakeHash
by the correct hash on line 6. -
Run
nix-channel --update && home-manager switch
again. -
Open a new shell. Voilà, you're all set.
Edit /etc/nixos/configuration.nix
with (replace TODO
with your actual user handle):
let
home-manager = builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz;
gist = builtins.fetchurl {
url = "https://gist.github.com/aduh95/affe5ba977acaaa8f480bc7d98161ec9/raw/home.nix";
sha256 = pkgs.lib.fakeHash;
};
in
{
# …
imports = [
# …
(import "${home-manager}/nixos")
];
# …
home-manager.users.TODO = import "${gist}";
}
Run nixos-build switch
, replace the hash, re-run it, and voilà.