re: NixOS question
@s0 hello!
you got the pattern right :3
but there is a gotcha
when you have a module like
```nix
{ config, … ... }:
{
imports = [ ../flip/flap.nix ];
services.flipnap.flipklox = "whateverer";
}
```
nixpkgs//[lib/modules.nix:489](https://github.com/ckiee/nixpkgs/blob/24ae18f6b74d116aaf2b13853e12015e2554cbe0/lib/modules.nix#L456-L489) is actually transforming your syntax sugar into the "proper" module structure:
```nix
{ config, … ... }:
{
imports = [ ../flip/flap.nix ];
config = {
services.flipnap.flipklox = "whateverer";
};
}
```
`config` is what the module system primarily operates on, but there's also `imports`, `options` and some others. you can't or have to very carefully use `config` from those since the value of `config` might not be known. getting to how this actually plays out in practice, if you want to define an option you wanna add:
```nix
{ config, lib, ... }:
{
imports = [ ../flip/flap.nix ];
options = {
my.species = lib.mkOption {
type = lib.types.str;
description = "the user's species";
default = "blbebelbebolbloblbbocsblobcat..kitty.🐱.";
};
};
config = { services.flipnap.flipklox = "whateverer"; };
}
```
then `config.my.species` should work globally