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

Reusing docker.nix #7550

Open
Jonpez2 opened this issue Jan 4, 2023 · 2 comments
Open

Reusing docker.nix #7550

Jonpez2 opened this issue Jan 4, 2023 · 2 comments
Labels
feature Feature request or proposal

Comments

@Jonpez2
Copy link
Contributor

Jonpez2 commented Jan 4, 2023

Is your feature request related to a problem? Please describe.
I'm trying to make a docker image which operates exactly like nixos/nix, but I also want to start up sshd in the image. That requires a little bit of shenanigans (adding an ssh user, making the /var/empty dir) on top of the image defined in docker.nix. At the moment, I've copied + pasted docker.nix verbatim, but that seems like the wrong option.

Describe the solution you'd like
I'd like to refactor docker.nix in some way that I can twiddle knowbs to make it do what I want, but I'm not totally sure how to approach it, so I thought I'd ask advice before diving in.

Describe alternatives you've considered
Copy + paste, which works fine, but will be sad longer term

Additional context
Please and thank you!

Priorities

Add 👍 to issues you find important.

@Jonpez2 Jonpez2 added the feature Feature request or proposal label Jan 4, 2023
@roberth
Copy link
Member

roberth commented Jan 4, 2023

I've previously completed a proof of concept building a docker image using parts of NixOS: the etc and user setup bits, but not systemd. This solves the problem of composing images. It won't make adding ssh trivial because of the lack of systemd, but it will make composition of docker.nix and your own contents possible.

Currently I don't have the need or resources to complete it, but it isn't rocket science; just moving code between existing NixOS modules and adding one or two options to serve as interfaces between modules to decouple them.

@Jonpez2
Copy link
Contributor Author

Jonpez2 commented Jan 5, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

2 participants