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

A per-user configuration.nix #3990

Closed
copumpkin opened this issue Sep 6, 2014 · 16 comments
Closed

A per-user configuration.nix #3990

copumpkin opened this issue Sep 6, 2014 · 16 comments

Comments

@copumpkin
Copy link
Member

If I'm logging into or setting up a new machine, I want reproducible machine configuration, but also reproducible user configuration. My software configuration, programs installed, nix profiles, etc. would all be great to maintain like anything else. The goal being to minimize start-up time when someone gets a new account or machine.

Has this been discussed/worked on?

@copumpkin
Copy link
Member Author

Another benefit would be sharing of developer set-ups and such, the way many people put their dotfiles online.

@lucabrunox
Copy link
Contributor

For the programs you can simply have a .nix file with a set, and nix-env -i
file.nix.

On Sat, Sep 6, 2014 at 7:27 PM, Daniel Peebles notifications@github.com
wrote:

Another benefit would be sharing of developer set-ups and such, the way
many people put their dotfiles online.


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

www.debian.org - The Universal Operating System

@vcunat
Copy link
Member

vcunat commented Sep 6, 2014

I think you're looking for ~/.nixpkgs/config.nix. Recommended reading: https://nixos.org/wiki/Howto_keep_multiple_packages_up_to_date_at_once.

@eduarrrd
Copy link
Contributor

eduarrrd commented Sep 6, 2014

Having a per-user configuration.nix would also allow to define services on a per user basis (through your systemd user instance).

Also: fonts and env variables.

@lucabrunox
Copy link
Contributor

The main problem is about privacy. /nix/store is world readable. We as a
whole community should think about this problem more, because it's becoming
a bottleneck in the nix expressiveness.

On Sat, Sep 6, 2014 at 10:50 PM, eduarrrd notifications@github.com wrote:

Having a per-user configuration.nix would also allow to define services on
a per user basis (through your systemd user instance).

Also: fonts and env variables.


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

www.debian.org - The Universal Operating System

@vcunat
Copy link
Member

vcunat commented Sep 6, 2014

@lethalman: /nix/store privacy is being worked on by @nbp.

@lucabrunox
Copy link
Contributor

Any pointer about following the progress?

On Sat, Sep 6, 2014 at 11:16 PM, Vladimír Čunát notifications@github.com
wrote:

@lethalman https://github.com/lethalman: /nix/store privacy is being
worked on by @nbp https://github.com/nbp.


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

www.debian.org - The Universal Operating System

@vcunat
Copy link
Member

vcunat commented Sep 6, 2014

@lethalman: no idea. Perhaps in the sprint-sumup blogpost that is scheduled to be written on monday by @iElectric, or you may better ask Nicholas himself. From the beginning there was the world-readable assumption and giving it up complicates many things. In any case, you can never have real privacy against root.

@nbp
Copy link
Member

nbp commented Sep 6, 2014

Any pointer about following the progress?

NixOS/nix#329

@nbp
Copy link
Member

nbp commented Oct 19, 2014

This issue is being addressed by the pull request #4594, taking a similar approach as #4493 suggested. The ultimate goal is to be able to share as many modules as possible between NixUP and NixOS.

@domenkozar
Copy link
Member

A dupe of #2190

@alexeymuranov
Copy link
Contributor

Is it possible to set the value of an attribute like programs.bash.promptInit per user?

@vcunat
Copy link
Member

vcunat commented Nov 13, 2016

You could e.g. add code conditioned on $USER into the system bashrc or similar approaches, but IMHO it's typically more practical to have such things in per-user dotfiles and have some solution for managing those (e.g. some version control system).

@alexeymuranov
Copy link
Contributor

@vcunat, i need to

source ${pkgs.gitAndTools.gitFull}/share/git/contrib/completion/git-prompt.sh

somewhere for a given user. I do not know how to do it in .bashrc, but even if it is possible, i do not think this would be a proper solution. Besides, i am sharing my home folder between NixOS and Ubuntu.

@vcunat
Copy link
Member

vcunat commented Nov 13, 2016

@alexeymuranov: hmm, one can always do such things, though it may not be pretty:

source bashrc-common
if [ grep -q '^ID=nixos' /etc/os-release ]; then
    source bashrc-nixos
    # ^ containing e.g. source ~/nix-profile/share/git/contrib/completion/git-prompt.sh
else...

@alexeymuranov
Copy link
Contributor

@vcunat, it turned out that in my case it was enough to set programs.bash.enableCompletion = true.

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

No branches or pull requests

7 participants