Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silicon: init module #5387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afresquet
Copy link
Contributor

Description

Add new module to manage silicon configuration.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@afresquet
Copy link
Contributor Author

afresquet commented May 9, 2024

Tests fail because it's unable to check the existance of ~/.cache/silicon/{themes,syntaxes}.bin, even though it does work when I manually test locally, any ideas of what could be wrong in my tests?

EDIT: do tests run home.activations? if not, then that could be it. Is there a way to test that or should I remove the tests?

# https://github.com/Aloxaf/silicon/issues/242
home.activation.siliconCache = hm.dag.entryAfter [ "linkGeneration" ] ''
(
export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed?

Comment on lines +15 to +27
settings = mkOption {
type = types.str;
default = "";
example = literalExpression ''
--shadow-color '#555'
--background '#fff'
--shadow-blur-radius 30
--no-window-controls
'';
description = ''
Silicon configuration.
'';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

When I worked on my own module for Silicon, I went with a more true-to-Nix approach and I'd love to hear your thoughts. Settings would be set with Nix values (https://github.com/uncenter/flake/blob/9908d5d4f3e345459dfc638f6434d9d28ec5446b/modules/extra/home-manager/silicon.nix#L11-L23) and this attrset would then be converted into the configuration file with https://github.com/uncenter/flake/blob/9908d5d4f3e345459dfc638f6434d9d28ec5446b/modules/extra/home-manager/silicon.nix#L43-L57. You can see it in action at https://github.com/uncenter/flake/blob/9908d5d4f3e345459dfc638f6434d9d28ec5446b/home/programs/silicon.nix#L6-L10.

Copy link
Contributor

@uncenter uncenter left a comment

Choose a reason for hiding this comment

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

It also doesn't look like I can reuse https://github.com/sharkdp/bat themes and syntaxes. A configuration option for the directory in which to build the cache would be nice!

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.

None yet

2 participants