about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-05-27 16:49:13 +0200
committerSoispha <soispha@vhack.eu>2023-05-27 16:49:13 +0200
commit826be31fa74fa5cd0badea00207512e4ab1d00e1 (patch)
tree99b3d4632c67bd4268b484fb0d5e5e65c8b446c2
parentFeat(shell): Init (diff)
downloadflake-templates-826be31fa74fa5cd0badea00207512e4ab1d00e1.tar.gz
flake-templates-826be31fa74fa5cd0badea00207512e4ab1d00e1.zip
Fix(flake): Add the templates to the outputs
-rw-r--r--flake.lock64
-rw-r--r--flake.nix62
2 files changed, 115 insertions, 11 deletions
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..4a21b43
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,64 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "inputs": {
+        "systems": [
+          "systems"
+        ]
+      },
+      "locked": {
+        "lastModified": 1681202837,
+        "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1685012353,
+        "narHash": "sha256-U3oOge4cHnav8OLGdRVhL45xoRj4Ppd+It6nPC9nNIU=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "aeb75dba965e790de427b73315d5addf91a54955",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixpkgs-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs",
+        "systems": "systems"
+      }
+    },
+    "systems": {
+      "locked": {
+        "lastModified": 1680978846,
+        "narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
+        "owner": "nix-systems",
+        "repo": "x86_64-linux",
+        "rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "x86_64-linux",
+        "type": "github"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
index dfb50da..6d63eb8 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,17 +1,57 @@
-# vim: ts=2
 {
-  description = "A collection of nix flake templates for diffrent languages";
+  description = "A collection of nix flake templates";
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
 
-  outputs = {self}: {
-    templates.rust = {
-      path = ./rust;
-      description = "A simple Rust/Cargo project";
-      welcomeText = "";
+    flake-utils = {
+      url = "github:numtide/flake-utils";
+      inputs = {
+        systems.follows = "systems";
+      };
     };
-    templates.rustToolchain = {
-      path = ./rust/toolchain.nix;
-      description = "A simple Rust/Cargo project with a diffrent toolchain";
-      welcomeText = "";
+
+    systems = {
+      url = "github:nix-systems/x86_64-linux"; # only evaluate for this system
     };
   };
+
+  outputs = {
+    nixpkgs,
+    flake-utils,
+    ...
+  }:
+    flake-utils.lib.eachDefaultSystem (system: let
+      pkgs = nixpkgs.legacyPackages."${system}";
+    in {
+      templates = {
+        rust = {
+          path = ./rust;
+          description = "A Rust/Crane project";
+          welcomeText = "Please customize the text in the flake.nix and LICENSE.spdx files; Look at the TODO marks.\n Also run `git init`, `cargo init` and `cog install-hook commit-msg`";
+        };
+        awk = {
+          path = ./awk;
+          description = "An Awk project";
+          welcomeText = "Please customize the text in the flake.nix and LICENSE.spdx files; Look at the TODO marks.\n Also run `git init` and `cog install-hook commit-msg`";
+        };
+        shell = {
+          path = ./shell;
+          description = "A Shell project";
+          welcomeText = "Please customize the text in the flake.nix and LICENSE.spdx files; Look at the TODO marks.\n Also run `git init` and `cog install-hook commit-msg`";
+        };
+      };
+
+      devShells.default = pkgs.mkShell {
+        packages = with pkgs; [
+          nil
+          alejandra
+          statix
+          ltex-ls
+          cocogitto
+        ];
+      };
+    });
 }
+# vim: ts=2
+