Need assistance to get actually home-manager setup and working

this has been problematic for me since i cant get it working and actually cant just figure out now what is the issue and what i need to do. Got pretty frustrated and this would be so nice to get to working state so i can start clean my configs better.

would like pretty monkey friendly guide how to setup this one

In general follow the Home Manager Manual , section Installation.

If you are on NixOS, use the Module. Otherwise, follow https://nix.dev/install-nix#install-nix and then follow the standalone Installation steps from the home-manager manual.

If you get stuck or encounter an error, post it in this thread/discourse or on another community forum. Specifying your target platform and previous steps might help.

1 Like

thankyou followed the link and i got it working and been moving files etc to home-manager now, but run small issue when running ´home-manager switch´ i get this error and spend hours to trying to figure this one out but i just cant figure what…

error:
       … while evaluating the attribute 'activationPackage'
         at /nix/store/kn954wchjva0zk5a72hhrp9kq0nvhxiz-home-manager-25.11.tar.gz/home-manager/modules/default.nix:63:7:
           62|
           63|       activationPackage = module.config.home.activationPackage;
             |       ^
           64|

       … while evaluating a branch condition
         at /nix/store/cyhkpcc06gv501j5780x3spgwk5d8blw-nixos-25.11/nixos/lib/lists.nix:142:18:
          141|       len = length list;
          142|       fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
             |                  ^
          143|     in

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `home-manager' does not exist. Definition values:
       - In `/home/phatle/.config/home-manager/home.nix':
           {
             backupFileExtension = "backup";
           }

{ config, pkgs, ... }:

let
  # A helper for packages that are part of the 'kdePackages' set
  kdepkgs = with pkgs.kdePackages; [
    kate
    audiotube
    plasmatube
    kdenlive
  ];

  # List of all desired packages, including powerlevel10k for OMZ
  userPackages = with pkgs; [
    # Zsh Theme Package (Required for Oh My Zsh to find the theme)
    zsh-powerlevel10k

    # --- Multimedia / Graphics ---
    blender
    darktable
    gimp
    inkscape
  ] ++ kdepkgs ++ [
    # --- Communication / Productivity ---
    thunderbird
    libreoffice
    signal-desktop

    # --- Gaming ---
    steam

    # --- Security / VPN ---
    protonvpn-gui
    protonmail-bridge-gui
    proton-pass
  ];

in
{
  ## -------------------------------------------------------------
  ## 1. HOME MANAGER BASICS
  ## -------------------------------------------------------------
  home.username = "phatle";
  home.homeDirectory = "/home/phatle";
  home.stateVersion = "25.11";

  ## -------------------------------------------------------------
  ## 2. USER PACKAGES (Applications installed for the 'phatle' user)
  ## -------------------------------------------------------------
  home.packages = userPackages;

  ## -------------------------------------------------------------
  ## 3. PROGRAM CONFIGURATION
  ## -------------------------------------------------------------

  ###  Zsh Shell Configuration
  programs.zsh = {
    enable = true;
    enableCompletion = true;

    history = {
      path = "${config.home.homeDirectory}/.zsh_history";
      size = 10000;
      save = 10000;
    };

    # Oh My Zsh (OMZ) Configuration
    oh-my-zsh = {
      enable = true;
      theme = "powerlevel10k";
      plugins = [ "git" "sudo" ];
    };

    initExtra = ''
      [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
    '';
  };

  ### Web Browsers
  programs.firefox.enable = true;

  ## -------------------------------------------------------------
  ## 4. ENVIRONMENT VARIABLES & DOTFILES
  ## -------------------------------------------------------------
  home.sessionVariables = {
    EDITOR = "kate";
  };

  ## -------------------------------------------------------------
  ## 5. NIXPKGS CONFIGURATION (Allow Unfree Packages)
  ## -------------------------------------------------------------
  nixpkgs.config = {
    allowUnfree = true;
  };

  ## -------------------------------------------------------------
  ## 6. HOME MANAGER CONFIGURATION (Backup Fix)
  ## -------------------------------------------------------------
  # This resolves the clobbering issue by setting the option at the correct root level.
  home-manager.backupFileExtension = "hm-backup";

  # Note: Removed programs.home-manager.enable = true; as it is redundant when used
  # as a NixOS module, and its options were conflicting with the root-level options.
}

home-manager.backupFileExtension is a nixos option (though one only available when you’ve set up home-manager as a nixos module), not a home-manager option.

so i am trying it on from file it needs to be on configuration.nix file, that explains it alot

i think i have done and gotten 95% working just could use some help on checking is all good and should be and i am having melt down to setup by ohMyZSH/powerlevel10k working on home-manager side something i have missed on something or just hitting the end of line on my daily energy

{ config, pkgs, ... }:

{
  # -------------------------------------------------------------------
  # 1. SYSTEM-LEVEL IMPORTS (MODULES)
  # -------------------------------------------------------------------
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      # IMPORTANT: Keep the home-manager/nixos module here to integrate
      # Home Manager into the NixOS system.
      <home-manager/nixos>
    ];

  # Bootloader, Kernel, and Luks
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.initrd.luks.devices."luks-8edb1b27-5162-4113-8d34-8b440a45ef52".device = "/dev/disk/by-uuid/8edb1b27-5162-4113-8d34-8b440a45ef52";

  # Networking
  networking.hostName = "nixos";
  networking.networkmanager.enable = true;

  # Firewall Configuration
  networking.firewall.enable = true;
  # Log refused connections is a good system-wide security setting
  networking.firewall.logRefusedConnections = true;
  # networking.firewall.allowedTCPPorts = [ 22 ]; # Uncomment if you enable SSH service

  # Localization and Time
  time.timeZone = "Europe/Helsinki";
  i18n.defaultLocale = "en_US.UTF-8";
  i18n.extraLocaleSettings = {
    LC_ADDRESS = "fi_FI.UTF-8";
    LC_IDENTIFICATION = "fi_FI.UTF-8";
    LC_MEASUREMENT = "fi_FI.UTF-8";
    LC_MONETARY = "fi_FI.UTF-8";
    LC_NAME = "fi_FI.UTF-8";
    LC_NUMERIC = "fi_FI.UTF-8";
    LC_PAPER = "fi_FI.UTF-8";
    LC_TELEPHONE = "fi_FI.UTF-8";
    LC_TIME = "fi_FI.UTF-8";
  };

  # Console Keymap (System-level console/TTY setting)
  console.keyMap = "fi";


  # Display Server and Desktop Environment (System-wide services)
  services.xserver.enable = true;
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # X11 Keymap Configuration (System-level X server setting)
  services.xserver.xkb = {
    layout = "fi";
    variant = "nodeadkeys";
  };

  # Printing
  services.printing.enable = true;

  # Audio (Pipewire is the recommended modern audio system)
  services.pulseaudio.enable = false; # Disabled as you are using Pipewire
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # jack.enable = true; # Uncomment if needed
  };

  # Graphics Hardware and Drivers (System-level hardware configuration)
  hardware.graphics.enable = true;
  services.xserver.videoDrivers = [ "modesetting" "nvidia" ];
  hardware.nvidia = {
    open = false;
    modesetting.enable = true;
    powerManagement.enable = true;
    prime = {
      offload.enable = true;
      # Use the correct Bus IDs for your system!
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";
    };
  };

  # User Definition
  # The user definition MUST remain here, but the user's packages and zsh config are MOVED.
  users.users.phatle = {
    isNormalUser = true;
    description = "Marko Jokinen";
    extraGroups = [ "networkmanager" "wheel" ];
    # REMOVED: packages = with pkgs; [ ... ]; -> MOVED to home.nix
  };

  # Shell Configuration (System-level availability and default)
  environment.shells = with pkgs; [ zsh ];
  users.defaultUserShell = pkgs.zsh;

  # and ensure PATH is set up correctly for all Zsh users (including root).
  programs.zsh.enable = true;

  # Global System Packages (Small, essential tools that should be available system-wide)
  environment.systemPackages = with pkgs; [
    # vim # Essential editor, keep if you want it globally accessible
    git
    nodejs # Nodejs is often used for system-level build tools
    btop
    nvtopPackages.full
    trash-cli
  ];

  # Allow unfree packages (Needed for Nvidia, Steam, etc.)
  nixpkgs.config.allowUnfree = true;

  # Custom Fonts (System-level font installation for all users/applications)
  fonts.packages = [ pkgs.nerd-fonts.jetbrains-mono ];

  # Nix Configuration and Optimization
  nix.settings.experimental-features = [ "nix-command" "flakes" ];
  nix = {
    settings = {
      max-jobs = "auto";
      cores = 0;
      auto-optimise-store = true;
    };
    gc = {
      automatic = true;
      dates = "weekly";
      options = "--delete-older-than 30d";
    };
  };


  # Home manager back-up

  # This resolves the clobbering issue by setting the option at the correct root level.
  home-manager.backupFileExtension = "old";
  home-manager.backupCommand = "${pkgs.trash-cli}/bin/trash";

  # Note: Removed programs.home-manager.enable = true; as it is redundant when used
  # as a NixOS module, and its options were conflicting with the root-level options.

  # Final state version
  system.stateVersion = "25.11";
}

{ config, pkgs, ... }:

let
  # A helper for packages that are part of the 'kdePackages' set
  kdepkgs = with pkgs.kdePackages; [
    kate
    audiotube
    plasmatube
    kdenlive
  ];

  # List of all desired packages, including powerlevel10k for OMZ
  userPackages = with pkgs; [
    # Zsh Theme Package (Required for Oh My Zsh to find the theme)
    zsh-powerlevel10k

    # --- Multimedia / Graphics ---
    blender
    darktable
    gimp
    inkscape
  ] ++ kdepkgs ++ [
    # --- Communication / Productivity ---
    thunderbird
    libreoffice
    signal-desktop

    # --- Gaming ---
    steam

    # --- Security / VPN ---
    protonvpn-gui
    protonmail-bridge-gui
    proton-pass
  ];

in
{
  ## -------------------------------------------------------------
  ## 1. HOME MANAGER BASICS
  ## -------------------------------------------------------------
  home.username = "phatle";
  home.homeDirectory = "/home/phatle";
  home.stateVersion = "25.11";

  ## -------------------------------------------------------------
  ## 2. USER PACKAGES (Applications installed for the 'phatle' user)
  ## -------------------------------------------------------------
  home.packages = userPackages;

  ## -------------------------------------------------------------
  ## 3. PROGRAM CONFIGURATION
  ## -------------------------------------------------------------

  ###  Zsh Shell Configuration
  programs.zsh = {
    enable = true;
    enableCompletion = true;

    history = {
      path = "${config.home.homeDirectory}/.zsh_history";
      size = 10000;
      save = 10000;
    };

    # Oh My Zsh (OMZ) Configuration
    oh-my-zsh = {
      enable = true;
      theme = "powerlevel10k";
      plugins = [ "git" "sudo" ];
    };

    initContent = ''
      [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
    '';
  };

  ### Web Browsers
  programs.firefox.enable = true;

  ## -------------------------------------------------------------
  ## 4. ENVIRONMENT VARIABLES & DOTFILES
  ## -------------------------------------------------------------
  home.sessionVariables = {
    EDITOR = "kate";
  };

  ## -------------------------------------------------------------
  ## 5. NIXPKGS CONFIGURATION (Allow Unfree Packages)
  ## -------------------------------------------------------------
  nixpkgs.config = {
    allowUnfree = true;
  };
}

i finally cracked this one too i was missing configuration.nix file home.manager somehow still so adding that to there and rebuild fixed home-manager switch not working. the second part was to get pwerlevel10k to working the fix was using ohMyZsh with zsh-powerlevel10k that is set to home-manager userPackages and then just fixing the file where i always got the system complaining that powerlevel10k is not found etc similar so adding default theme = “robbyrussel” on config fixes that too and powerlevel10k is still dominant but this is the way now

## -------------------------------------------------------------
  ## 3. PROGRAM CONFIGURATION
  ## -------------------------------------------------------------

  ### Zsh Shell Configuration (REVISED)
  programs.zsh = {
    enable = true;
    enableCompletion = true;

   history = {
     path = "${config.home.homeDirectory}/.zsh_history";
     size = 10000;
     save = 10000;
   };

   # Oh My Zsh (OMZ) Configuration
   oh-my-zsh = {
     enable = true;
      #Set theme to "robbyrussell" or similar dummy theme
      # This prevents OMZ from complaining about not finding "powerlevel10k"
     theme = "robbyrussell";
     plugins = [ "git" "sudo" ];
   };

    initExtra = ''
      # 1. Source the theme file from the Nix store path
      source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme

      # 2. Source your custom configuration file (.p10k.zsh)
      [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh
    '';
 };

thank you for all helping and pointing me to go deeper and deeper and trying and doing great community