mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
templates/basic-devshell: create template
This commit is contained in:
parent
4ec3d42741
commit
84d0062ca8
@ -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].
|
||||
|
11
flake.nix
11
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
15
templates/basic-devshell/flake.nix
Normal file
15
templates/basic-devshell/flake.nix
Normal 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; }; };
|
||||
});
|
||||
}
|
5
templates/basic-devshell/shell.nix
Normal file
5
templates/basic-devshell/shell.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
with pkgs;
|
||||
|
||||
mkShell { packages = [ ]; }
|
Loading…
Reference in New Issue
Block a user