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

Support dumping custom paths instead of just / #22

Closed
austinbutler opened this issue Sep 18, 2020 · 4 comments · Fixed by #23
Closed

Support dumping custom paths instead of just / #22

austinbutler opened this issue Sep 18, 2020 · 4 comments · Fixed by #23
Labels
enhancement New feature or request

Comments

@austinbutler
Copy link

Dumped Tilix config

❯ dconf dump /com/gexperts/Tilix/
[profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d]
font='MesloLGS Nerd Font 11'
use-system-font=false
visible-name='Default'

Converted Tilix config

❯ dconf2nix -i tilix.conf -o tilix.nix
# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
{ lib, ... }:

let
  mkTuple = lib.hm.gvariant.mkTuple;
in
{
  dconf.settings = {
    "profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d" = {
      "font" = "MesloLGS Nerd Font 10";
      "use-system-font" = false;
      "visible-name" = "Default";
    };

  };
}

Resulting incorrect dconf config

❯ dconf dump /profiles/
[2b7c4080-0ddd-46c5-8f23-563fd3ba789d]
font='MesloLGS Nerd Font 11'
use-system-font=false
visible-name='Default'

The config that actually works

{
  home-manager.users.austin = { pkgs, ... }: {
    dconf.settings = {
      "com/gexperts/Tilix/profiles/2b7c4080-0ddd-46c5-8f23-563fd3ba789d" = {
        font = "MesloLGS Nerd Font 11";
        use-system-font = false;
        visible-name = "Default";
      };
    };
  };
}
@austinbutler
Copy link
Author

Actually I see what's happening, and it's a me problem 🤕. dconf2nix can't know where to place the dump when it's not at the root level. Not sure what I was expecting...

I suppose the only suggestion I could offer is a warning or something in the README about dumping keys other than root.

@gvolpe
Copy link
Collaborator

gvolpe commented Sep 19, 2020

I think we could add support for dumping keys other than /, maybe something like:

$ dconf dump /com/gexperts/Tilix/ | dconf2nix --root /com/gexperts/Tilix/ > dconf.nix

Though, I'm not sure how common this use case may be.

@gvolpe gvolpe reopened this Sep 19, 2020
@gvolpe gvolpe added the enhancement New feature or request label Sep 19, 2020
@gvolpe gvolpe changed the title Bug with Tilix? Support dumping custom paths instead of just / Sep 19, 2020
@gvolpe
Copy link
Collaborator

gvolpe commented Sep 19, 2020

@austinbutler have a look at #23 and let me know if that looks good to you or you have other suggestions :)

@austinbutler
Copy link
Author

@gvolpe that looks great, thanks! At the very least it at least makes it more clear that it's expecting the root by default, which should help dummies like myself in the future 😉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants