Skip to content
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

nixos/oci-containers: Remove dependency on system.path #111033

Merged
merged 2 commits into from Jan 29, 2021

Conversation

szlend
Copy link
Member

@szlend szlend commented Jan 28, 2021

Motivation for this change

Every oci-containers service depends on system.path which means it will be needlessly restarted every time a package is added/removed from the system path. To fix this I just launch the container backend through bash. Since the backend is already configured through the service PATH, it will automatically pick the correct one.

I also noticed that we weren't taking into account the configured docker.package when using the docker backend, so I also fixed that.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@szlend szlend force-pushed the fix-oci-containers-service-depends branch 2 times, most recently from dc2c4ce to 97154ca Compare January 28, 2021 20:36
@szlend
Copy link
Member Author

szlend commented Jan 28, 2021

@infinisil I replaced ExecStart and ExecStop with script and preStop. I don't know how to replace concatStringsSep with a string literal though. I think the way it's done currently works very well with optionals and empty lists without leaving gaps in the generated script. But if you have a good proposal I'd be happy to do it.

@szlend szlend requested a review from infinisil January 29, 2021 07:56
@szlend szlend force-pushed the fix-oci-containers-service-depends branch from 97154ca to ede2416 Compare January 29, 2021 17:29
@adisbladis
Copy link
Member

@GrahamcOfBorg test oci-containers

@adisbladis adisbladis merged commit d25c7c1 into NixOS:master Jan 29, 2021
@adisbladis
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants