Solution: options.nix
returned a function because it started with { config }:
, so I just had to remove that.
I’ve been troubleshooting by myself, but I haven’t been able to find a solution, so:
I use a flake for my NixOS and Home Manager config. (here)
I use a structure rather similar to, but not the exact same as, this flake, and I just switched to having a dedicated file for “options.” However, now when I check the flake or rebuild, I get this error: error: value is a function while a set was expected
. I worked around with this:
#inherit (import ./options.nix) username hostname;
username = (import ./options.nix) username;
hostname = "nixos-pc";
and then got it again:
… while checking the NixOS configuration 'nixosConfigurations.nixos-pc'
at /nix/store/rckyay7rjhsf89cq6xks3kcnc71krva5-source/flake.nix:27:5:
26|
27| nixosConfigurations.${hostname} = nixpkgs.lib.nixosSystem {
| ^
28| specialArgs = {
(stack trace truncated; use '--show-trace' to show the full trace)
error: value is a function while a set was expected
This let me narrow it down to the inherit
statement.
{ inputs, config, pkgs, ... }:
let
inherit (import ./options.nix)
displayName username hostname
KBLayout KBModel KBOptions;
in {
But to me, my flake.nix and system.nix seem to have no difference in the inherit
statements to my reference flake.nix and system.nix which passes nix flake check
.
So why does mine fail?
Thanks