Hi!
I am quite new to NixOS, and have started out with flakes and Home-Manager. I have gotten some things to work, but now I encountered a few problems where I cant really figure out what to do.
I recently tried to add ZSH as my users default shell, then configure ZSH via Home-Manager. The first issues is that; whenever I open a new ZSH prompt, I am given the zsh-newuser-install menu, even though I have tried to configure some things via Home-Manager. I guess my Home-Manager setup of ZSH is not working correctly, and I assume it is due to me not fully grasping Nix modules, so maybe someone could help me understand what the problem is here?
Secondly, I found that running nix run home-manager -- switch -f home.nix
(in the directory of my home.nix
file) I get an error message stating my Nixpkgs is 25.05, and my Home-Manager is 25.11. From what I configured, I thought my Home-Manager version would be 25.05 as well?
These are my files:
~/config/flake.nix
:
{
description = "My system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }: rec {
homeModules = import ./home;
nixosConfigurations.linux-desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = (builtins.attrValues homeModules) ++ [
./configuration.nix
home-manager.nixosModules.home-manager {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.moggel = import ./home.nix;
backupFileExtension = "nxbackup";
};
}
];
};
};
}
~/config/home.nix
:
{ config, pkgs, ... }:
{
# Setup user and home
home.username = "moggel";
home.homeDirectory = "/home/moggel";
# Setup config links
home.file.".config/hypr/hyprland.conf".source = ./hyprland.conf;
home.file.".gitconfig".source = ./gitconfig;
home.file.".config/nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.dotfiles/nvim";
programs.waybar.enable = true;
# Setup user packages
home.packages = with pkgs; [
btop
fzf
nmap
zsh
bitwarden-desktop
];
# 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 = "25.05";
}
~/config/home/default.nix
:
{
homeModules = import ./modules;
}
~/config/home/modules/default.nix
:
{
imports = [
./zsh.nix
];
}
~/config/home/modules/zsh.nix
:
{ config, pkgs, ... }:
{
programs.zsh = {
enable = true;
autosuggestions.enable = true;
enableCompletion = true;
enableLsColors = true;
setOptions = [
"HIST_IGNORE_DUPS"
"SHARE_HISTORY"
"HIST_FCNTL_LOCK"
"AUTO_CD"
];
shellInit = ''
bindkey -e
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
'';
};
}