NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.57k stars 1.5k forks source link

Multi-User Darwin Installer usabillity improvements #1493

Open davidak opened 7 years ago

davidak commented 7 years ago

I noticed this things:

  1. when Nix is already installed, it shows a command to remove the folders, but not mentions the profile reference (in first run)

in second run:

I found a reference to a ".nix-profile" in /Users/davidak/.bash_profile.

but no command to run.

can you display a sed that removes the line and display both actions at first run of the script?

  1. i had to run it 3 times before it finally works. every time downloading Nix 1.11.13 binary tarball to another random location. could it reuse earlier downloads if it is the same version?

  2. the output is very long with all the sudo commands. to make it shorter, you could combine the user creation for example and show the commands only once and display dot's for every completed task per user.

~~> Setting up the build users

for every user we will execute this commands:

    $ sudo /usr/sbin/sysadminctl -addUser -fullName Nix build user 1 -home /var/empty -UID 30001 -addUser nixbld1

Creating the Nix build user, nixbld1

    $ sudo /usr/bin/dscl . -create /Users/nixbld1 IsHidden 1

in order to make nixbld1 a hidden user

    $ sudo /usr/bin/dscl . -create /Users/nixbld1 UserShell /sbin/nologin

in order to prevent nixbld1 from logging in

    $ sudo /usr/sbin/dseditgroup -o edit -t user -a nixbld1 nixbld

Add nixbld1 to the nixbld group

    $ sudo /usr/bin/dscl . -create /Users/nixbld1 PrimaryGroupId 30000

to let the nix daemon use this user for builds (this might seem redundant, but there are two concepts of group membership)

nixbld1 ......
nixbld2 ......
nixbld3 ......
nixbld4 ......

maybe you could just print the sudo commands red (if supported) and remove:

---- sudo execution ------------------------------------------------------------
I am executing:
  1. it is very nice to have an example, but maybe we can find something fancy that don't throw 700 MB on the disk.
imac:~ davidak$ nix-shell -p figlet -p lolcat --run "echo 'nix rules' | figlet | lolcat"
these paths will be fetched (142.42 MiB download, 688.92 MiB unpacked):
  /nix/store/1bxsgsxjapzlgqvcgsmfbn0n873cph2i-xz-5.2.3
  /nix/store/1fm1cyngdfjknhl0sfif6lc3hm70w9ja-findutils-4.6.0
  /nix/store/1knl2s6xxb4rmni990ad5329a6arbx5b-lolcat-42.1.0
  /nix/store/2491ii395713iq7yygs93a7nm205xygl-gnused-4.4
  /nix/store/3nxncrqsy3681cmkdwzy5k9ydg8sv1pz-bash-4.4-p12
  /nix/store/4779pw5wwgla1x32d9pv1hb1ixw1sn1l-gemfile-and-lockfile
  /nix/store/4yc9qj0jbk1dkg33a2zhnhmnwcma1sqi-figlet-2.2.5
  /nix/store/53qf5i5aq14jh3p1iidl5d7pl1rbi9k6-ncurses-5.9-man
  /nix/store/5yqmf8cyv1d24607ymrmljzrm814z97q-gawk-4.1.4
  /nix/store/5zflbimi56pzjdl73rd8f2p7r4jnkk4v-patch-2.7.5
  /nix/store/63p46df2ivvmj6lrc44lp22p34bx24qp-ncurses-5.9
  /nix/store/73sqrgk60h8889pf23basjpdxcw0kbdb-libiconv-osx-10.11.6
  /nix/store/7hnlf8py2k1ghj5rwyswxx8789wsiwmq-diffutils-3.6
  /nix/store/7md2d6fg88g5vpiky9pfwz72cigarsgn-CF-osx-10.10.5
  /nix/store/83p2xj5krhaddla4a7piwqfnwcca0khj-gnutar-1.29
  /nix/store/844nzyisps9klwaw00j5ggi8s9ykgdwn-ICU-osx-10.10.5
  /nix/store/86qksshdf30hc2axhl1b3zc3kha3hxkz-bzip2-1.0.6.0.1-bin
  /nix/store/8a2qq0zc1rxqraiwl260p7b5qj27z7dg-bash-4.4-p12-doc
  /nix/store/8y18hzgx36hi9jyw4yjpsvwzmxbzn76w-ruby2.3.4-lolcat-42.1.0
  /nix/store/9x900nsv7g0nm927pvzf98ycw529jbvz-objc4-osx-10.11.6
  /nix/store/azsnb7p4bmqkc5cijc7bjf2j9qb6bazb-bundler-1.15.1
  /nix/store/b2pxy7wlgr2cvwjciqp3ssiz9vbzhcqh-readline-6.3p08
  /nix/store/b6ll5iicpyags3j9akx25bynm2hqr9sj-libc++-4.0.1
  /nix/store/b82nwgg7kj68x649qiwficm5nk3rqfc6-openssl-1.0.2l-dev
  /nix/store/d4k3d9fva6f9f07r8kwvnp8vczjq2bas-clang-4.0.1
  /nix/store/f5fzq3sa3wr5g6ir9r2skclhgmghvv5g-bzip2-1.0.6.0.1
  /nix/store/f5jgbqpv6d2maqp7m0cmg7ac7vpvnhzk-adv_cmds-osx-10.5.8-locale
  /nix/store/fcrlbx8xh5k3q7ghf3kpm8y1mwz4ncjg-perl-5.24.1
  /nix/store/gijmkw7bbyxqvyyx6mw5iqlq03n1sxd7-zlib-1.2.11
  /nix/store/gmz3mvlv1xch14r15hxb7fl6qdb89z31-llvm-4.0.1-lib
  /nix/store/h9p4kyy9nn4ayp4svxc67hq78hxsd9s7-libffi-3.2.1-dev
  /nix/store/k4f4k89l7bqrpi2fg6wyhzpm78jh1jyg-gettext-0.19.8
  /nix/store/khjjp95yajpgb500v1vs60q830iahfr8-openssl-1.0.2l-bin
  /nix/store/l2bscjwyv5d8rkddygr183krndxgk61j-llvm-4.0.1
  /nix/store/l9rcqy7xvf63x923hc9y2b21nnk4ry10-gnumake-4.2.1
  /nix/store/lba32npjj87779iz4ldzs9rsp2ap2xgw-ruby-2.3.4
  /nix/store/lcapgwczxmgyi46gcxgampsksg3zxri5-bash-4.4-p12-dev
  /nix/store/ln6j31gfyzvz43z46sll77rhk2cbyv44-gnugrep-3.0
  /nix/store/lr7vw5by511v9861sxzb4zn6qknl4jar-libunwind-osx-10.11.6
  /nix/store/mnzxbzracp9dfii652jhnpbravxp0f5x-coreutils-8.27
  /nix/store/n8g4nrbi60a0mzscggjkzg5njkhrn556-gettext-0.19.8
  /nix/store/nmwqfxc0jk5sfzs74i8d75b2hw4lpijg-ruby2.3.4-trollop-1.16.2
  /nix/store/pq1ipq9bxsqzc1lfb7ra0q8dycbb8k0j-ruby2.3.4-paint-0.8.7
  /nix/store/pwarlhdvl5slfbpizpidxz4jh2v9wcc1-libyaml-0.1.7
  /nix/store/qmhbaafs722dqv83pj9q6hrar61axbh6-gmp-6.1.2
  /nix/store/r3v2l98wry8p7r2zzakls8ifkflg5yks-gzip-1.8
  /nix/store/s0pk2fxkwf08rwz0r5wrvj304pd33vhi-ncurses-5.9-dev
  /nix/store/vmq7863j3kdnfa6kndcg0cnv2548gi49-Libsystem-osx-10.11.6
  /nix/store/w36m21a7fiy80nmc02zrz39lcrf5y1zv-openssl-1.0.2l
  /nix/store/w7gl599b1ghx5a4m17dnwksc2gy0x9d8-gdbm-1.13
  /nix/store/wn4zhhlaqc3dlg2czsdc30y5286v0h7i-zlib-1.2.11-dev
  /nix/store/wvmbnmyx14w1m8xjp6bav35ln14fwc52-stdenv-darwin
  /nix/store/xbqwv4xgvviv312mr79b70i0hkfvfsfz-ed-1.14.1
  /nix/store/xf50a3s1s93ff5jfpdxiyj07gp2jjhwf-libffi-3.2.1
  /nix/store/y4b9myzrwlnizc4c62a8m8cq3yjmvvn4-bash-4.4-p12-info
  /nix/store/yag5as1hv04qwjx1j88y0jk4bw8c24mn-xz-5.2.3-bin
  /nix/store/ybdlimvv9ybjr5qm6vqab17j2sr6lp16-pcre-8.40
  /nix/store/yw8psl1s8mm33hivkg43h6mwcm859rzy-libc++abi-4.0.1

all in all a very good improvement. thanks @grahamc and everyone who tested!

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info