os/shell.nix
Timothy DeHerrera b954963e36
shell.nix: remove rebuild command
`nixos-rebuild` now works perfectly with flakes so this is no longer
required. A new command `build-iso` is still available so that
building a NixOS image is still possible.
2020-07-13 19:56:39 -06:00

25 lines
652 B
Nix

{ pkgs ? import <nixpkgs> { } }:
let
configs = "${toString ./.}#nixosConfigurations";
buildIso = pkgs.writeShellScriptBin "build-iso" ''
nix build ${configs}.niximg.config.system.build.isoImage
'';
in pkgs.mkShell {
nativeBuildInputs = with pkgs; [ git git-crypt nixFlakes buildIso ];
shellHook = ''
mkdir -p secrets
'';
NIX_CONF_DIR = let
current = pkgs.lib.optionalString (builtins.pathExists /etc/nix/nix.conf)
(builtins.readFile /etc/nix/nix.conf);
nixConf = pkgs.writeTextDir "opt/nix.conf" ''
${current}
experimental-features = nix-command flakes ca-references
'';
in "${nixConf}/opt";
}