From 8ac593fa8489447e1c7730fb3ab2b3c1663d91ed Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Mon, 15 Apr 2024 18:58:06 +0200 Subject: [PATCH] updated --- template/flake.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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` + ''; + }; + }; }; }