From ad876c75f0b5b0449885d8dca8caa4e1c5daa402 Mon Sep 17 00:00:00 2001 From: C4 Patino Date: Sun, 14 Sep 2025 23:14:15 -0500 Subject: [PATCH] feat: added devshell default input template for nix projects --- flake.nix | 1 + templates/devshell/flake.nix | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 templates/devshell/flake.nix diff --git a/flake.nix b/flake.nix index 6bd44e3..657f4ec 100755 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,7 @@ alias = { shells.default = "yumeami"; + templates.default = "devshell"; }; }; } diff --git a/templates/devshell/flake.nix b/templates/devshell/flake.nix new file mode 100644 index 0000000..95b06cc --- /dev/null +++ b/templates/devshell/flake.nix @@ -0,0 +1,43 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05"; + flake-utils.url = "github:numtide/flake-utils"; + treefmt-nix.url = "github:numtide/treefmt-nix"; + }; + outputs = { + flake-utils, + nixpkgs, + treefmt-nix, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs {inherit system;}; + + treefmtConfig = {...}: { + projectRootFile = "flake.nix"; + programs = { + alejandra.enable = true; + }; + }; + + treefmtEval = treefmt-nix.lib.evalModule pkgs (treefmtConfig {inherit pkgs;}); + in { + formatter = treefmtEval.config.build.wrapper; + + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + ]; + + buildInputs = with pkgs; [ + ]; + + packages = with pkgs; [ + ]; + + shellHook = '' + ''; + }; + } + ); +}