-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
distrobox: add module #6528
base: master
Are you sure you want to change the base?
distrobox: add module #6528
Conversation
a22407c
to
e28c678
Compare
Support for Fish and Nushell has been added. So the pull request is ready to be merged. |
e28c678
to
6902632
Compare
6902632
to
d00670b
Compare
@@ -146,6 +146,7 @@ in import nmtSrc { | |||
./modules/programs/darcs | |||
./modules/programs/dircolors | |||
./modules/programs/direnv | |||
./modules/programs/distrobox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be moved to linux only section
Co-authored-by: Austin Horstman <[email protected]>
Cool!
Wouldn’t a systemd unit be a better option for that, working regardlessly of the users shell and with no need for interaction? |
@LuNeder It should be a better option, but how could I prompt the user for confirmation? Try to open a terminal periodically doesn't seem like the right solution to this problem. By the way, is Bash always available in NixOS? I know about the symlink in /bin/sh. I think it should, given there's no If that is true, it would be better to write the script just for Bash, and running "{pkgs.bash}/bin/bash /path/to/script.sh" in the rest of shells. |
Why does it need user confirmation? If the user edited the config they probably want it to get applied, right?
Unfortunately there doesn’t seem to be an easy way to uninstall bash, and NixOS uses it on a bunch of scripts anyway. Besides, if you do “${pkgs.bash}” then bash will be installed anyway in order to fulfill that ‘placeholder’ so it shouldn’t be a problem. Still, why’s interactivity necessary here if the user is already editing the config and running nixos-rebuild? |
@LuNeder I replaced the shell's extra init code with a Systemd Unit. Here's the code:
But it builds the containers even if the previous hash is equal to the new one. This should be implemented to prevent from rebuilding those containers that have |
Description
Added programs/distrobox.nix module. It provides the option "programs.distrobox.containers", which makes it possible to declare a list of containers to be created. Since building those containers is not possible at build time (because none container backend is available at that time), I also added the options "enableBashIntegration" and "enableZshIntegration", which adds some code to .bashrc and .zshrc respectively that looks for changes in the file "containers.ini" and prompts the user to build the containers.
Support for other shells, like Fish and Nushell, will be added soon.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
or
nix build --reference-lock-file flake.lock ./tests#test-all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC