diff --git a/README.adoc b/README.adoc index 00e7c6ad..3ccdd516 100644 --- a/README.adoc +++ b/README.adoc @@ -53,6 +53,12 @@ footnote:[I don't know why did I put it there but eh...] * `homeManagerModules` are where my link:./modules/home-manager[custom home-manager modules] to be exported. footnote:[This is more useful than my NixOS modules.] +* `templates` which contains my templates. +Though, these are just templates mostly for my own purposes so it is not as useful as the other outputs. + +* `defaultTemplate` which is my go-to template. +Ehhh, same comment as `templates`. + * `devShell` is the development shell for this project. It's just there for convenience purposes. @@ -75,6 +81,7 @@ nixos-config ├── pkgs/ ├── secrets/ ├── shells/ +├── templates/ ├── users/ ├── flake.lock ├── flake.nix @@ -98,6 +105,8 @@ footnote:[It is advised you should minimize SSH keys with passphrases since it i Setting this up can bring benefits outside of NixOS (unless you're interacting with projects with any OpenGL-related stuff). footnote:[Since packages brought from Nix shells can only work with the store, a container might be better at some situations.] +* link:./templates/[`./templates/`] contains my custom templates handy for quickly initializing for various types of projects. + * link:./users/[`./users/`] contains my link:https://github.com/nix-community/home-manager[home-manager] configurations. It is exported in the flakes at `outputs.homeConfigurations`. For more information, see the link:./users/README.adoc[related documentation]. diff --git a/flake.nix b/flake.nix index cbead12c..74ddda3f 100644 --- a/flake.nix +++ b/flake.nix @@ -189,4 +189,15 @@ pkgs = import nixpkgs { inherit system overlays; }; }); }; + + # It is my go-to so it is the default template. + defaultTemplate = self.templates.basic-devshell; + + # Cookiecutter templates for your mama. + templates = { + basic-devshell = { + path = ./templates/basic-devshell; + description = "Basic development shell template"; + }; + }; } diff --git a/templates/basic-devshell/flake.nix b/templates/basic-devshell/flake.nix new file mode 100644 index 00000000..23f86b65 --- /dev/null +++ b/templates/basic-devshell/flake.nix @@ -0,0 +1,15 @@ +{ + description = "Basic flake template for setting up development shells"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: + let systems = inputs.flake-utils.lib.defaultSystems; + in inputs.flake-utils.lib.eachSystem systems (system: { + devShell = + import ./shell.nix { pkgs = import nixpkgs { inherit system; }; }; + }); +} diff --git a/templates/basic-devshell/shell.nix b/templates/basic-devshell/shell.nix new file mode 100644 index 00000000..eb0d07c6 --- /dev/null +++ b/templates/basic-devshell/shell.nix @@ -0,0 +1,5 @@ +{ pkgs ? import { } }: + +with pkgs; + +mkShell { packages = [ ]; }