diff --git a/template/flake.nix b/template/flake.nix index 90df957..c845fd4 100644 --- a/template/flake.nix +++ b/template/flake.nix @@ -36,6 +36,16 @@ formatter = pkgs.alejandra; + apps.${system} = { + install = { + program = "${pkgs.writeShellScript "install" '' + sudo nixos-generate-config --no-filesystems --force --root /mnt ./system + sudo disko-install --flake .#nixos --disk main /dev/sda --write-efi-entries + ''}"; + type = "app"; + }; + }; + devShells.${system} = { default = pkgs.mkShellNoCC { packages = [ @@ -43,5 +53,17 @@ ]; }; }; + + templates = { + default = { + path = ./.; + + description = "A flake template for a NixOS setup with impermanence."; + + welcomeText = '' + To automatically install do a `nix run .#install` + ''; + }; + }; }; }