diff --git a/flake.lock b/flake.lock index 4d5223c..9d194b5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "indigo": { + "flake": false, + "locked": { + "lastModified": 1738055559, + "narHash": "sha256-wsey8gs825Tm9Q3zITqg4B6TmHCDuV9vyQlXEnD/7/I=", + "owner": "oppiliappan", + "repo": "indigo", + "rev": "9b475b7509c21b98b6ccd97c6d3f2e8d8ea3eae0", + "type": "github" + }, + "original": { + "owner": "oppiliappan", + "repo": "indigo", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1737753923, @@ -17,6 +33,7 @@ }, "root": { "inputs": { + "indigo": "indigo", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 25a3ad9..cc3c7cb 100644 --- a/flake.nix +++ b/flake.nix @@ -3,21 +3,40 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; - + indigo = { + url = "github:oppiliappan/indigo"; + flake = false; + }; }; outputs = { self, nixpkgs, + indigo, }: let supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; + overlays = [self.overlays.default]; }); in { - defaultPackage = forAllSystems (system: self.packages.${system}.legit); + overlays.default = final: prev: { + indigo-lexgen = with final; + final.buildGoModule { + pname = "indigo-lexgen"; + version = "0.1.0"; + src = indigo; + subPackage = ["cmd/lexgen"]; + vendorHash = null; + doCheck = false; + }; + }; + packages = forAllSystems (system: { + inherit (nixpkgsFor."${system}") indigo-lexgen; + }); + defaultPackage = forAllSystems (system: nixpkgsFor.${system}.indigo-lexgen); formatter = forAllSystems (system: nixpkgsFor."${system}".alejandra); devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; @@ -29,6 +48,7 @@ pkgs.templ pkgs.gopls pkgs.httpie + pkgs.indigo-lexgen ]; }; }); diff --git a/routes/routes.go b/routes/routes.go index e33483a..8968e82 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -512,6 +512,7 @@ func (h *Handle) Keys(w http.ResponseWriter, r *http.Request) { func (h *Handle) NewRepo(w http.ResponseWriter, r *http.Request) { session, _ := h.s.Get(r, "bild-session") did := session.Values["did"].(string) + handle := session.Values["handle"].(string) switch r.Method { case http.MethodGet: @@ -523,7 +524,7 @@ func (h *Handle) NewRepo(w http.ResponseWriter, r *http.Request) { name := r.FormValue("name") description := r.FormValue("description") - err := git.InitBare(filepath.Join(h.c.Repo.ScanPath, "example.com", name)) + err := git.InitBare(filepath.Join(h.c.Repo.ScanPath, handle, name)) if err != nil { h.WriteOOBNotice(w, "repo", "Error creating repo. Try again later.") return