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
environment.systemPackages ignored #65
Comments
See #40 |
There's multiple ways one might make use of NixOS configuration to create a docker image. You can run your service as a NixOS service and enable If you're not using NixOS by calling its init systemd, there's always a chance that you need something that's normally taken care of by NixOS, like installing certain packages or background services (such as cleaning tmp, reaping zombies etc etc). So it really depends on your use case. I currently recommend |
Alright, thanks! If someone runs into a similar issue, here's a working example: { pkgs, ... }:
{
docker-compose.services = {
webserver = { config, pkgs, ... }: {
nixos.configuration = {config, pkgs, ...}: {
boot.isContainer = true;
environment.systemPackages = with pkgs; [
# will be evaluated if service.command isn't set
tree
];
system.build.someEntryFun = pkgs.writeScript "someEntryFun" ''
#!${pkgs.bash}/bin/bash
${pkgs.cowsay}/bin/cowsay "dependencies in this script are fetched automatically"
'';
};
nixos.useSystemd = true;
service = {
command = [ config.nixos.build.someEntryFun ];
useHostStore = true;
};
};
};
} if |
Since
environment.systemPackages
seems to be ignored, what's the recommended way to manage dependencies?The text was updated successfully, but these errors were encountered: