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

Make a configuration management tool based on Nix to manage User Profiles. #4594

Closed
wants to merge 3 commits into from

Conversation

nbp
Copy link
Member

@nbp nbp commented Oct 19, 2014

This pull request is made to bootstrap a variant of NixOS, which is dedicated at managing the home directory of users. This new project is called NixUP (Nix User Profile), and the goals are the following:

  • [✓] Generate an activation script.
  • [✓] Abstract the creation of resource files. (similar to environment.etc)
  • [✓] Option to list installed packages. (similar to system.packages)
  • [✗] Command line tool to manage profiles generations and updates. (similar to nixos-rebuild)
  • [✗] Command line tool to write / read option definition without using an editor. (no legacy yet)
  • [✗] Mock compatibility modules to use some NixOS modules in NixUP.
  • [✗] Include NixUP modules as submodules of NixOS option users.extraUser.<name?>

@offlinehacker
Copy link
Contributor

[x] NixOS independanant user services(that also work on osx) similar to
https://github.com/kiberpipa/nix-rehash/tree/master/nix-services

On Sun, Oct 19, 2014 at 7:50 PM, Nicolas B. Pierron <
notifications@github.com> wrote:

This pull request is made to bootstrap a variant of NixOS, which is
dedicated at managing the home directory of users. This new project is
called NixUP (Nix User Profile), and the goals are the following:

  • [✓] Generate an activation script.
  • [✗] Abstract for the creation of resource files. (similar to
    environment.etc)
  • [✗] Option to list installed packages. (similar to system.packages)
  • [✗] Command line tool to manage profiles generations and updates.
    (similar to nixos-rebuild)
  • [✗] Command line tool to write / read option definition without
    using an editor. (no legacy yet)
  • [✗] Mock compatibility modules to use some NixOS modules in NixUP.
  • [✗] Include NixUP modules as submodules of NixOS option
    users.extraUser.<name?>

You can merge this Pull Request by running

git pull https://github.com/nbp/nixpkgs-2 nixup

Or view, comment on, or merge it at:

#4594
Commit Summary

  • Start a configuration management tool based on Nix to manage User
    Profiles.

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4594.

-----BEGIN PGP PUBL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OQgNLxJyMCP7X2jBtDXxkMFVHMmk50Tl3h3Fi9qWuNxgTXjs0tUvKkXiu2
Pco952jnm7HpCIKBek2pqR/UJXXb5qxy5G6Lc0qaMWZ5GKnSMTJmTY6Xl44EnaLK
zh0rqgF9qpoWck470ZbiGASMtB008hy2l0cyxUfvDaS3tY4hABEBAAGJASUEGAEC
AA8FAlEY1PECGwwFCQHhM4AACgkQ+mcYuYWXJSoT6AgAkvzvC0EGmeCR3cn9O3Gf
yG00Kqk9/1gJvlphis7AAce8iUgU+4xd94Vp0u8rghpdy88xKN5lF1W2YZQmmBaf
AVe6b7TOg6kxc3GKkVsWDxNyQKkpB46BwefIGaSljH7502X9aEWosrqWyJJNYCtt
QDit4BysX0Ww3Ka5Rx6ZFhC9ybPKoW2i8JwpyBaXDt7R2k+PC/ClBf9qzL+sb2es
zh/zCMVKNdm8KUITHU/5lgn2qZpUFZwiASPCMGGFP9u8g6UKeUTYTPD+GWaHIW63
RAgNIAffxx0M1r3P/2ipkAdI3NX/1iBKDQNG8Odsf+BswFKrNCnyUDdLPvJAhODS
gw==
=tmrm
-----END PGP PUBLIC KEY BLOCK-----

@nbp
Copy link
Member Author

nbp commented Oct 20, 2014

@offlinehacker

[x] NixOS independanant user services(that also work on osx)

This is what is implied by mocking NixOS / NixUp in the other, such as a module can work for both. If a module is really modular, and all the needed dependencies are implemented, then this should not be a problem.

I am trying to make NixUP modules as modular as possible, by avoiding the mistake I made in NixOS.
I have an idea to enforce one aspect of the modularity, but I am not completely sure that this is desirable.

@offlinehacker
Copy link
Contributor

@nbp that sounds really cool and i would really really like to have nixos services modular. Currently i'm trying to use nixos services in docker, but there's currently really no usefull and modular way to use them with docker's model of one service per container. Is there any way i can help you out with that?

@nbp
Copy link
Member Author

nbp commented Oct 21, 2014

@offlinehacker , as soon as the mock is in place on both sides, the best way would be to add a NixUP back-end to program / services which can support it. One easy way to contribute would be to add a user.resourceFiles where we have environment.etc definitions.

@madjar
Copy link
Member

madjar commented Oct 21, 2014

This is great! It will require some documentation though.

@offlinehacker
Copy link
Contributor

@nbp I will do this asoap for modules, when schema will be defined, i need this support especially for docker containers and also user services. Are you planning to place all config files from etc to users home, i assume there should be some other folder for etc files.

@nbp
Copy link
Member Author

nbp commented Oct 21, 2014

Are you planning to place all config files from etc to users home, i assume there should be some other folder for etc files.

I do not intend to share a common option declaration between the 2, as it does not make sense the use "environment.etc" for the resource files of the user.

I think that such factorization makes sense once we noticed it in multiple modules, and then we can discuss about a proper name for it.

I do not exclude the fact that we would see emerge a common abstraction layer above NixUP & NixOS, typically for services. I just prefer to ignore it for the time being and focus on making good bases for NixUP. The module system gives us a lot of flexibility to build abstractions, so I am not worried about working this way.

@offlinehacker
Copy link
Contributor

Seems reasonable and I don't see problematic writing modules for both
implementations.
On Oct 21, 2014 11:19 PM, "Nicolas B. Pierron" notifications@github.com
wrote:

Are you planning to place all config files from etc to users home, i
assume there should be some other folder for etc files.

I do not intend to share a common option declaration between the 2, as it
does not make sense the use "environment.etc" for the resource files of the
user.

I think that such factorization makes sense once we noticed it in multiple
modules, and then we can discuss about a proper name for it.

I do not exclude the fact that we would see emerge a common abstraction
layer above NixUP & NixOS, typically for services. I just prefer to ignore
it for the time being and focus on making good bases for NixUP. The module
system gives us a lot of flexibility to build abstractions, so I am not
worried about working this way.


Reply to this email directly or view it on GitHub
#4594 (comment).

@wmertens
Copy link
Contributor

wmertens commented Nov 4, 2014

  • Some documentation would be nice too

I love the name and I think I love the concept but I'm not sure yet what the concept is 😁.

What I do wonder though, is if this is even remotely ready for inclusion into the tree. There are a couple of proposals for declarative user spaces, like #4493 and http://lists.science.uu.nl/pipermail/nix-dev/2014-October/014659.html (which I really like, basically modules are instantiated into services and grouped into environments and then NixOS or NixUP (or Docker or whatever) are responsible for running the environment).

Perhaps it would be better to flesh out NixUP some more in a separate repo that users can clone? I for one will try NixUP out-of-tree right now 🍻.

@wmertens
Copy link
Contributor

wmertens commented Nov 4, 2014

Another proposal is embedded in comments: #4493 (comment)

It sounds somewhat similar to the boxes.

In general, I think it's really cool to think of system configuration as a collection of environments to be run.

@ghost
Copy link

ghost commented Nov 30, 2014

When talk with @civodul about 'user services' for Guix today[0],
I finally catch the same idea with you ;-)

NixUP is a modules-powered derivation having the activate script!
Any process?

[0] https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00698.html

@nbp
Copy link
Member Author

nbp commented Nov 30, 2014

NixUP is a modules-powered derivation having the activate script!

Yes, this is exactly the same idea as behind NixOS, and Guix (I guess).

Any process?

Except the login shell, and the activation script, I would not expect any.
Any progress? I had some other activities lately, I will have to get back to it.

@offlinehacker
Copy link
Contributor

I will make service abstraction layer on nixup, that nixos systemd will be able to reuse. Do you think this is a good way to go? I really need service abstraction layer for user services and docker services, everything else are just hacks to adapt systemd interface for other process managers(docker, supervisord). The idea is to port all relevant services from nixos to nixup and then reuse these in nixos.

@offlinehacker
Copy link
Contributor

Btw, nixup kinda has two menings, Nix User Profiles and Nix Upstart :D

@jagajaga
Copy link
Member

Ping? :)

@nbp
Copy link
Member Author

nbp commented Mar 26, 2015

I am currently doing some clean-up on NixOS, mostly as a way to try a way to include similar work as this one in NixOS (such as within extraUsers).

So far you can already use this branch, but the commands might be a bit raw as you would have to basically type manually what is done by nixos-rebuild — without the nix update.

I will have to get back to it, and think more on how to make a command line tool which is both similar to nix-env and also compatible with the module system. The idea would be to have something like:

$ nixup extend config ssh.authorizedKeys ./id.pub

@copumpkin
Copy link
Member

👍

@copumpkin
Copy link
Member

Does this actually need NixOS? It seems like anything that can run Nix could have its user profiles managed this way.

@jagajaga
Copy link
Member

@copumpkin good point

@nbp
Copy link
Member Author

nbp commented Nov 20, 2015

Closing: This work is taken over by @ts468 in #9250.

@nbp nbp closed this Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants