b954963e36
`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.
24 lines
652 B
Nix
24 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";
|
|
}
|