background code checker for golang

nix: write flake for gust

+110 -2
+4 -1
.gitignore
··· 1 1 *.log 2 2 *.txt 3 - main 3 + gust 4 + .envrc 5 + .direnv 6 + result
cmd/main.go cmd/gust/main.go
+48
flake.lock
··· 1 + { 2 + "nodes": { 3 + "gitignore": { 4 + "inputs": { 5 + "nixpkgs": [ 6 + "nixpkgs" 7 + ] 8 + }, 9 + "locked": { 10 + "lastModified": 1709087332, 11 + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 12 + "owner": "hercules-ci", 13 + "repo": "gitignore.nix", 14 + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 15 + "type": "github" 16 + }, 17 + "original": { 18 + "owner": "hercules-ci", 19 + "repo": "gitignore.nix", 20 + "type": "github" 21 + } 22 + }, 23 + "nixpkgs": { 24 + "locked": { 25 + "lastModified": 1745234285, 26 + "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", 27 + "owner": "nixos", 28 + "repo": "nixpkgs", 29 + "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", 30 + "type": "github" 31 + }, 32 + "original": { 33 + "owner": "nixos", 34 + "ref": "nixos-unstable", 35 + "repo": "nixpkgs", 36 + "type": "github" 37 + } 38 + }, 39 + "root": { 40 + "inputs": { 41 + "gitignore": "gitignore", 42 + "nixpkgs": "nixpkgs" 43 + } 44 + } 45 + }, 46 + "root": "root", 47 + "version": 7 48 + }
+57
flake.nix
··· 1 + { 2 + description = "background code checker for golang projects"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 + gitignore = { 7 + url = "github:hercules-ci/gitignore.nix"; 8 + inputs.nixpkgs.follows = "nixpkgs"; 9 + }; 10 + }; 11 + 12 + outputs = { 13 + self, 14 + nixpkgs, 15 + gitignore, 16 + }: let 17 + supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; 18 + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 19 + nixpkgsFor = forAllSystems (system: 20 + import nixpkgs { 21 + inherit system; 22 + overlays = [self.overlays.default]; 23 + }); 24 + inherit (gitignore.lib) gitignoreSource; 25 + in { 26 + overlays.default = final: prev: let 27 + in { 28 + gust = final.buildGoModule { 29 + pname = "gust"; 30 + version = "0.1.0"; 31 + src = gitignoreSource ./.; 32 + subPackages = ["cmd/gust"]; 33 + vendorHash = "sha256-0+WwkJj/ZovrTrhPL4aimmaBfEgaIEtTt6HYDWzUIFE="; 34 + env.CGO_ENABLED = 0; 35 + }; 36 + }; 37 + packages = forAllSystems (system: {inherit (nixpkgsFor."${system}") gust;}); 38 + defaultPackage = forAllSystems (system: nixpkgsFor.${system}.gust); 39 + formatter = forAllSystems (system: nixpkgsFor."${system}".alejandra); 40 + devShells = forAllSystems (system: let 41 + pkgs = nixpkgsFor.${system}; 42 + staticShell = pkgs.mkShell.override { 43 + stdenv = pkgs.pkgsStatic.stdenv; 44 + }; 45 + in { 46 + default = staticShell { 47 + nativeBuildInputs = [ 48 + pkgs.go 49 + pkgs.gopls 50 + pkgs.gust 51 + pkgs.jujutsu 52 + ]; 53 + CGO_ENABLED = 0; 54 + }; 55 + }); 56 + }; 57 + }
+1 -1
go.mod
··· 7 7 github.com/charmbracelet/bubbletea v1.3.4 8 8 github.com/charmbracelet/lipgloss v1.1.0 9 9 github.com/fsnotify/fsnotify v1.9.0 10 + github.com/muesli/reflow v0.3.0 10 11 ) 11 12 12 13 require ( ··· 22 23 github.com/mattn/go-runewidth v0.0.16 // indirect 23 24 github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect 24 25 github.com/muesli/cancelreader v0.2.2 // indirect 25 - github.com/muesli/reflow v0.3.0 // indirect 26 26 github.com/muesli/termenv v0.16.0 // indirect 27 27 github.com/rivo/uniseg v0.4.7 // indirect 28 28 github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect