diff --git a/flake.nix b/flake.nix index db2d00c..e5477e4 100644 --- a/flake.nix +++ b/flake.nix @@ -85,6 +85,10 @@ # Templates for starting other projects quickly templates = { + basic = { + path = ./templates/basic; + description = "Basic program template"; + }; poetry = { path = ./templates/poetry; description = "Poetry template"; diff --git a/templates/basic/.envrc b/templates/basic/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/basic/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/basic/flake.lock b/templates/basic/flake.lock new file mode 100644 index 0000000..0adf65d --- /dev/null +++ b/templates/basic/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1659803779, + "narHash": "sha256-+5zkHlbcbFyN5f3buO1RAZ9pH1wXLxCesUJ0vFmLr9Y=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f44884060cb94240efbe55620f38a8ec8d9af601", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/templates/basic/flake.nix b/templates/basic/flake.nix new file mode 100644 index 0000000..edfb050 --- /dev/null +++ b/templates/basic/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Basic project"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + outputs = { self, nixpkgs }: + let + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" + ]; + in { + devShells = forAllSystems (system: + let pkgs = import nixpkgs { inherit system; }; + in { + default = pkgs.mkShell { buildInputs = with pkgs; [ nixfmt ]; }; + }); + }; +}