mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
installer: move channel creation to README
This commit is contained in:
parent
9a1bea70d5
commit
65ea368ebb
3 changed files with 13 additions and 23 deletions
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
|
@ -41,8 +41,9 @@ jobs:
|
|||
with:
|
||||
install_url: https://releases.nixos.org/nix/nix-2.18.8/install
|
||||
nix_path: nixpkgs=channel:${{ env.CURRENT_STABLE_CHANNEL }}
|
||||
- name: Install ${{ env.CURRENT_STABLE_CHANNEL }} channel
|
||||
- name: Install channels
|
||||
run: |
|
||||
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
|
||||
nix-channel --add https://nixos.org/channels/${{ env.CURRENT_STABLE_CHANNEL }} nixpkgs
|
||||
nix-channel --update
|
||||
- name: Install nix-darwin and test
|
||||
|
@ -87,8 +88,9 @@ jobs:
|
|||
with:
|
||||
install_url: https://releases.nixos.org/nix/nix-2.24.9/install
|
||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||
- name: Install nixpkgs-unstable channel
|
||||
- name: Install channels
|
||||
run: |
|
||||
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
|
||||
nix-channel --update
|
||||
- name: Install nix-darwin and test
|
||||
|
|
16
README.md
16
README.md
|
@ -119,24 +119,26 @@ nix-darwin.lib.darwinSystem {
|
|||
|
||||
Copy the [simple](./modules/examples/simple.nix) example to `~/.config/nix-darwin/configuration.nix`.
|
||||
|
||||
### Step 2. Installing `nix-darwin`
|
||||
### Step 2. Adding `nix-darwin` channel
|
||||
|
||||
```bash
|
||||
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
|
||||
nix-channel --update
|
||||
```
|
||||
|
||||
### Step 3. Installing `nix-darwin`
|
||||
|
||||
```bash
|
||||
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
||||
./result/bin/darwin-installer
|
||||
```
|
||||
|
||||
### Step 3. Updating `nix-darwin`
|
||||
|
||||
The installer will configure a channel for this repository.
|
||||
### Step 4. Updating `nix-darwin`
|
||||
|
||||
```bash
|
||||
nix-channel --update darwin
|
||||
darwin-rebuild changelog
|
||||
```
|
||||
|
||||
> NOTE: If you are using Nix as a daemon service the channel for that will be owned by root.
|
||||
> Use `sudo -i nix-channel --update darwin` instead.
|
||||
</details>
|
||||
|
||||
## Documentation
|
||||
|
|
|
@ -47,20 +47,6 @@ stdenv.mkDerivation {
|
|||
echo >&2 "Installing nix-darwin..."
|
||||
echo >&2
|
||||
|
||||
i=y
|
||||
darwinPath=$(NIX_PATH=$HOME/.nix-defexpr/channels nix-instantiate --eval -E '<darwin>' 2> /dev/null) || true
|
||||
if ! test -e "$darwinPath"; then
|
||||
if test -t 0; then
|
||||
read -p "Would you like to manage <darwin> with nix-channel? [y/N] " i
|
||||
fi
|
||||
case "$i" in
|
||||
y|Y)
|
||||
nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
|
||||
nix-channel --update
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
export NIX_PATH=${nixPath}
|
||||
system=$(nix-build '<darwin>' -A system --no-out-link --show-trace)
|
||||
|
||||
|
|
Loading…
Reference in a new issue