I previously had home-manager working on my machine, but after refactoring some things to separate files, it seems to be mysteriously broken, and I can’t seem to fix it.
The error message is error: The option 'specialisation.fun.configuration.home-manager' does not exist.
Disabling the specialisation fun does not fix it, as it applies to all of them.
I don’t have my dotfiles hosted online, so I’ll just show the relevant ones here:
flake.nix
{
description = "Athyfr's NixOS system flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-quick-update.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
};
outputs =
inputs@{ self, home-manager, ... }:
{
nixosConfigurations =
let
hostName = "athyfr-nixos-laptop";
hostPlatform = "x86_64-linux";
pkgs-quick-update = import inputs.nixpkgs-quick-update { system = "x86_64-linux"; };
pkgs-stable = import inputs.nixpkgs-stable { system = "x86_64-linux"; };
in
{
athyfr-nixos-laptop = inputs.nixpkgs.lib.nixosSystem {
system = hostPlatform;
specialArgs = {
inherit hostPlatform inputs;
inherit home-manager;
inherit pkgs-quick-update pkgs-stable;
};
modules = [
{ networking = { inherit hostName; }; }
# To ensure boot is functional
./configuration.nix
./hardware-configuration.nix
./modules/nushell-config.nix
{
specialisation = {
sysman.configuration = specialisations/sysman.nix;
sysman.inheritParentConfig = false;
fun.configuration = specialisations/fun.nix;
fun.inheritParentConfig = false;
school.configuration = specialisations/school.nix;
school.inheritParentConfig = false;
};
}
];
};
};
};
}
specialisations/sysman.nix
{ inputs, ... }:
{
system.nixos.tags = [ "sysman" ];
imports = [
./base.nix
"${inputs.self}/modules/browser.nix"
"${inputs.self}/modules/desktop.nix"
"${inputs.self}/modules/features.nix"
"${inputs.self}/modules/security.nix"
"${inputs.self}/modules/users/main-accounts.nix" # Home-manager
"${inputs.self}/modules/virtualization.nix"
"${inputs.self}/modules/privileges.nix"
"${inputs.self}/modules/tty.nix"
"${inputs.self}/modules/fancy-hardware.nix"
];
quick = {
tty.enable = false;
};
}
modules/users/main-accounts.nix
{
pkgs,
inputs,
home-manager,
...
}:
{
modules = [
home-manager.nixosModules.home-manager
];
users.users.sysman = {
home = “/home/sysman”;
isNormalUser = true;
shell = pkgs.nushell;
hashedPassword = "<hash>";
extraGroups = [
"nixer"
"wheel"
"adbusers"
"audio"
"sound"
"video"
"networkmanager"
"input"
"tty"
];
};
home-manager.users.sysman = import “${inputs.self}/home-manager/sysman.nix”;
}
specialisations/base.nix
{ pkgs, inputs, ... }:
{
modules = [
inputs.home-manager.nixosModules.home-manager
];
imports = [
"${inputs.self}/hardware-configuration.nix"
"${inputs.self}/configuration.nix"
"${inputs.self}/modules/nushell-config.nix"
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
sharedModules = [
inputs.plasma-manager.homeModules.plasma-manager
];
backupFileExtension = "backup";
overwriteBackup = true;
};
}
Any idea where the issue might lie?
Thanks!