mirror of
https://github.com/nix-community/home-manager.git
synced 2025-04-13 15:57:47 +00:00
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 a Systemd Unit to build those containers after switching the configuration.
41 lines
977 B
Nix
41 lines
977 B
Nix
{
|
|
programs.distrobox = {
|
|
enable = true;
|
|
containers = {
|
|
|
|
python-project = {
|
|
image = "fedora:40";
|
|
additional_packages = "python3 git";
|
|
init_hooks = "pip3 install numpy pandas torch torchvision";
|
|
};
|
|
|
|
common-debian = {
|
|
image = "debian:13";
|
|
entry = true;
|
|
additional_packages = "git";
|
|
init_hooks = [
|
|
"ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/docker"
|
|
"ln -sf /usr/bin/distrobox-host-exec /usr/local/bin/docker-compose"
|
|
];
|
|
};
|
|
|
|
office = {
|
|
clone = "common-debian";
|
|
additional_packages = "libreoffice onlyoffice";
|
|
entry = true;
|
|
};
|
|
|
|
random-things = {
|
|
clone = "common-debian";
|
|
entry = false;
|
|
};
|
|
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/distrobox/containers.ini
|
|
assertFileContent home-files/.config/distrobox/containers.ini \
|
|
${./example-config.ini}
|
|
'';
|
|
}
|