mirror of
https://github.com/davegallant/nix-config
synced 2025-08-06 07:13:40 +00:00
Standardize rebuild script across platforms
This commit is contained in:
13
README.md
13
README.md
@@ -8,21 +8,16 @@ The configuration is very specific to my own machines and setup, but it may be a
|
|||||||
|
|
||||||
## Setup
|
## 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
|
To run a rebuild:
|
||||||
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
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./rebuild.sh switch
|
./rebuild.sh switch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Update
|
## Update
|
||||||
|
|
||||||
To update nixpkgs defined in [flake.nix](./flake.nix), run:
|
To update nixpkgs defined in [flake.nix](./flake.nix), run:
|
||||||
|
18
flake.lock
generated
18
flake.lock
generated
@@ -58,11 +58,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1634939539,
|
"lastModified": 1635017514,
|
||||||
"narHash": "sha256-m+RC6it1doMjq5U5e1B36thzOOBc1GF4tVLK2SNMvzg=",
|
"narHash": "sha256-tdV/y8nJZqKDoqFVE8ORB0drdGdSze2xeWfhWz9M3oo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "8278c14f5f8725e1b5936d6f54e63d4626aae98c",
|
"rev": "406eeec0b98903561767ce7aca311034d298d53e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -81,11 +81,11 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "contrib",
|
"dir": "contrib",
|
||||||
"lastModified": 1634834187,
|
"lastModified": 1635040504,
|
||||||
"narHash": "sha256-L/nuK/voar1fwM3tNHms953QQ80UNghqvsQootaOYQE=",
|
"narHash": "sha256-EtwuXPxOnITZSyQKO4OiB4mc6GFFPYhyA+dtJIX87DQ=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "neovim",
|
"repo": "neovim",
|
||||||
"rev": "cb15055c294e6ebb9b2a65041cbff0a79cd3e69e",
|
"rev": "6acebb8b56e21247423a5692e9ca30dff05abb63",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -102,11 +102,11 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1634890407,
|
"lastModified": 1635063163,
|
||||||
"narHash": "sha256-gCkD8sj7bFS/JY+O+5JpAJXa6OBm3ZOzLgzxLuLWAKY=",
|
"narHash": "sha256-RZ2xoYcAnk67UTy0isQ5+UEwQ5uBffrzU5wUKGC3saw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "neovim-nightly-overlay",
|
"repo": "neovim-nightly-overlay",
|
||||||
"rev": "3ee0aa4bfa70a9990ae0ee05daec06b5e4288ddb",
|
"rev": "5ff5c9f2d167d348bd959fa4eddf37e84493a261",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@@ -10,7 +10,7 @@ Darwin*) machine=mac ;;
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$machine" == "linux" ]]; then
|
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
|
elif [[ "$machine" == "mac" ]]; then
|
||||||
exec darwin-rebuild "$@" --flake .
|
exec darwin-rebuild "$@" --flake .
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user