diff --git a/.gitignore b/.gitignore index 74b54fa6e..d25932721 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,21 @@ -cmd/example/*.go -dist/ +# Output. cmd/templ/templ + +# Logs. cmd/templ/lspcmd/*log.txt -.DS_Store + +# Go code coverage. coverage.out coverage + +# Mac filesystem jank. +.DS_Store + +# Docusaurus. docs/build/ docs/resources/_gen/ node_modules/ +dist/ + +# Nix artifacts. +result diff --git a/README.md b/README.md index cacbe6fd1..b22d4d35b 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,6 @@ See user documentation at https://templ.guide ## Tasks -### nix-develop - -Run a Nix shell that contains everything required to build templ. - -```sh -nix develop --impure -``` - ### build Build a local version. diff --git a/flake.lock b/flake.lock index 7ae13ac57..6a9503f19 100644 --- a/flake.lock +++ b/flake.lock @@ -1,185 +1,45 @@ { "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "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" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "neovim-flake": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" - }, - "locked": { - "dir": "contrib", - "lastModified": 1680866789, - "narHash": "sha256-4uCPWnjSMU7ac6Q3LT+Em8lVk1MuSegxHMLGQRtFqAs=", - "owner": "neovim", - "repo": "neovim", - "rev": "040f1459849ab05b04f6bb1e77b3def16b4c2f2b", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, - "neovim-nightly-overlay": { + "gitignore": { "inputs": { - "flake-compat": "flake-compat", - "neovim-flake": "neovim-flake", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1682237548, - "narHash": "sha256-7bXfvT8S2O+aqIfLsDk7eTQjX4JrchHh7TyqGCA5zPI=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "3594ebd0f70ebc4553bb9e16accb1fd868dc3125", + "lastModified": 1694102001, + "narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", + "owner": "hercules-ci", + "repo": "gitignore.nix", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1681920287, - "narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=", - "owner": "nixos", + "lastModified": 1694422566, + "narHash": "sha256-lHJ+A9esOz9vln/3CJG23FV6Wd2OoOFbDeEs4cMGMqc=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", + "rev": "3a2786eea085f040a66ecde1bc3ddc7099f6dbeb", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1681932375, - "narHash": "sha256-tSXbYmpnKSSWpzOrs27ie8X3I0yqKA6AuCzCYNtwbCU=", "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", - "rev": "3d302c67ab8647327dba84fbdb443cdbf0e82744", "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-22.11", - "type": "indirect" } }, "root": { "inputs": { - "flake-utils": "flake-utils", - "neovim-nightly-overlay": "neovim-nightly-overlay", - "nixpkgs": "nixpkgs_2", - "xc": "xc" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "xc": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1681392057, - "narHash": "sha256-jBOf1n6NfA9S9NjD3moMNiRBs1/I0lEMqTsflha/QuE=", - "owner": "joerdav", - "repo": "xc", - "rev": "feb8b4fad05f5139ba997af4aafa0ff44efb31ad", - "type": "github" - }, - "original": { - "owner": "joerdav", - "repo": "xc", - "type": "github" + "gitignore": "gitignore", + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index ea3f5ff45..666ba10d2 100644 --- a/flake.nix +++ b/flake.nix @@ -1,65 +1,37 @@ { + description = "templ"; + inputs = { - flake-utils.url = "github:numtide/flake-utils"; - nixpkgs.url = "nixpkgs/nixos-22.11"; - xc = { - url = "github:joerdav/xc"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - neovim-nightly-overlay = { - url = "github:nix-community/neovim-nightly-overlay"; + nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; + gitignore = { + url = "github:hercules-ci/gitignore.nix"; inputs.nixpkgs.follows = "nixpkgs"; - # Neovim 0.9.0 - inputs.neovim-flake.url = "github:neovim/neovim?dir=contrib&rev=040f1459849ab05b04f6bb1e77b3def16b4c2f2b"; }; }; - outputs = { self, flake-utils, nixpkgs, xc, neovim-nightly-overlay }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgsDefault = import nixpkgs { overlays = [ neovim-nightly-overlay.overlay ]; }; - pkgs = import nixpkgs { - inherit system; overlays = [ - (self: super: { - xc = xc.packages.${system}.xc; - neovim = import ./nix/nvim.nix { pkgs = pkgsDefault; }; - gopls = pkgs.callPackage ./nix/gopls.nix { }; - templ = pkgs.callPackage ./nix/templ.nix { - go = pkgs.go_1_20; - xc = self.xc; - }; - nerdfonts = (pkgsDefault.nerdfonts.override { fonts = [ "IBMPlexMono" ]; }); - }) - ]; - }; - shell = pkgs.mkShell { - packages = [ - pkgs.asciinema - pkgs.git - pkgs.go - pkgs.gopls - pkgs.gotools - pkgs.ibm-plex - pkgs.neovim - pkgs.nerdfonts - pkgs.ripgrep - pkgs.silver-searcher - pkgs.templ - pkgs.tmux - pkgs.wget - pkgs.xc - pkgs.zip - ]; - }; + outputs = { self, nixpkgs, gitignore }: + let + # Systems supported + allSystems = [ + "x86_64-linux" # 64-bit Intel/AMD Linux + "aarch64-linux" # 64-bit ARM Linux + "x86_64-darwin" # 64-bit Intel macOS + "aarch64-darwin" # 64-bit ARM macOS + ]; + + # Helper to provide system-specific attributes + forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { + pkgs = import nixpkgs { inherit system; }; + }); in - { - defaultPackage = pkgs.templ; - packages = { - templ = pkgs.templ; - }; - devShells = { - default = shell; + { + packages = forAllSystems ({ pkgs }: { + default = pkgs.buildGoModule { + name = "templ"; + src = gitignore.lib.gitignoreSource ./.; + subPackages = [ "./cmd/templ" ]; + vendorSha256 = "sha256-7QYF8BvLpTcDstkLWxR0BgBP0NUlJ20IqW/nNqMSBn4="; }; - } - ); + }); + }; } diff --git a/nix/.config/nvim/lua/goimports.lua b/nix/.config/nvim/lua/goimports.lua deleted file mode 100644 index c81e2fa40..000000000 --- a/nix/.config/nvim/lua/goimports.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Autoformat Go files on save and add goimports style fix-up. --- See https://github.com/neovim/nvim-lspconfig/issues/115 - -vim.api.nvim_create_autocmd('BufWritePre', { - pattern = '*.go', - callback = function() - vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true }) - end -}) diff --git a/nix/.config/nvim/lua/init.lua b/nix/.config/nvim/lua/init.lua deleted file mode 100644 index 8d7ff9aa1..000000000 --- a/nix/.config/nvim/lua/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('goimports') -require('lsp') -require('settings') -require('theme') -require('treesitter') diff --git a/nix/.config/nvim/lua/lsp.lua b/nix/.config/nvim/lua/lsp.lua deleted file mode 100644 index 66cc3788e..000000000 --- a/nix/.config/nvim/lua/lsp.lua +++ /dev/null @@ -1,158 +0,0 @@ -local nvim_lsp = require('lspconfig') - --- https://github.com/ray-x/lsp_signature.nvim -local lsp_signature_cfg = { - hint_prefix = '', - handler_opts = { - border = "none" - }, - padding = ' ' -} -require 'lsp_signature'.setup(lsp_signature_cfg) -- no need to specify bufnr if you don't use toggle_key - --- Format on save. -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] - --- Mappings. -local opts = { noremap = true, silent = true } - -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - --Enable completion triggered by - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - - buf_set_keymap('n', 'f', 'lua vim.lsp.buf.format { async = true }', opts) - buf_set_keymap('n', 'clr', 'lua vim.lsp.codelens.refresh()', opts) - buf_set_keymap('n', 'cln', 'lua vim.lsp.codelens.run()', opts) - -- TypeScript organise imports. - buf_set_keymap('n', 'tsoi', - 'lua vim.lsp.buf.execute_command({command = "_typescript.organizeImports", arguments = {vim.fn.expand("%:p")}})' - , opts) - buf_set_keymap('n', 'tsf', 'EslintFixAll', opts) -end - --- Add templ configuration. -local configs = require('lspconfig.configs') -configs.templ = { - default_config = { - cmd = { "templ", "lsp", "-http=localhost:7474", "-log=/templ-lsp.log" }, - filetypes = { 'templ' }, - root_dir = nvim_lsp.util.root_pattern("go.mod", ".git"), - settings = {}, - }; -} - --- Add additional capabilities supported by nvim-cmp -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -local server_settings = { - gopls = { - gopls = { - codelenses = { - generate = true, -- show the `go generate` lens. - gc_details = true, -- show a code lens toggling the display of gc's choices. - test = true, - upgrade_dependency = true, - tidy = true, - }, - }, - }, - tsserver = { - format = { enable = false }, - }, - eslint = { - enable = true, - format = { enable = true }, -- this will enable formatting - packageManager = "npm", - autoFixOnSave = true, - codeActionOnSave = { - mode = "all", - rules = { "!debugger", "!no-only-tests/*" }, - }, - lintTask = { - enable = true, - }, - }, -} - - --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches --- eslint comes from: --- npm i -g vscode-langservers-extracted -local servers = { 'gopls', 'tsserver', 'templ', 'eslint' } -for _, lsp in ipairs(servers) do - local lsp_opts = { - on_attach = on_attach, - capabilities = capabilities, - } - if server_settings[lsp] then lsp_opts.settings = server_settings[lsp] end - nvim_lsp[lsp].setup(lsp_opts) -end ---vim.lsp.set_log_level("debug") --- Use :LspLog to see logs. - --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menuone,noselect' - --- nvim-cmp setup -local cmp = require 'cmp' -cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - end, - }, - window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, - }, { - { name = 'buffer' }, - }) -}) - --- https://github.com/samhh/dotfiles/blob/ba63ff91a33419dfb08e412a7d832b2aca38148c/home/.config/nvim/plugins.vim#L151 -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - { - virtual_text = false, - signs = true, - update_in_insert = false, - underline = true, - } -) diff --git a/nix/.config/nvim/lua/settings.lua b/nix/.config/nvim/lua/settings.lua deleted file mode 100644 index 9a535cef8..000000000 --- a/nix/.config/nvim/lua/settings.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.opt.autoindent = true -vim.opt.encoding = "utf-8" -vim.opt.fileencoding = "utf-8" -vim.opt.tabstop = 2 - --- Set termguicolors to enable highlight groups. -vim.opt.termguicolors = true - --- Move the preview screen. -vim.opt.splitbelow = true - --- Make it so that the gutter (left column) doesn't move. -vim.opt.signcolumn = "yes" - --- Set line numbers to be visible all of the time. -vim.opt.number = true - --- Disable mouse control. -vim.cmd("set mouse=") - --- Use system clipboard. ---vim.api.nvim_command('set clipboard+=unnamedplus') diff --git a/nix/.config/nvim/lua/theme.lua b/nix/.config/nvim/lua/theme.lua deleted file mode 100644 index a6817f0f6..000000000 --- a/nix/.config/nvim/lua/theme.lua +++ /dev/null @@ -1,24 +0,0 @@ --- Set colors. --- To find available colours to set, use `:hi ` to search through --- available colours. -local dracula = require("dracula") -dracula.setup({ - -- set custom lualine background color - lualine_bg_color = "#44475a", -- default nil - transparent_bg = true, - -- overrides the default highlights see `:h synIDattr` - overrides = { - -- Examples - -- NonText = { fg = dracula.colors().white }, -- set NonText fg to white - -- NvimTreeIndentMarker = { link = "NonText" }, -- link to NonText highlight - -- Nothing = {} -- clear highlight of Nothing - ['@type.builtin'] = { - fg = dracula.colors().cyan, - italic = false, - }, - }, -}) -vim.cmd [[colorscheme dracula]] - --- Floating window. -vim.cmd [[hi Pmenu guibg=NONE]] diff --git a/nix/.config/nvim/lua/treesitter.lua b/nix/.config/nvim/lua/treesitter.lua deleted file mode 100644 index da21056f5..000000000 --- a/nix/.config/nvim/lua/treesitter.lua +++ /dev/null @@ -1,5 +0,0 @@ -require('nvim-treesitter.configs').setup { - highlight = { - enable = true, - }, -} diff --git a/nix/gopls.nix b/nix/gopls.nix deleted file mode 100644 index 6fcbc49ec..000000000 --- a/nix/gopls.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ lib, buildGoModule, fetchFromGitHub }: - -buildGoModule rec { - pname = "gopls"; - version = "0.10.1"; - - src = fetchFromGitHub { - owner = "golang"; - repo = "tools"; - rev = "8321f7bbcfd30300762661ed9188226b42e27ec1"; - sha256 = "9WDqd8Xgiov/OFAFl5yZmon4o3grbOxzZs3wnNu7pbg="; - }; - - vendorSha256 = "EZ/XPta2vQfemywoC2kbTamJ43K4tr4I7mwVzrTbRkA="; - modRoot = "gopls"; - - subPackages = [ "." ]; - - meta = with lib; { - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/nix/nix.conf b/nix/nix.conf deleted file mode 100644 index 047d0e825..000000000 --- a/nix/nix.conf +++ /dev/null @@ -1,4 +0,0 @@ -experimental-features = nix-command flakes -build-users-group = nixbld -sandbox = false -trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= diff --git a/nix/nvim.nix b/nix/nvim.nix deleted file mode 100644 index f48a984f9..000000000 --- a/nix/nvim.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ pkgs, ... }: - -let - pluginGit = owner: repo: ref: sha: pkgs.vimUtils.buildVimPluginFrom2Nix { - pname = "${repo}"; - version = ref; - src = pkgs.fetchFromGitHub { - owner = owner; - repo = repo; - rev = ref; - sha256 = sha; - }; - }; - # See list of grammars. - # https://github.com/NixOS/nixpkgs/blob/c4fcf9a2cc4abde8a2525691962b2df6e7327bd3/pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix - nvim-treesitter-with-plugins = pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ - p.go - p.gomod - p.javascript - p.json - p.nix - p.html - p.tsx - p.typescript - p.yaml - p.dockerfile - ]); -in - pkgs.neovim.override { - vimAlias = true; - configure = { - packages.myPlugins = with pkgs.vimPlugins; { - start = [ - (pluginGit "Mofiqul" "dracula.nvim" "a0b129d7dea51b317fa8064f13b29f68004839c4" "snCRLw/QtKPDAkh1CXZfto2iCoyaQIx++kOEC0vy9GA=") - # Tressiter syntax highlighting. - nvim-treesitter-with-plugins - # Templ highlighting. - (pluginGit "Joe-Davidson1802" "templ.vim" "2d1ca014c360a46aade54fc9b94f065f1deb501a" "1bc3p0i3jsv7cbhrsxffnmf9j3zxzg6gz694bzb5d3jir2fysn4h") - # Configure autocomplete. - (pluginGit "neovim" "nvim-lspconfig" "cf95480e876ef7699bf08a1d02aa0ae3f4d5f353" "mvDg+aT5lldqckQFpbiBsXjnwozzjKf+v3yBEyvcVLo=") - # Add function signatures to autocomplete. - (pluginGit "ray-x" "lsp_signature.nvim" "1fdc742af68f4725a22c05c132f971143be447fc" "DITo8Sp/mcOPhCTcstmpb1i+mUc5Ao8PEP5KYBO8Xdg=") - # Configure autocomplete. - (pluginGit "hrsh7th" "nvim-cmp" "777450fd0ae289463a14481673e26246b5e38bf2" "CoHGIiZrhRAHZ/Er0JSQMapI7jwllNF5OysLlx2QEik=") - (pluginGit "hrsh7th" "vim-vsnip" "7753ba9c10429c29d25abfd11b4c60b76718c438" "ehPnvGle7YrECn76YlSY/2V7Zeq56JGlmZPlwgz2FdE=") - (pluginGit "hrsh7th" "cmp-nvim-lsp" "0e6b2ed705ddcff9738ec4ea838141654f12eeef" "DxpcPTBlvVP88PDoTheLV2fC76EXDqS2UpM5mAfj/D4=") - ]; - opt = [ ]; - }; - customRC = "lua require('init')"; - }; - } diff --git a/nix/run.sh b/nix/run.sh deleted file mode 100755 index fb14d2374..000000000 --- a/nix/run.sh +++ /dev/null @@ -1 +0,0 @@ -docker run -v `pwd`/nix.conf:/etc/nix/nix.conf -v `pwd`:/conf -it --rm templ-neovim diff --git a/nix/templ-install.sh b/nix/templ-install.sh deleted file mode 100755 index 987355182..000000000 --- a/nix/templ-install.sh +++ /dev/null @@ -1,11 +0,0 @@ -# Create the standard environment. -source $stdenv/setup -# Go requires a cache directory so let's point it at one. -mkdir -p /tmp/go-cache -export GOCACHE=$TMPDIR/go-cache -export GOMODCACHE=$TMPDIR/go-cache -# Build the source code. -cd $src/cmd/templ -# Build the templ binary and output it. -mkdir -p $out/bin -go build -o $out/bin/templ diff --git a/nix/templ.nix b/nix/templ.nix deleted file mode 100644 index f1ca0d1f9..000000000 --- a/nix/templ.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, stdenv, go, xc }: - -stdenv.mkDerivation { - pname = "templ"; - version = "devel"; - src = ./..; - builder = ./templ-install.sh; - system = builtins.currentSystem; - nativeBuildInputs = [ go xc ]; -} -