Skip to content

feat: add a nix flake and a home-manager module#12

Closed
ghost wants to merge 5 commits intomainfrom
unknown repository
Closed

feat: add a nix flake and a home-manager module#12
ghost wants to merge 5 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Oct 28, 2024

This was tested with:

  • your matugen repo's flake for the rust package(shouldn't really matter though)
  • my matugen repo on the danid3v-nix-refactor branch for the main home-manager module
  • this branch for, well, stuff related to this pr lol

If you want to see the available templates (in nix at least) you can run the following (you need the nix-command feature and jq):

nix eval -E "import ./nix/parseReadme.nix {lib = (import <nixpkgs> {}).lib; config = { xdg.configHome = \"$HOME/.config\"; gtk.theme.name = \"hello\"; }; }" --impure --json | jq -r '.' --color-output

Notes:

hm module interface:

programs.matugen-themes.presets is limited to a list of strings(e.g. [ "hypr" "gtk3" ]). You can use the name of any template in this repo, except for 2 things that have been changed(the only hardcoded things on the nix side):

  1. the hyprland and hyprlock templates were merged into a single hypr one
  2. starship is removed since it would overwrite the settings placed by the user.
    Note: I know that the file would be overwritten if they don't home-manager. IDK if it will still happen if they use home-manager for starship in the first place

Up for debate

Should the option be moved to programs.matugen.enabledPresets or something else?

readme parsing

nix/parseReadme.nix uses regexes to parse the readme. It should keep working as-is until you add an entry under midnight-discord.

Regex explanations on regex101.com
  • builtins.match ".*output_path = '([^']+)'.*" section(line 57)
  • builtins.match "([^\n]+).*" section(line 75)

Manual work on the end-user's side

They need to know what programs are run in the post_hooks that they are using and place them in programs.matugen.extraPackages, at least after # 68 over at matugen is merged with some variant of my suggestions
A simple realpath $(which <cmd>) should suffice

@ghost ghost closed this by deleting the head repository Sep 13, 2025
This pull request was closed.
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.

0 participants