Skip to content

expand functionality#26

Open
unazikx wants to merge 7 commits into
arnarg:mainfrom
unazikx:main
Open

expand functionality#26
unazikx wants to merge 7 commits into
arnarg:mainfrom
unazikx:main

Conversation

@unazikx
Copy link
Copy Markdown

@unazikx unazikx commented May 31, 2026

No description provided.

@arnarg
Copy link
Copy Markdown
Owner

arnarg commented Jun 1, 2026

Hey @unazikx, thanks for this contribution. Could you provide a description or some context on the changes you're proposing?

Also could you run the files you've changed through nixfmt before committing?

@unazikx
Copy link
Copy Markdown
Author

unazikx commented Jun 1, 2026

i formatted it via nixfmt (in helix as formatter for .nix files)

commits are gives hjem modules and hjem generator, and recursive modules load, example:

without recursive option there will be

❯ nix repl --expr '{ nilla = import ./nilla.nix; }'
Lix 2.94.2
Type :? for help.
Loading installable ''...
Added 1 variables.
nix-repl> nilla.
nilla.assertions  nilla.explain     nilla.generators  nilla.lib         nilla.modules     nilla.overlays    nilla.shells      nilla.warnings
nilla.builders    nilla.extend      nilla.inputs      nilla.loaders     nilla.nilla       nilla.packages    nilla.systems
nix-repl> nilla.modules.nixos
{ }

nix-repl> 
❯ eza -T modules/nixos/
 modules/nixos
├──  common
│   └──  hjem
│       └──  default.nix
├──  hardware
│   ├──  amd-cpu
│   │   └──  default.nix
│   ├──  amd-gpu
│   │   └──  default.nix
│   ├──  bluetooth
│   │   └──  default.nix
│   ├──  boot
│   │   └──  default.nix
│   ├──  network
│   │   └──  default.nix
│   ├──  powermanagement
│   │   └──  default.nix
│   ├──  sound
│   │   └──  default.nix
│   └──  zram
│       └──  default.nix

and with recursive option we get

❯ nix repl --expr '{ nilla = import ./nilla.nix; }'
Lix 2.94.2
Type :? for help.
Loading installable ''...
Added 1 variables.
nix-repl> nilla.modules.nixos
{
  amd-cpu = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/amd-cpu/default.nix:1:1»;
  amd-gpu = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/amd-gpu/default.nix:1:1»;
  base16 = «lambda @ /home/nixzoid/nilla-config/modules/nixos/theming/base16/default.nix:1:1»;
  bluetooth = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/bluetooth/default.nix:1:1»;
  boot = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/boot/default.nix:1:1»;
  hjem = «lambda @ /home/nixzoid/nilla-config/modules/nixos/common/hjem/default.nix:1:1»;
  locales = «lambda @ /home/nixzoid/nilla-config/modules/nixos/miscellaneous/locales/default.nix:1:1»;
  minimal = «lambda @ /home/nixzoid/nilla-config/modules/nixos/miscellaneous/minimal/default.nix:1:1»;
  network = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/network/default.nix:1:1»;
  nix-config = «lambda @ /home/nixzoid/nilla-config/modules/nixos/miscellaneous/nix-config/default.nix:1:1»;
  powermanagement = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/powermanagement/default.nix:1:1»;
  security = «lambda @ /home/nixzoid/nilla-config/modules/nixos/miscellaneous/security/default.nix:1:1»;
  sound = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/sound/default.nix:1:1»;
  users = «lambda @ /home/nixzoid/nilla-config/modules/nixos/miscellaneous/users/default.nix:1:1»;
  zram = «lambda @ /home/nixzoid/nilla-config/modules/nixos/hardware/zram/default.nix:1:1»;
}

nix-repl> 
❯ eza -T modules/nixos/
 modules/nixos
├──  common
│   └──  hjem
│       └──  default.nix
├──  hardware
│   ├──  amd-cpu
│   │   └──  default.nix
│   ├──  amd-gpu
│   │   └──  default.nix
│   ├──  bluetooth
│   │   └──  default.nix
│   ├──  boot
│   │   └──  default.nix
│   ├──  network
│   │   └──  default.nix
│   ├──  powermanagement
│   │   └──  default.nix
│   ├──  sound
│   │   └──  default.nix
│   └──  zram
│       └──  default.nix

@unazikx
Copy link
Copy Markdown
Author

unazikx commented Jun 1, 2026

as example i can give u my testing repo
https://github.com/unazikx/nilla-config-test

very very shizo

Copy link
Copy Markdown
Owner

@arnarg arnarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you changed function parameters from { config }: to multi-line I assumed you were using another formatter than nixfmt but I have tested it and it seems it allows for both. I'd however like to keep the compact version for a single attribute parameters like { config }:, please change that.

Otherwise I have some minor changes requested.

One thought regarding the recursive module loader, would it make sense to build the resulting attribute set recursively too? so nilla.modules.nixos.common.hjem instead of just nilla.modules.nixos.hjem from your example?

Comment thread modules/hjem.nix Outdated
Comment thread modules/home.nix Outdated
Comment thread modules/nixos.nix Outdated
Comment thread modules/hjem.nix
unazikx and others added 5 commits June 1, 2026 21:09
Co-authored-by: Arnar <arnar@codedbearder.com>
Co-authored-by: Arnar <arnar@codedbearder.com>
Co-authored-by: Arnar <arnar@codedbearder.com>
Co-authored-by: Arnar <arnar@codedbearder.com>
@unazikx
Copy link
Copy Markdown
Author

unazikx commented Jun 1, 2026

One thought regarding the recursive module loader, would it make sense to build the resulting attribute set recursively too? so nilla.modules.nixos.common.hjem instead of just nilla.modules.nixos.hjem from your example?

im frkn stupid and cant understood ur thoughts

@arnarg
Copy link
Copy Markdown
Owner

arnarg commented Jun 1, 2026

Oh come on now, maybe I didn't articulate my thoughts well enough :)

What I mean is that in your example it produces:

{
  amd-cpu = ./modules/nixos/hardware/amd-cpu/default.nix;
  amd-gpu = ./modules/nixos/hardware/amd-gpu/default.nix;
  hjem = ./modules/nixos/common/hjem/default.nix;
}

But maybe it should produce the following instead:

{
  common = {
    hjem = ./modules/nixos/common/hjem/default.nix;
  };
  hardware = {
    amd-cpu = ./modules/nixos/hardware/amd-cpu/default.nix;
    amd-gpu = ./modules/nixos/hardware/amd-gpu/default.nix;
  };
}

@unazikx
Copy link
Copy Markdown
Author

unazikx commented Jun 1, 2026

uh, yeah it should be right
ill do this soon

@unazikx unazikx force-pushed the main branch 2 times, most recently from 90726f6 to d170a8a Compare June 2, 2026 08:53
@unazikx
Copy link
Copy Markdown
Author

unazikx commented Jun 2, 2026

tf im stupid o'not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants