fast and minimal static site generator
ssg

nix: setup gomod2nix

+1
.gitignore
··· 1 1 vite 2 2 .env 3 3 .direnv 4 + result
+20
default.nix
··· 1 + { pkgs ? ( 2 + let 3 + inherit (builtins) fetchTree fromJSON readFile; 4 + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; 5 + in 6 + import (fetchTree nixpkgs.locked) { 7 + overlays = [ 8 + (import "${fetchTree gomod2nix.locked}/overlay.nix") 9 + ]; 10 + } 11 + ) 12 + }: 13 + 14 + pkgs.buildGoApplication { 15 + pname = "vite"; 16 + version = "0.1"; 17 + pwd = ./.; 18 + src = ./.; 19 + modules = ./gomod2nix.toml; 20 + }
+75 -6
flake.lock
··· 1 1 { 2 2 "nodes": { 3 + "flake-utils": { 4 + "locked": { 5 + "lastModified": 1678901627, 6 + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", 7 + "owner": "numtide", 8 + "repo": "flake-utils", 9 + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", 10 + "type": "github" 11 + }, 12 + "original": { 13 + "owner": "numtide", 14 + "repo": "flake-utils", 15 + "type": "github" 16 + } 17 + }, 18 + "gomod2nix": { 19 + "inputs": { 20 + "nixpkgs": "nixpkgs", 21 + "utils": "utils" 22 + }, 23 + "locked": { 24 + "lastModified": 1677459247, 25 + "narHash": "sha256-JbakfAiPYmCCV224yAMq/XO0udN5coWv/oazblMKdoY=", 26 + "owner": "nix-community", 27 + "repo": "gomod2nix", 28 + "rev": "3cbf3a51fe32e2f57af4c52744e7228bab22983d", 29 + "type": "github" 30 + }, 31 + "original": { 32 + "owner": "nix-community", 33 + "repo": "gomod2nix", 34 + "type": "github" 35 + } 36 + }, 3 37 "nixpkgs": { 4 38 "locked": { 5 - "lastModified": 1648219316, 6 - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", 39 + "lastModified": 1658285632, 40 + "narHash": "sha256-zRS5S/hoeDGUbO+L95wXG9vJNwsSYcl93XiD0HQBXLk=", 41 + "owner": "NixOS", 42 + "repo": "nixpkgs", 43 + "rev": "5342fc6fb59d0595d26883c3cadff16ce58e44f3", 44 + "type": "github" 45 + }, 46 + "original": { 7 47 "owner": "NixOS", 48 + "ref": "master", 8 49 "repo": "nixpkgs", 9 - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", 50 + "type": "github" 51 + } 52 + }, 53 + "nixpkgs_2": { 54 + "locked": { 55 + "lastModified": 1678898370, 56 + "narHash": "sha256-xTICr1j+uat5hk9FyuPOFGxpWHdJRibwZC+ATi0RbtE=", 57 + "owner": "NixOS", 58 + "repo": "nixpkgs", 59 + "rev": "ac718d02867a84b42522a0ece52d841188208f2c", 10 60 "type": "github" 11 61 }, 12 62 "original": { 13 - "id": "nixpkgs", 14 - "type": "indirect" 63 + "owner": "NixOS", 64 + "ref": "nixos-unstable", 65 + "repo": "nixpkgs", 66 + "type": "github" 15 67 } 16 68 }, 17 69 "root": { 18 70 "inputs": { 19 - "nixpkgs": "nixpkgs" 71 + "flake-utils": "flake-utils", 72 + "gomod2nix": "gomod2nix", 73 + "nixpkgs": "nixpkgs_2" 74 + } 75 + }, 76 + "utils": { 77 + "locked": { 78 + "lastModified": 1653893745, 79 + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", 80 + "owner": "numtide", 81 + "repo": "flake-utils", 82 + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", 83 + "type": "github" 84 + }, 85 + "original": { 86 + "owner": "numtide", 87 + "repo": "flake-utils", 88 + "type": "github" 20 89 } 21 90 } 22 91 },
+20 -14
flake.nix
··· 1 1 { 2 - description = "vite"; 2 + description = "a fast and minimal static site generator"; 3 3 4 - outputs = { self, nixpkgs }: { 5 - devShell.x86_64-linux = 6 - let 7 - pkgs = nixpkgs.legacyPackages.x86_64-linux; 8 - in 9 - pkgs.mkShell { 10 - buildInputs = with pkgs; [ 11 - go 12 - gotools 13 - gnumake 14 - ]; 15 - }; 16 - }; 4 + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 5 + inputs.flake-utils.url = "github:numtide/flake-utils"; 6 + inputs.gomod2nix.url = "github:nix-community/gomod2nix"; 7 + 8 + outputs = { self, nixpkgs, flake-utils, gomod2nix }: 9 + (flake-utils.lib.eachDefaultSystem 10 + (system: 11 + let 12 + pkgs = import nixpkgs { 13 + inherit system; 14 + overlays = [ gomod2nix.overlays.default ]; 15 + }; 16 + 17 + in 18 + { 19 + packages.default = pkgs.callPackage ./. { }; 20 + devShells.default = import ./shell.nix { inherit pkgs; }; 21 + }) 22 + ); 17 23 }
+42
gomod2nix.toml
··· 1 + schema = 3 2 + 3 + [mod] 4 + [mod."git.icyphox.sh/grayfriday"] 5 + version = "v0.0.0-20221126034429-23c704183914" 6 + hash = "sha256-cwTiK30/ZNbp1/R6x/DojxVlgnL0vy3vBiklNJi6wUE=" 7 + [mod."github.com/BurntSushi/toml"] 8 + version = "v0.3.1" 9 + hash = "sha256-Rqak1dE/Aj/+Kx1/pl3Hifgt+Q3OzuZ5fJR+/x3nTbo=" 10 + [mod."github.com/adrg/frontmatter"] 11 + version = "v0.2.0" 12 + hash = "sha256-WJsVcdCpkIkjqUz5fJOFStZYwQlrcFzQ6+mZatZiimo=" 13 + [mod."github.com/alecthomas/chroma"] 14 + version = "v0.10.0" 15 + hash = "sha256-p721vddVTv4iv1O0/dqpdk5xF6x9iLIHcrfh8JEVnqQ=" 16 + [mod."github.com/davecgh/go-spew"] 17 + version = "v1.1.1" 18 + hash = "sha256-nhzSUrE1fCkN0+RL04N4h8jWmRFPPPWbCuDc7Ss0akI=" 19 + [mod."github.com/dlclark/regexp2"] 20 + version = "v1.4.0" 21 + hash = "sha256-Pk/S2x2rX7xnGFLyoHEw09CoNQimvz/msdPRsxLaLsc=" 22 + [mod."github.com/pmezard/go-difflib"] 23 + version = "v1.0.0" 24 + hash = "sha256-/FtmHnaGjdvEIKAJtrUfEhV7EVo5A/eYrtdnUkuxLDA=" 25 + [mod."github.com/stretchr/objx"] 26 + version = "v0.1.0" 27 + hash = "sha256-az0Vd4MG3JXfaYbj0Q6AOmNkrXgmXDeQm8+BBiDXmdA=" 28 + [mod."github.com/stretchr/testify"] 29 + version = "v1.7.0" 30 + hash = "sha256-t1I9uCrn9vSUu/z5IZuNyGShmbOcJ6UGc2f75ZBrHzE=" 31 + [mod."gopkg.in/check.v1"] 32 + version = "v0.0.0-20161208181325-20d25e280405" 33 + hash = "sha256-1w5mgYaZUC52uzDnpXXVqle/9AVkH4WePSrQFOVANUw=" 34 + [mod."gopkg.in/yaml.v2"] 35 + version = "v2.3.0" 36 + hash = "sha256-8tPC5nMGvUFs97W6+JXsxJLjU6EpDmPG9tXo1DyFoNU=" 37 + [mod."gopkg.in/yaml.v3"] 38 + version = "v3.0.0-20210107192922-496545a6307b" 39 + hash = "sha256-j8yDji+vqsitpRZirpb4w/Em8nstgf28wpwkcrOlxBk=" 40 + [mod."icyphox.sh/grayfriday"] 41 + version = "v0.0.0-20221130034322-1ea518786419" 42 + hash = "sha256-+mS2SbGUSAtgo9sOlpldHrH23AiBT+2OosRz44pDqbg="
+22
shell.nix
··· 1 + { pkgs ? ( 2 + let 3 + inherit (builtins) fetchTree fromJSON readFile; 4 + inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix; 5 + in 6 + import (fetchTree nixpkgs.locked) { 7 + overlays = [ 8 + (import "${fetchTree gomod2nix.locked}/overlay.nix") 9 + ]; 10 + } 11 + ) 12 + }: 13 + 14 + let 15 + goEnv = pkgs.mkGoEnv { pwd = ./.; }; 16 + in 17 + pkgs.mkShell { 18 + packages = [ 19 + goEnv 20 + pkgs.gomod2nix 21 + ]; 22 + }