From b27680288c34ec810e9b927e9165a141f45fd7b3 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Sun, 27 Aug 2023 15:39:11 -0700 Subject: [PATCH] Add basic flake template --- flake.nix | 9 +++++---- templates/basic/.envrc | 1 + templates/basic/flake.nix | 11 +++++++++++ templates/default.nix | 8 ++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 templates/basic/.envrc create mode 100644 templates/basic/flake.nix create mode 100644 templates/default.nix diff --git a/flake.nix b/flake.nix index 8136b7b..1a71d6b 100644 --- a/flake.nix +++ b/flake.nix @@ -5,8 +5,9 @@ { inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; outputs = inputs: - let - flakelight = import ./. inputs; - in - flakelight ./. { outputs = flakelight; }; + let flakelight = import ./. inputs; in + flakelight ./. { + outputs = flakelight; + templates = import ./templates; + }; } diff --git a/templates/basic/.envrc b/templates/basic/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/basic/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/basic/flake.nix b/templates/basic/flake.nix new file mode 100644 index 0000000..a241a72 --- /dev/null +++ b/templates/basic/flake.nix @@ -0,0 +1,11 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + flakelight.url = "github:accelbread/flakelight"; + }; + outputs = { flakelight, ... }@inputs: + flakelight ./. { + inherit inputs; + devShell.packages = pkgs: with pkgs; [ hello ]; + }; +} diff --git a/templates/default.nix b/templates/default.nix new file mode 100644 index 0000000..72bd33e --- /dev/null +++ b/templates/default.nix @@ -0,0 +1,8 @@ +# flakelight -- Framework for simplifying flake setup +# Copyright (C) 2023 Archit Gupta +# SPDX-License-Identifier: MIT + +rec { + default = basic; + basic = { path = ./basic; description = "Minimal Flakelight flake."; }; +}