Merge pull request #1719 from grahamc/fixup-darwin-hs-master
Fixup darwin hs master
This commit is contained in:
		
						commit
						82e6275a7b
					
				
					 1 changed files with 21 additions and 7 deletions
				
			
		| 
						 | 
					@ -264,7 +264,7 @@ them and open them again. Other than that, you should be ready to go.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Try it! Open a new terminal, and type:
 | 
					Try it! Open a new terminal, and type:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  $ nix-shell -p figlet -p lolcat --run "echo 'nix rules' | figlet | lolcat"
 | 
					  $ nix-shell -p nix-info --run "nix-info -m"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Thank you for using this installer. If you have any feedback, don't
 | 
					Thank you for using this installer. If you have any feedback, don't
 | 
				
			||||||
hesitate:
 | 
					hesitate:
 | 
				
			||||||
| 
						 | 
					@ -473,10 +473,8 @@ create_build_user_for_core() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ! /usr/bin/dscl . -read "$dsclpath" > /dev/null 2>&1; then
 | 
					    if ! /usr/bin/dscl . -read "$dsclpath" > /dev/null 2>&1; then
 | 
				
			||||||
        _sudo "Creating the Nix build user, $username" \
 | 
					        _sudo "Creating the Nix build user, $username" \
 | 
				
			||||||
              /usr/sbin/sysadminctl -addUser -fullName "Nix build user $coreid" \
 | 
					              /usr/bin/dscl . create "$dsclpath" \
 | 
				
			||||||
	      -home /var/empty \
 | 
					              UniqueID "${uid}"
 | 
				
			||||||
	      -UID "${uid}" \
 | 
					 | 
				
			||||||
              -addUser "${username}"
 | 
					 | 
				
			||||||
        row "           Created" "Yes"
 | 
					        row "           Created" "Yes"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        actual_uid=$(dsclattr "$dsclpath" "UniqueID")
 | 
					        actual_uid=$(dsclattr "$dsclpath" "UniqueID")
 | 
				
			||||||
| 
						 | 
					@ -504,6 +502,22 @@ EOF
 | 
				
			||||||
        row "          IsHidden" "Yes"
 | 
					        row "          IsHidden" "Yes"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ "$(dsclattr "$dsclpath" "NFSHomeDirectory")" = "/var/empty" ]; then
 | 
				
			||||||
 | 
					        row "          NFSHomeDirectory" "/var/empty"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        _sudo "in order to give $username a safe home directory" \
 | 
				
			||||||
 | 
					              /usr/bin/dscl . -create "$dsclpath" "NFSHomeDirectory" "/var/empty"
 | 
				
			||||||
 | 
					        row "          NFSHomeDirectory" "/var/empty"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ "$(dsclattr "$dsclpath" "RealName")" = "Nix build user $coreid" ]; then
 | 
				
			||||||
 | 
					        row "          RealName" "Nix build user $coreid"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        _sudo "in order to give $username a useful name" \
 | 
				
			||||||
 | 
					              /usr/bin/dscl . -create "$dsclpath" "RealName" "Nix build user $coreid"
 | 
				
			||||||
 | 
					        row "          RealName" "Nix build user $coreid"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [ "$(dsclattr "$dsclpath" "UserShell")" = "/sbin/nologin" ]; then
 | 
					    if [ "$(dsclattr "$dsclpath" "UserShell")" = "/sbin/nologin" ]; then
 | 
				
			||||||
        row "   Logins Disabled" "Yes"
 | 
					        row "   Logins Disabled" "Yes"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
| 
						 | 
					@ -521,11 +535,11 @@ EOF
 | 
				
			||||||
        row "  Member of $NIX_BUILD_GROUP_NAME" "Yes"
 | 
					        row "  Member of $NIX_BUILD_GROUP_NAME" "Yes"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [ "$(dsclattr "$dsclpath" "PrimaryGroupId")" = "$NIX_BUILD_GROUP_ID" ]; then
 | 
					    if [ "$(dsclattr "$dsclpath" "PrimaryGroupID")" = "$NIX_BUILD_GROUP_ID" ]; then
 | 
				
			||||||
        row "    PrimaryGroupID" "$NIX_BUILD_GROUP_ID"
 | 
					        row "    PrimaryGroupID" "$NIX_BUILD_GROUP_ID"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        _sudo "to let the nix daemon use this user for builds (this might seem redundant, but there are two concepts of group membership)" \
 | 
					        _sudo "to let the nix daemon use this user for builds (this might seem redundant, but there are two concepts of group membership)" \
 | 
				
			||||||
              /usr/bin/dscl . -create "$dsclpath" "PrimaryGroupId" "$NIX_BUILD_GROUP_ID"
 | 
					              /usr/bin/dscl . -create "$dsclpath" "PrimaryGroupID" "$NIX_BUILD_GROUP_ID"
 | 
				
			||||||
        row "    PrimaryGroupID" "$NIX_BUILD_GROUP_ID"
 | 
					        row "    PrimaryGroupID" "$NIX_BUILD_GROUP_ID"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue