| 18 Nov 2024 |
frontear | thanks for the response thats honestly somewhat embarrassing that i didnt catch that earlier | 21:39:14 |
frontear | because like you said, the priority being there was a big sign | 21:39:26 |
| 19 Nov 2024 |
ibizaman | In reply to @frontear:matrix.org thanks for the response thats honestly somewhat embarrassing that i didnt catch that earlier Hey sometimes you’re too much in the weeds, seeing the big picture becomes hard. Definitely happened to me more than once. | 12:39:21 |
| 20 Nov 2024 |
| Inayet removed their profile picture. | 00:59:38 |
| 21 Nov 2024 |
| Jason Odoom changed their profile picture. | 02:51:47 |
| oddlama joined the room. | 13:46:18 |
| 25 Nov 2024 |
| @nullcube:matrix.org joined the room. | 10:00:58 |
| 27 Nov 2024 |
| jopejoe1 (4094@epvpn) changed their display name from jopejoe1 to jopejoe1 [4094]. | 18:19:03 |
| 6 Dec 2024 |
| @cafkafk:fem.gg changed their profile picture. | 03:43:51 |
| 11 Dec 2024 |
| @dminca:matrix.org left the room. | 14:19:11 |
| 12 Dec 2024 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 14:34:25 |
| 13 Dec 2024 |
| getchoo joined the room. | 09:28:33 |
getchoo | Hi all
I've come across a fun problem recently. I maintain a set of modules, and previously I had an option in a submodule, but now I've made it a regular (top-level) option. Per usual with changes like this, I wanted to use mkRenamedOptionModule to alias that option submodule option into the top-level option, but I got a nasty surprise with a cannot find attribute <old attribute name> error message
After doing some digging, I'm assuming this is because submodules sort of strip out the regular option data of their inner values, and only expose the fully evaluated configuration. Am I right here? Is there a good way around this?
Here's a minimum repro:
# repro.nix
let
lib = import <nixpkgs/lib>;
in
lib.evalModules {
modules = [
{
options = {
# Create a submodule option
aSubmodule = lib.mkOption {
type = lib.types.submodule {
options = {
# With an inner option
someSubmoduleOption = lib.mkEnableOption "something";
};
};
default = { };
};
# And a top-level option
aRegularOption = lib.mkEnableOption "something";
};
}
# Alias them
(lib.mkRenamedOptionModule [ "aSubmodule" "someSubmoduleOption" ] [ "aRegularOption" ])
{
# Test the alias
# `nix eval --file repro.nix config.aRegularOption`
aSubmodule.someSubmoduleOption = true;
# ...but instead you get
# error: evaluation aborted with the following error message: 'cannot find attribute `aSubmodule.someSubmoduleOption''
}
];
}
| 09:33:27 |
getchoo | * Hi all
I've come across a fun problem recently. I maintain a set of modules, and previously I had an option in a submodule, but now I've made it a regular (top-level) option. Per usual with changes like this, I wanted to use mkRenamedOptionModule to alias that submodule option into the top-level option, but I got a nasty surprise with a cannot find attribute <old attribute name> error message
After doing some digging, I'm assuming this is because submodules sort of strip out the regular option data of their inner values, and only expose the fully evaluated configuration. Am I right here? Is there a good way around this?
Here's a minimum repro:
# repro.nix
let
lib = import <nixpkgs/lib>;
in
lib.evalModules {
modules = [
{
options = {
# Create a submodule option
aSubmodule = lib.mkOption {
type = lib.types.submodule {
options = {
# With an inner option
someSubmoduleOption = lib.mkEnableOption "something";
};
};
default = { };
};
# And a top-level option
aRegularOption = lib.mkEnableOption "something";
};
}
# Alias them
(lib.mkRenamedOptionModule [ "aSubmodule" "someSubmoduleOption" ] [ "aRegularOption" ])
{
# Test the alias
# `nix eval --file repro.nix config.aRegularOption`
aSubmodule.someSubmoduleOption = true;
# ...but instead you get
# error: evaluation aborted with the following error message: 'cannot find attribute `aSubmodule.someSubmoduleOption''
}
];
}
| 09:33:54 |