astroid icon indicating copy to clipboard operation
astroid copied to clipboard

can't generate config without X

Open teto opened this issue 5 years ago • 2 comments

I am adding support for astroid in home-manager https://github.com/rycee/home-manager/pull/408 (i.e., home-manager will generate astroid config file). My first approach was to copy the default config into home-manager and change some parameters. I want to generate the config instead of manually updating it for 2 reasons:

  • manually updating is annoying
  • one of the strength of nix is rules out impurities. Having a manual config creates state, which may break updates depending on which version of astroid to use

So I have this script

    generateConfig = pkgs.runCommand "astroid-config-template" {} ''
        export HOME=$out
        ${pkgs.astroid}/bin/astroid --new-config
    '';

but it fails because of (I think):

DISPLAY= astroid --new-config                                                                                                                                   
(.astroid-wrapped:14685): Gtk-WARNING **: 23:16:24.072: cannot open display: 

Could astroid be made so that it doesn't need X to generate the config ?

teto avatar Oct 20 '18 14:10 teto

Yes, we need this for the tests too.

lør. 20. okt. 2018 kl. 16:23 skrev Matthieu Coudron < [email protected]>:

I am adding support for astroid in home-manager rycee/home-manager#408 https://github.com/rycee/home-manager/pull/408 (i.e., home-manager will generate astroid config file). My first approach was to copy the default config into home-manager and change some parameters. I want to generate the config instead of manually updating it for 2 reasons:

  • manually updating is annoying
  • one of the strength of nix is rules out impurities. Having a manual config creates state, which may break updates depending on which version of astroid to use

So I have this script

generateConfig = pkgs.runCommand "astroid-config-template" {} ''
    export HOME=$out
    ${pkgs.astroid}/bin/astroid --new-config
'';

but it fails because of (I think):

DISPLAY= astroid --new-config (.astroid-wrapped:14685): Gtk-WARNING **: 23:16:24.072: cannot open display:

Could astroid be made so that it doesn't need X to generate the config ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/astroidmail/astroid/issues/579, or mute the thread https://github.com/notifications/unsubscribe-auth/AADd-33nqNIPaZyZqmmIIbwWnQZC3yFMks5umzHWgaJpZM4Xx822 .

gauteh avatar Oct 20 '18 14:10 gauteh

Cool looking forward to it !

teto avatar Oct 22 '18 07:10 teto