I was hoping to use a variable to specify the release of the inputs to a flake but the following example gives an error. If I use a recursive set it gives the same error but with string
instead of thunk
. Could someone please explain what I’m missing here? Thank you
error: expected a set but got a thunk at /nix/store/fackd5ypxf7qxdh48pnd89vhx8v05djq-source/flake.nix:4:3
flake.nix:
{
description = "Home Manager configuration of user";
inputs =
let
nix-release = "23.11";
in {
nixpkgs.url = "github:nixos/nixpkgs/nixos-${nix-release}";
home-manager = {
url = "github:nix-community/home-manager/release-${nix-release}";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
let
user = "user";
system = "x86_64-darwin";
pkgs = inputs.nixpkgs.legacyPackages.${system};
in {
homeConfigurations.${user} = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
};
};
}
nix --version
= 2.18.1
manual: nix flake - Nix Reference Manual