Skip to content

Commit

Permalink
fix: nix documentation, CGO typo and flake overlay (#323)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Hesketh <[email protected]>
Co-authored-by: Adrian Hesketh <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2023
1 parent ddb1610 commit 9622ae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/docs/02-quick-start/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This flake exposes an overlay, so you can add it to your own Flake and/or NixOS
inherit system;
pkgs = import nixpkgs { inherit system; };
});
templ = system: inputs.templ.${system}.templ;
templ = system: inputs.templ.packages.${system}.templ;
in {
packages = forAllSystems ({ pkgs, system }): {
myNewPackage = pkgs.buildGoModule {
Expand Down
14 changes: 5 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@
src = gitignore.lib.gitignoreSource ./.;
subPackages = [ "cmd/templ" ];
vendorHash = "sha256-skftApJDp52ZMFf4+jG0sNWK2jIXi3rDQP199suRgNw=";
CGO_ENALBED = 0;

CGO_ENABLED = 0;
flags = [
"-trimpath"
];

ldflags = [
"-s"
"-w"
Expand All @@ -55,7 +53,6 @@
name = "templ-docs";
src = gitignore.lib.gitignoreSource ./docs;
npmDepsHash = "sha256-i6clvSyHtQEGl2C/wcCXonl1W/Kxq7WPTYH46AhUvDM=";

installPhase = ''
mkdir -p $out/share
cp -r build/ $out/share/docs
Expand All @@ -76,10 +73,9 @@
});

# Allows users to install the package on their system in an easy way
overlays.default = final: prev:
forAllSystems ({ system, ... }: {
templ = packages.${system}.templ;
templ-docs = packages.${system}.templ-docs;
});
overlays.default = final: prev: {
templ = self.packages.${final.stdenv.system}.templ;
templ-docs = self.packages.${final.stdenv.system}.templ-docs;
};
};
}

0 comments on commit 9622ae2

Please sign in to comment.