1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-24 00:21:47 +03:00

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
This commit is contained in:
Timothy DeHerrera 2020-12-28 21:58:23 -07:00
parent 69308e6e71
commit 11f085e78c
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
2 changed files with 20 additions and 4 deletions

View File

@ -79,6 +79,7 @@
{
devShell = import ./shell.nix {
pkgs = pkgs';
nixpkgs = nixos;
};
apps =

View File

@ -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 = ''