devos/shell.nix
2020-07-16 15:17:12 -06:00

24 lines
655 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";
}