Skip to content

Commit

Permalink
Rebuild nixos and home-manager together
Browse files Browse the repository at this point in the history
This makes better use of parallelization and hopefully will fail earlier
if there is an issue. Possible since

nix-community/home-manager#1099
  • Loading branch information
timokau committed Apr 7, 2020
1 parent f4b34c7 commit 7c1d26c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ NIXPKGS="$(nix eval --raw '(import ./nixpkgs.nix)')"
export NIX_PATH="nixpkgs=$NIXPKGS:$NIX_PATH"

# First build both systems using nix 2
nix build '(with import <nixpkgs/nixos> { }; system)' || exit $?
nix run nixpkgs.home-manager -c home-manager -2 build || exit $?
nix build '(with import <nixpkgs/nixos> { }; system)' $( nix run nixpkgs.home-manager -c home-manager instantiate || exit $? ) || exit $?

# Now switch both systems. If the build succeeded, this hopefully won't fail
sudo NIXPKGS="$NIXPKGS" nixos-rebuild switch
Expand Down

0 comments on commit 7c1d26c

Please sign in to comment.