-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite recursion when using namespace in home configuration #142
Comments
Ah I think this is an issue with using home-manager as a NixOS module. I checked and it looks like that path is the only one that does not pass down https://github.com/snowfallorg/lib/blob/main/snowfall-lib/home/default.nix#L276 More clearly stated: when using home-manager as a NixOS module, home-manager needs to have |
Ah I see, thanks. Is this planned to be resolved? For now I can just hardcore the namespace, but I'd like to do it the correct way. |
It should be fixed in a future release, just depends on me or someone else having the time and energy to implement the change. |
I noticed a few things that don't quite align with @jakehamilton's suspicion, nor the infinite recursion related error. Perhaps there's more at play here then I'm understanding. That said, here's what I noticed:
# modules/**home/**foo/default.nix
{ namespace, lib, ... }:
with lib;
{
options."${namespace}".foo = {
enable = mkEnableOption "Foo";
};
}
# homes/**x64_86-linux**/bear@nixos-laptop **---> The architecture is `x86_64-linux`, is it not?**
{ pkgs, lib, namespace, ... }:
{
"${namespace}".foo.enable = true;
home.stateVersion = "24.05";
} # systems/**x64_84-linux**/nixos-laptop **---> Same architecture typo.**
{ config, namespace, lib, pkgs, ... }:
{
imports = [./hardware.nix];
users.users."bear" = {
isNormalUser = true;
};
system.stateVersion = "24.05";
}
# flake.nix
{
description = "DataMarket's NixOS flake";
inputs = {
# Nix Packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Snowfall
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs: inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
**snowfall.namespace = "<some-namespace>"; -----> You're missing a line like this, so the default is being used, which is `internal`, per the documentation. This is why things work when you switch to `internal` in your config.**
channels-config = {
allowUnfree = true;
};
};
}; |
|
outputs =
inputs:
let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
snowfall = {
meta = {
name = "";
title = "";
};
namespace = "";
};
};
in
lib.mkFlake
{
inherit inputs;
src = ./.;
channels-config = {
allowUnfree = true;
permittedInsecurePackages = [ ];
};
...etc... |
Hello.
I am trying to build a simple flake with snowfall, but when I try to use a namespaced module in my home configuration, I get the following error:
I am fairly surprised this is happening since the flake is as small as it can get. Just a module, a home configuration file and a system configuration file; here's their contents:
If i change
"${namespace}"
to a hardcodedinternal
in the line the module is enabled, it works.Thanks in advance.
The text was updated successfully, but these errors were encountered: