I have been trying to finally start using home-manager. I added it into my flake with:
{
description = "Family Network";
inputs = {
# use master branch of the GitHub repository as input, this is the most common input format
nixpkgs.url = "github:NixOS/nixpkgs/23.11";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
...
};
homeConfigurations = {
defaultPackage.${system} = home-manager.defaultPackage.${system};
genson = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./homeConfigurations/genson.nix
];
};
};
};
}
home-manager build --flake .
produces:
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'home-manager-generation'
whose name attribute is located at /nix/store/j8han9cf3g8vba52yhiklaa6a500pcbv-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
at /nix/store/j8han9cf3g8vba52yhiklaa6a500pcbv-source/pkgs/build-support/trivial-builders/default.nix:87:14:
86| enableParallelBuilding = true;
87| inherit buildCommand name;
| ^
88| passAsFile = [ "buildCommand" ]
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'nix-lib-nmd' missing
at /nix/store/k2xlcibf7irlij5ahxl3w1fkfvq8nmc6-source/docs/default.nix:10:12:
9|
10| nmdSrc = pkgs.nix-lib-nmd;
| ^
11|
This doesn’t seem to happen when I use nixos-unstable as pkgs inside the homeManagerConfiguration. Of course, this has the potential to cause other problems since I am using the 23.11 version of home-manager.