diff --git a/LICENSE b/LICENSE index c46b0ca..56f09ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 John Olheiser +Copyright (c) 2023 John Olheiser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4b65cbd..f20cea8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# tmpl templates +# devflake -Check out the various branches for some basic examples of templates. +Create a simple `flake.nix` for `nix develop` ## License diff --git a/template/.tmplkeep b/template/.tmplkeep deleted file mode 100644 index b4bd1aa..0000000 --- a/template/.tmplkeep +++ /dev/null @@ -1 +0,0 @@ -Delete this file and put something else here! \ No newline at end of file diff --git a/template/flake.nix b/template/flake.nix new file mode 100644 index 0000000..435bab0 --- /dev/null +++ b/template/flake.nix @@ -0,0 +1,25 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + flake-utils, + nixpkgs, + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + {{- range $pkg := (splitList "," packages)}} + {{trim $pkg}} + {{- end}} + ]; + }; + } + ); +} \ No newline at end of file diff --git a/tmpl.yaml b/tmpl.yaml index a259ff0..153d2c9 100644 --- a/tmpl.yaml +++ b/tmpl.yaml @@ -1,11 +1,8 @@ -# tmpl.yaml -# Write any template args here to prompt the user for, giving any defaults/options as applicable - prompts: - - id: name - label: Name - default: MyProject - - id: lang - label: Language - default: Go + - id: unstable + label: Use unstable + help: Blank for stable, non-blank for unstable + - id: packages + label: Packages + help: nixpkgs delimited by comma