web frontend for git repositories, written in Go git.pocka.jp/legit.git
3

Configure Feed

Select the types of activity you want to include in your feed.

Format .nix files with nixfmt

Shota FUJI (Jul 11, 2026, 9:23 PM +0900) 74ed6804 d3443fb7

+49 -27
+4
dprint.jsonc
··· 28 28 "command": "gofmt", 29 29 "exts": ["go"], 30 30 }, 31 + { 32 + "command": "nixfmt --strict --width={{line_width}} --indent={{indent_width}}", 33 + "exts": ["nix"], 34 + }, 31 35 ], 32 36 }, 33 37
+45 -27
flake.nix
··· 4 4 inputs.nixpkgs.url = "github:nixos/nixpkgs"; 5 5 6 6 outputs = 7 - { self 8 - , nixpkgs 9 - , 10 - }: 7 + { self, nixpkgs }: 11 8 let 12 - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; 9 + supportedSystems = [ 10 + "x86_64-linux" 11 + "x86_64-darwin" 12 + "aarch64-linux" 13 + "aarch64-darwin" 14 + ]; 13 15 forAllSystems = nixpkgs.lib.genAttrs supportedSystems; 14 16 nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); 15 17 in 16 18 { 17 - packages = forAllSystems (system: 19 + packages = forAllSystems ( 20 + system: 18 21 let 19 22 pkgs = nixpkgsFor.${system}; 20 23 legit = self.packages.${system}.legit; ··· 38 41 docker = pkgs.dockerTools.buildLayeredImage { 39 42 name = "sini:5000/legit"; 40 43 tag = "latest"; 41 - contents = [ files legit pkgs.git ]; 44 + contents = [ 45 + files 46 + legit 47 + pkgs.git 48 + ]; 42 49 config = { 43 50 Entrypoint = [ "${legit}/bin/legit" ]; 44 - ExposedPorts = { "5555/tcp" = { }; }; 51 + ExposedPorts = { 52 + "5555/tcp" = { }; 53 + }; 45 54 }; 46 55 }; 47 - }); 56 + } 57 + ); 48 58 49 - formatter = forAllSystems (system: 50 - let 51 - pkgs = nixpkgsFor.${system}; 52 - in 53 - pkgs.buildFHSEnv { 54 - name = "fhs-dprint"; 55 - targetPkgs = 56 - pkgs: with pkgs; [ 57 - # Formatter frontend. 58 - # https://dprint.dev/ 59 - dprint 59 + formatter = forAllSystems ( 60 + system: 61 + let 62 + pkgs = nixpkgsFor.${system}; 63 + in 64 + pkgs.buildFHSEnv { 65 + name = "fhs-dprint"; 66 + targetPkgs = 67 + pkgs: with pkgs; [ 68 + # Formatter frontend. 69 + # https://dprint.dev/ 70 + dprint 60 71 61 - # For "gofmt" command. 62 - go 63 - ]; 64 - runScript = "dprint fmt"; 65 - }); 72 + # > Official formatter for Nix code 73 + # https://github.com/NixOS/nixfmt 74 + nixfmt 75 + 76 + # For "gofmt" command. 77 + go 78 + ]; 79 + runScript = "dprint fmt"; 80 + } 81 + ); 66 82 67 83 defaultPackage = forAllSystems (system: self.packages.${system}.legit); 68 - devShells = forAllSystems (system: 84 + devShells = forAllSystems ( 85 + system: 69 86 let 70 87 pkgs = nixpkgsFor.${system}; 71 88 in ··· 76 93 gopls 77 94 ]; 78 95 }; 79 - }); 96 + } 97 + ); 80 98 }; 81 99 }