Standardize rebuild script across platforms

This commit is contained in:
Dave Gallant
2021-10-24 11:03:47 -04:00
parent 48d0beb50d
commit c2e694fdf6
3 changed files with 14 additions and 19 deletions

View File

@@ -8,21 +8,16 @@ The configuration is very specific to my own machines and setup, but it may be a
## Setup
### NixOS
> on macOS: install the latest unstable nix from https://github.com/numtide/nix-unstable-installer (for nix flakes),
> and nix-darwin: https://github.com/LnL7/nix-darwin
```sh
sudo ./rebuild.sh switch
```
### macOS
1. Install the latest unstable nix from https://github.com/numtide/nix-unstable-installer (to get nix flakes)
1. Install nix-darwin: https://github.com/LnL7/nix-darwin
To run a rebuild:
```sh
./rebuild.sh switch
```
## Update
To update nixpkgs defined in [flake.nix](./flake.nix), run:

18
flake.lock generated
View File

@@ -58,11 +58,11 @@
]
},
"locked": {
"lastModified": 1634939539,
"narHash": "sha256-m+RC6it1doMjq5U5e1B36thzOOBc1GF4tVLK2SNMvzg=",
"lastModified": 1635017514,
"narHash": "sha256-tdV/y8nJZqKDoqFVE8ORB0drdGdSze2xeWfhWz9M3oo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8278c14f5f8725e1b5936d6f54e63d4626aae98c",
"rev": "406eeec0b98903561767ce7aca311034d298d53e",
"type": "github"
},
"original": {
@@ -81,11 +81,11 @@
},
"locked": {
"dir": "contrib",
"lastModified": 1634834187,
"narHash": "sha256-L/nuK/voar1fwM3tNHms953QQ80UNghqvsQootaOYQE=",
"lastModified": 1635040504,
"narHash": "sha256-EtwuXPxOnITZSyQKO4OiB4mc6GFFPYhyA+dtJIX87DQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "cb15055c294e6ebb9b2a65041cbff0a79cd3e69e",
"rev": "6acebb8b56e21247423a5692e9ca30dff05abb63",
"type": "github"
},
"original": {
@@ -102,11 +102,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1634890407,
"narHash": "sha256-gCkD8sj7bFS/JY+O+5JpAJXa6OBm3ZOzLgzxLuLWAKY=",
"lastModified": 1635063163,
"narHash": "sha256-RZ2xoYcAnk67UTy0isQ5+UEwQ5uBffrzU5wUKGC3saw=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "3ee0aa4bfa70a9990ae0ee05daec06b5e4288ddb",
"rev": "5ff5c9f2d167d348bd959fa4eddf37e84493a261",
"type": "github"
},
"original": {

View File

@@ -10,7 +10,7 @@ Darwin*) machine=mac ;;
esac
if [[ "$machine" == "linux" ]]; then
exec nixos-rebuild -I nixos-config="machines/$(hostname)/configuration.nix" "$@" --flake '.#'
sudo nixos-rebuild -I nixos-config="machines/$(hostname)/configuration.nix" "$@" --flake '.#'
elif [[ "$machine" == "mac" ]]; then
exec darwin-rebuild "$@" --flake .
else