templates/basic-devshell: create template

This commit is contained in:
Gabriel Arazas 2022-01-25 09:28:10 +08:00
parent 4ec3d42741
commit 84d0062ca8
4 changed files with 40 additions and 0 deletions

View File

@ -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].

View File

@ -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";
};
};
}

View File

@ -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; }; };
});
}

View File

@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell { packages = [ ]; }