mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 08:17:01 +00:00
readme: add install instructions for bootstrap script
This commit is contained in:
parent
f7e1f9f837
commit
5638925939
2 changed files with 40 additions and 24 deletions
58
README.md
58
README.md
|
@ -12,7 +12,40 @@ This will link the system profile to `/run/current-system`. You have to create `
|
|||
If you use a symlink, you'll probably also want to add `services.activate-system.enable = true;` to your configuration.
|
||||
|
||||
> NOTE: the system activation scripts don't overwrite existing etc files, so files like `/etc/bashrc` won't be used by default.
|
||||
Either modify the existing file to source/import the one from `/etc/static` or remove it.
|
||||
Either modify the existing file to source/import the one from `/etc/static` or remove it. Some examples:
|
||||
|
||||
- `mv /etc/bashrc /etc/bashrc.orig`
|
||||
- `echo 'if test -e /etc/static/bashrc; then . /etc/static/bashrc; fi' | sudo tee -a /etc/bashrc`
|
||||
- `echo 'if test -e /etc/static/bashrc; then . /etc/static/bashrc; fi' | sudo tee -a ~/.bashrc`
|
||||
|
||||
```bash
|
||||
bash <(curl https://raw.githubusercontent.com/LnL7/nix-darwin/master/bootstrap.sh)
|
||||
```
|
||||
|
||||
## Example configuration
|
||||
|
||||
Check out [modules/examples](https://github.com/LnL7/nix-darwin/tree/master/modules/examples) for some example configurations.
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
environment.systemPackages =
|
||||
[ pkgs.nix-repl
|
||||
];
|
||||
|
||||
# Create /etc/bashrc that loads the nix-darwin environment.
|
||||
programs.bash.enable = true;
|
||||
|
||||
# Recreate /run/current-system symlink after boot.
|
||||
services.activate-system.enable = true;
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## Manual Install
|
||||
|
||||
```bash
|
||||
# install nixpkgs version, which enables libsodium support (for signed binary caches)
|
||||
|
@ -78,29 +111,6 @@ Description:
|
|||
Whether to activate system at boot time.
|
||||
```
|
||||
|
||||
## Example configuration
|
||||
|
||||
Check out [modules/examples](https://github.com/LnL7/nix-darwin/tree/master/modules/examples) for some example configurations.
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
environment.systemPackages =
|
||||
[ pkgs.nix-repl
|
||||
];
|
||||
|
||||
# Create /etc/bashrc that loads the nix-darwin environment.
|
||||
programs.bash.enable = true;
|
||||
|
||||
# Recreate /run/current-system symlink after boot.
|
||||
services.activate-system.enable = true;
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## Modules
|
||||
|
||||
### system.defaults
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
set -e
|
||||
set -o pipefail
|
||||
|
||||
{ # Prevent execution if this script was only partially downloaded
|
||||
|
||||
|
||||
# Argument parsing
|
||||
init(){
|
||||
if [ $# -gt 0 ]; then
|
||||
|
@ -232,3 +235,6 @@ main(){
|
|||
|
||||
# Actual run
|
||||
main $@
|
||||
|
||||
|
||||
} # Prevent execution if this script was only partially downloaded
|
||||
|
|
Loading…
Add table
Reference in a new issue