Home

tmpls @main - refs - log -
-
https://git.jolheiser.com/tmpls.git
tmpl templates
tree log patch
chore: generic flake Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmWDcjkACgkQuFOtpdp7 v3rnFA/9FdKHmHk9T+jD/nTEWFZnNWI3G3l7lc1Tv3h8Z7PNymR3rdXr9v4DsmxW 1zooJEey2njn2UoeyNB0fwv/r68jF0xsSgM+teT0zhReED6bakNPCDEC7dC2FtC6 6xA+i499AF6Vwx7a1evFbFraCciV2i5jVs6xsI7j1e4L18aWYqNgDiZRnrysSh9f tfP0IIQPJXakpduAAE7mb9IMq0ihqk2e/CCiwbVdqCrlCjWKrMQN4h1kyIPddRYo WnChZ1vOfAe97pjgMQ8ylmZ4u2xgHeOtcJliAPh2PqIv0bbPEP6aTNDW49w3CH4t IWwfI97pdTJpb7Mp0XWX/7f043G0mHQHhbfhJddRma2+V2v8pb9xn7pDSE+UYzaE LsjrxYS+elXdeygYgkZT8IsZJuP1Dqi6wLX9iD1FJ8ssAC/Fmkt1cqgvyeZdjmyY 0lGFfdb+dGw8BjObDoj1paFIZacF8DCWtvhtj9T+1o7jdVpZ8qZU+elE77Whpr9D mzaVaTqubXqnWhK2aVPlsxiMSCzw636klJVypU0HJt4JOqDiCVisIuxd0aGTLpT8 5Gw9zi5a08OcJx39psW1u520v6droqYztReI12CBLXb4LvFkGbtEHJ+HcKMl/Cyz 9YlLCzgZy09TtXbgK6F3GzCdni4PC2LEc/gMaRIBiSG/M92UYHs= =CUfo -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
1 year ago
3 changed files, 49 additions(+), 11 deletions(-)
M README.md -> README.md
diff --git a/README.md b/README.md
index f20cea826294cc905584c3a2d7db32ca10a81577..fe8dd91d00fd721800ff19319b7e078ce86db9fe 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-# devflake
+# flake
 
-Create a simple `flake.nix` for `nix develop`
+Create a simple `flake.nix` for nix.
 
 ## License
 
-[MIT](LICENSE)
\ No newline at end of file
+[MIT](LICENSE)
M template/flake.nix -> template/flake.nix
diff --git a/template/flake.nix b/template/flake.nix
index 80eaa0997ce96a488c44221c59781f8481c7aeea..5f5ac8ae0179cf9cd08a9f1d6271eb6bb8a96a36 100644
--- a/template/flake.nix
+++ b/template/flake.nix
@@ -1,30 +1,55 @@
 {
   inputs = {
+
-    nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
+
-    flake-utils.url = "github:numtide/flake-utils";
-  };
+  inputs.nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
 
   outputs = {
     self,
+    nixpkgs,
+  }: let
+  inputs = {
     flake-utils,
-{
+    nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
-{
+    nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
 {
-{
+    nixpkgs.url = "github:nixos/nixpkgs{{if unstable}}/nixpkgs-unstable{{end}}";
   inputs = {
+      "aarch64-darwin"
+    ];
+  in
+    builtins.map (
       system: let
         pkgs = nixpkgs.legacyPackages.${system};
       in {
+        {{if pname}}
+        packages.${system}.default = pkgs.buildGoModule {
+          pname = {{pname}};
+          version = {{version}};
+    flake-utils.url = "github:numtide/flake-utils";
 {
+          vendorHash = "";
+          meta = with pkgs.lib; {
+            description = "{{description}}";
+            homepage = "{{url}}";
+    flake-utils.url = "github:numtide/flake-utils";
 
+            mainProgram = "{{pname}}";
+          };
+        };
+        {{end}}
+        {{if packages}}
+        devShells.${system}.default = pkgs.mkShell {
           nativeBuildInputs = with pkgs; [
             {{- range $pkg := (splitList "\n" packages)}}
             {{trim $pkg}}
             {{- end}}
           ];
         };
+        {{end}}
       }
+  };
   inputs = {
-    flake-utils.url = "github:numtide/flake-utils";
-  inputs = {
+    systems;
   };
+    flake-utils.url = "github:numtide/flake-utils";
M tmpl.yaml -> tmpl.yaml
diff --git a/tmpl.yaml b/tmpl.yaml
index 965a5d67c1e67a7ee436a6acdd88cc8976b2fd9a..7ae4c08cf8d2e90a354db9b38d62e7c53eb03182 100644
--- a/tmpl.yaml
+++ b/tmpl.yaml
@@ -2,6 +2,19 @@ prompts:
   - id: unstable
     label: Use unstable
     type: confirm
+  - id: pname
+    label: pname
+    help: Program name
+    type: input
+  - id: version
+    label: Version
+    type: input
+  - id: description
+    label: Description
+    type: multi
+  - id: url
+    label: Project URL
+    type: input
   - id: packages
     label: Packages
     help: nixpkgs, one on each line