Fix completions & cscli setup & prometheus#7
Conversation
|
2 commits added, following latest comments in the PR thread |
| (pkgs.runCommand "cscli-completions" { } '' | ||
| mkdir -p $out/share | ||
| ln -s ${cfg.package}/share/bash-completion $out/share/bash-completion | ||
| ln -s ${cfg.package}/share/zsh $out/share/zsh | ||
| ln -s ${cfg.package}/share/fish $out/share/fish | ||
| '') |
There was a problem hiding this comment.
Am I understanding this correctly that this also fixes the cscli autocompletion for the different shells? 👀
There was a problem hiding this comment.
Yes that is the purpose of this subset of the change. As already mentioned, it's not perfect because systemd will ask for password on each tab press unless in a sudo su shell. Also nearly all entries (not all though, interestingly) in the first level (subcommands) show up duplicated, on zsh (which is customized to pipe suggestions in fzf). Bash is fine. Fish, I haven't tested as I don't use it.
There was a problem hiding this comment.
Hm... have you tried to add your user to the crowdsec group? Maybe this helps a bit since the service is running as that user.
|
Just a sec... After some more testing I'm getting let me fix this |
|
Thank you! |
A new round of fixes for NixOS#446307
Additional config dirs / files added inspired by https://github.com/crowdsecurity/crowdsec/blob/356d3111dda77b75e4531c47c6574dbf77f2e433/build/debian/rules
I started playing with prometheus and noticed it requires
prometheus.enabled = true, so let's add it as an option for clarity.The
patternsconfig dir, IMO is better to overwrite on each setup, in case upstream modified them after an update.Completions: use
sudo susubshell to workaround password prompt on each tab. The first level of completions are duplicated:But from the 2nd level it looks fine:
Not sure how to fix this...