Skip to content

cleaning up a bunch of tech debt#1548

Draft
sodiboo wants to merge 80 commits into
mainfrom
very-refactor
Draft

cleaning up a bunch of tech debt#1548
sodiboo wants to merge 80 commits into
mainfrom
very-refactor

Conversation

@sodiboo

@sodiboo sodiboo commented Dec 26, 2025

Copy link
Copy Markdown
Owner

hello. i have decided that This is an arbitrary point in time at which i want to make relatively major internal structural changes to this flake.

so far, i've started with refactoring the settings module into a directory with a bit cleaner organization. notably, all of the rendering logic is now right next to the option definitions. i also made it internally use the "new" KDL representation from NixOS/nixpkgs#426828, which also means ditching the pure-nix serializer i had previously written.

because niri v25.11 has config includes, a lot of the config is now partial. so, there will be less "default values" hanging around of things you didn't configure. i also did some web development and made generated documentation for the settings that feels way nicer. check out what i've got so far

next up, i need to rework the modules for integrating those settings into a NixOS and/or home-manager configuration. in doing so, i'll finally deprecate the current niri-flake.nixosModules.niri properly, which has been a long time coming. i've already begun that work slightly by factoring out the binary cache to its own module. i also want to write a bit more welcoming documentation that's less out of date and less shaped like this mess. the current documentation is half-outdated and Slowly Rotting, most of it was written before NixOS even had a module to install niri. i will write new documentation that's better™, and accurately describes how i think niri-flake is best used today.

i'll probably also be implementing the rest of the settings from v25.11. that is, i hope that this will close #1493. probably, i'll end up fixing a bunch of other issues and superseding some other PRs along the way. for instance, the new organization of the settings is already much more convenient to consume without flakes, and i'm hoping to make all niri-flake functionality work that way. that is, i'm trying to fix #1089.

and in general, until i'm done with this, i'm hesitant to merge any other PRs, because at best they'll cause annoying merge conflicts with this branch, and at worst they'll be made irrelevant by things i was going to do anyways or things that have changed enough to need to rewrite the functionality anyways.

yes, i know there are a bunch of open PRs. and to be honest, i haven't had the energy to look at most of them. i probably won't look at most of them either, until i'm done with these changes.

uh oH! that's IFD for now. will be fixed before this is merged into
main.
guess i forgot to change this when i factored out the contents of that
description lol
ehh this is kinda messy but it makes heavy use of properties and nothing
else does. so this is good enough i suppose
@sodiboo

sodiboo commented Jan 7, 2026

Copy link
Copy Markdown
Owner Author

with 5bb95c2, supersedes/closes #1397 and fixes #1393

@sodiboo sodiboo linked an issue Jan 7, 2026 that may be closed by this pull request
@sodiboo

sodiboo commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

check this out i made it usable Without being super tightly tied to home manager and such. my own system configuration no longer needs to consume niri-flake internals sodiboo/system@b75ca42

@mochouaaaaa

Copy link
Copy Markdown

check this out i made it usable Without being super tightly tied to home manager and such. my own system configuration no longer needs to consume niri-flake internals sodiboo/system@b75ca42

I tried it, and currently, the workspaces section seems to have some validation issues (I'm not entirely sure), it will validate config.enable

@LucasOe

LucasOe commented Jan 28, 2026

Copy link
Copy Markdown

input.focus-follows-mouse.enable = false; doesn't seem to work.

@viluon

viluon commented Feb 23, 2026

Copy link
Copy Markdown

Seems to break for my config (viluon/nixos@6486af1) in the workspaces block, I didn't try to minimize this yet.

Stack trace
error:
       … while calling the 'head' builtin
         at /nix/store/wl5m60vn27dl0dnqrwif4jam4zy86inq-source/lib/attrsets.nix:1696:13:
         1695|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1696|             head values
             |             ^
         1697|           else

       … while evaluating the attribute 'value'
         at /nix/store/wl5m60vn27dl0dnqrwif4jam4zy86inq-source/lib/modules.nix:1118:7:
         1117|     // {
         1118|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1119|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/wl5m60vn27dl0dnqrwif4jam4zy86inq-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `home-manager.users.viluon.home.file."/home/viluon/.config/niri-config".enable':

       … while evaluating definitions from `/nix/store/a0msnj896sl2cm4i8m3zlf4w3mknl06l-source/modules/misc/xdg.nix':

       … while evaluating the option `home-manager.users.viluon.xdg.configFile.niri-config.enable':

       … while evaluating definitions from `/nix/store/a0msnj896sl2cm4i8m3zlf4w3mknl06l-source/nixos/common.nix':

       … while evaluating the option `home-manager.users.viluon.programs.niri.finalConfig':

       … while evaluating the option `home-manager.users.viluon.programs.niri.config."[entry 7]".children':

       … while evaluating definitions from `/nix/store/a0msnj896sl2cm4i8m3zlf4w3mknl06l-source/nixos/common.nix':

       … while evaluating the option `home-manager.users.viluon.programs.niri.settings.rendered."[entry 2]"."[entry 10]"."[entry 1]".children':

       … while evaluating definitions from `/nix/store/11nahhbnqv39zm7618k39vc0ab43n62p-source/settings/toplevel.nix':

       … while evaluating the option `home-manager.users.viluon.programs.niri.settings.workspaces."1-firefox".rendered.children':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'enable' missing
       at /nix/store/11nahhbnqv39zm7618k39vc0ab43n62p-source/settings/workspaces.nix:66:33:
           65|                   config.rendered = kdl.node "output" config.name [
           66|                     (lib.mkIf (!config.enable) (kdl.flag "off"))
             |                                 ^
           67|                     (lib.mkIf (config.enable) [ rendered ])
error: Recipe `build` failed on line 12 with exit code 1

@aquifolly

Copy link
Copy Markdown
Contributor

@mochouaaaaa @viluon does #1660 fix the named workspaces for you?

@viluon

viluon commented Feb 27, 2026

Copy link
Copy Markdown

yeah @hollymlem, thanks, viluon/nixos@d555378 builds fine

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.

v25.11 parity [Feature Request] Add include use without flakes

5 participants