Avoir carriage return in nix configuration file

Hi,

I’m confused to add some configuration on my nix file, i want to preserve

 services.blocky.settings.blocking.blackLists.boulot = [''
     |
     /toto.local/
     /titi.info/
     /blabla$/  
   ''];

But, we had this syntax with \n and not proper syntax.

 boulot:
  - "|\n/toto.local/\n/titi.info/\n/blabla$/  \n"

Could you give me your tips please ?

Jerome

It seems like you want a YAML list here. Does this work?

   services.blocky.settings.blocking.blackLists.boulot = [
     "/toto.local/"
     "/titi.info/"
     "/blabla$/"  
   ];
1 Like

I’ve checked thix syntax earlier but, carriage return already present :frowning:

Configuration:

services.blocky.settings.blocking.blackLists.boulot = [
    ''|
      /armf.local/
      /cnaf.info/
      /cnaf$/''  
  ];

Result:

    boulot:
    - "|\n      /toto.local/\n      /titi.info/\n      /blabla$/"

Or this format if I quote single lines

  boulot:
    - '|'
    - /toto.local/
    - /titi.info/
    - /blabla$/

Expected:

    boulot:
    - |
      /toto.local/
      /titi.info/
      /blabla$/

Maybe this will help you

1 Like