nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.05k stars 1.82k forks source link

`irssi` add `extraSettings` Option #4622

Open benkio opened 1 year ago

benkio commented 1 year ago

Hi, As you can see from the irssi configuration I've set manually in the image attached, I added an extra Setting in the irssi config file.

image

Then I wanted to add such settings via home-manager, but looking at the irssi program here, there's no extraSetting option that I can set to add lines in there. The Feature request is to add an option to the irssi program to do that via nix. Thanks

randomn4me commented 1 year ago

Is the attribute programs.irssi.extraConfig the one you are looking for? I dont know if this is possible, as the default config already defines a core section, but the it should do if you define it like this (assuming, the screenshot shows corrent irssi config syntax, i.e., no nix).

programs.irssi.extraConfig = ''
  core = {
    real_name = "Enrico Benini";
    user_name = "benkio";
    nick = "benkio";
  };
  "irc/dcc" = { dcc_autoget ="yes"; };
'';
benkio commented 1 year ago

If I add the config you suggested, the bit is added at the bottom of the config file as from the code. I don't know if I redefine the settings entirely I'll overwrite it or not. I try to add this:


    irssi = {
      enable = true;
      extraConfig = ''
      settings = {
        core = {
          real_name = "Enrico Benini";
          user_name = "benkio";
          nick = "benkio";
        };
        "irc/dcc" = { dcc_autoget ="yes"; };
      };
      '';
    };

and try to see if that option works or not

benkio commented 1 year ago

Ok, I tried right now. This is the final configuration I've got:

───────┬────────────────────────────────────────────────────────────────────────
       │ File: ./.irssi/config
───────┼────────────────────────────────────────────────────────────────────────
   1   │ settings = {
   2   │   core = {
   3   │     settings_autosave = "no";
   4   │   };
   5   │ };
   6   │ 
   7   │ aliases = {
   8   │ 
   9   │ };
  10   │ 
  11   │ chatnets = {
  12   │ 
  13   │ };
  14   │ 
  15   │ servers = (
  16   │ 
  17   │ );
  18   │ 
  19   │ channels = (
  20   │ 
  21   │ );
  22   │ 
  23   │ settings = {
  24   │   core = {
  25   │     real_name = "Enrico Benini";
  26   │     user_name = "benkio";
  27   │     nick = "benkio";
  28   │   };
  29   │   "irc/dcc" = { dcc_autoget ="yes"; };
  30   │ };
  31   │ 

It works, it's not really clean, but it's a workaround. Then, you can decide if you want to add such option or it's unnecessary

stale[bot] commented 9 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.