(apologies for a possibly incoherent title)
I’ve set up flakes and home-manager separately, and recently I tried to add home-manager into my flake as described in the documentation. Here are the relevant portions of my configuration:
# flake.nix
{
description = "broken flake.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
lib = nixpkgs.lib;
in {
nixosConfigurations = {
zxen-nix = lib.nixosSystem {
inherit system; # same thing as system = "x86_64-linux";
modules= [
./system/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.azlanr = import ./home/home.nix;
}
];
};
};
};
}
And my home.nix was working perfectly fine when I ran home-manager switch
without adding it as a flake module. But using sudo nixos-rebuild switch --flake .#
in the flake directory with the flake.nix
given above results in:
error: The option `home-manager.users.azlanr.programs.gtk' does not exist. Definition values:
- In `/nix/store/5i6bi3yx11vjkm63vmkms3gs22nvi78r-source/flake.nix':
{
cursorTheme = {
name = "capitaine-cursors";
package = <derivation capitaine-cursors-4>;
size = 32;
...
(use '--show-trace' to show detailed location information)