forked from pub-solar/os
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:
parent
69308e6e71
commit
11f085e78c
|
@ -79,6 +79,7 @@
|
||||||
{
|
{
|
||||||
devShell = import ./shell.nix {
|
devShell = import ./shell.nix {
|
||||||
pkgs = pkgs';
|
pkgs = pkgs';
|
||||||
|
nixpkgs = nixos;
|
||||||
};
|
};
|
||||||
|
|
||||||
apps =
|
apps =
|
||||||
|
|
23
shell.nix
23
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
|
let
|
||||||
configs = "${toString ./.}#nixosConfigurations";
|
configs = "${toString ./.}#nixosConfigurations";
|
||||||
build = "config.system.build";
|
build = "config.system.build";
|
||||||
|
|
||||||
|
installPkgs = (import "${nixpkgs}/nixos" {
|
||||||
|
configuration = { };
|
||||||
|
system = pkgs.system;
|
||||||
|
}).config.system.build;
|
||||||
|
|
||||||
flk = pkgs.writeShellScriptBin "flk" ''
|
flk = pkgs.writeShellScriptBin "flk" ''
|
||||||
if [[ -z $1 ]]; then
|
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
|
elif [[ $1 == "iso" ]]; then
|
||||||
nix build ${configs}.niximg.${build}.isoImage
|
nix build ${configs}.niximg.${build}.isoImage
|
||||||
|
elif [[ $1 == "install" ]]; then
|
||||||
|
nixos-install --flake ".#$2" $@
|
||||||
else
|
else
|
||||||
sudo nixos-rebuild --flake ".#$1" $2
|
sudo nixos-rebuild --flake ".#$1" $@
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
name = "nixflk";
|
name = "nixflk";
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; with installPkgs; [
|
||||||
git
|
git
|
||||||
git-crypt
|
git-crypt
|
||||||
flk
|
flk
|
||||||
nix-zsh-completions
|
nix-zsh-completions
|
||||||
|
python38Packages.grip
|
||||||
|
nixos-install
|
||||||
|
nixos-generate-config
|
||||||
|
nixos-enter
|
||||||
|
nixos-rebuild
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|
Loading…
Reference in a new issue