From c92199848c15c20529f467bac689581594b20b3a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 20 Jan 2021 01:28:49 -0500 Subject: [PATCH] Add flake templates and defaultApp defaultApp lets you use bin/hey via nix run. --- flake.nix | 19 +++++++++++++++---- templates/minimal/flake.nix | 16 ++++++++++++++++ templates/minimal/hosts/.git-keep | 0 templates/minimal/hosts/main/default.nix | 0 .../hosts/main/hardware-configuration.nix | 0 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 templates/minimal/flake.nix create mode 100644 templates/minimal/hosts/.git-keep create mode 100644 templates/minimal/hosts/main/default.nix create mode 100644 templates/minimal/hosts/main/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index f4df07d2..4fdc50b4 100644 --- a/flake.nix +++ b/flake.nix @@ -64,10 +64,21 @@ devShell."${system}" = import ./shell.nix { inherit pkgs; }; - templates.hey = { - path = ./.; - description = "A grossly incandescent nixos framework"; + templates = { + full = { + path = ./.; + description = "A grossly incandescent nixos config"; + }; + minimal = { + path = ./templates/minimal; + description = "A grossly incandescent and minimal nixos config"; + }; + }; + defaultTemplate = self.templates.minimal; + + defaultApp."${system}" = { + type = "app"; + program = ./bin/hey; }; - defaultTemplate = self.templates.hey; }; } diff --git a/templates/minimal/flake.nix b/templates/minimal/flake.nix new file mode 100644 index 00000000..51128489 --- /dev/null +++ b/templates/minimal/flake.nix @@ -0,0 +1,16 @@ +{ + description = "A grossly incandescent nixos config."; + + inputs = { + dotfiles.url = "github:hlissner/dotfiles"; + }; + + outputs = inputs @ { dotfiles, ... }: { + nixosConfigurations = dotfiles.lib.mapHosts ./hosts { + imports = [ + # If this is a linode machine + # "${dotfiles}/hosts/linode.nix" + ]; + }; + }; +} diff --git a/templates/minimal/hosts/.git-keep b/templates/minimal/hosts/.git-keep new file mode 100644 index 00000000..e69de29b diff --git a/templates/minimal/hosts/main/default.nix b/templates/minimal/hosts/main/default.nix new file mode 100644 index 00000000..e69de29b diff --git a/templates/minimal/hosts/main/hardware-configuration.nix b/templates/minimal/hosts/main/hardware-configuration.nix new file mode 100644 index 00000000..e69de29b