From 11f085e78cf0e798b8a04bc5bedcfb72b3771e29 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 28 Dec 2020 21:58:23 -0700 Subject: [PATCH] shell: pull in more dependencies * Pull recent enough versions on nixos-(rebuild|install) to ensure compatibility with flakes. * Add grip for viewing changes to README.md locally --- flake.nix | 1 + shell.nix | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 0ac048b9..e10ad293 100644 --- a/flake.nix +++ b/flake.nix @@ -79,6 +79,7 @@ { devShell = import ./shell.nix { pkgs = pkgs'; + nixpkgs = nixos; }; apps = diff --git a/shell.nix b/shell.nix index b9de6b79..5aae2efc 100644 --- a/shell.nix +++ b/shell.nix @@ -1,25 +1,40 @@ -{ pkgs ? import (import ./nixpkgs-compat.nix) { } }: +let + nixpkgs' = import ./nixpkgs-compat.nix; +in +{ pkgs ? import nixpkgs { }, nixpkgs ? nixpkgs' }: let configs = "${toString ./.}#nixosConfigurations"; build = "config.system.build"; + installPkgs = (import "${nixpkgs}/nixos" { + configuration = { }; + system = pkgs.system; + }).config.system.build; + flk = pkgs.writeShellScriptBin "flk" '' if [[ -z $1 ]]; then - echo "Usage: $(basename $0) host {switch|boot|test|iso}" + echo "Usage: $(basename $0) [ iso | install {host} | {host} [switch|boot|test] ]" elif [[ $1 == "iso" ]]; then nix build ${configs}.niximg.${build}.isoImage + elif [[ $1 == "install" ]]; then + nixos-install --flake ".#$2" $@ else - sudo nixos-rebuild --flake ".#$1" $2 + sudo nixos-rebuild --flake ".#$1" $@ fi ''; in pkgs.mkShell { name = "nixflk"; - nativeBuildInputs = with pkgs; [ + nativeBuildInputs = with pkgs; with installPkgs; [ git git-crypt flk nix-zsh-completions + python38Packages.grip + nixos-install + nixos-generate-config + nixos-enter + nixos-rebuild ]; shellHook = ''