diff options
| author | Charlie Groves <charlie.groves@gmail.com> | 2022-05-08 22:18:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-08 22:18:17 -0400 |
| commit | c07ac3b6c05ada77749ba2ed97c7112bda9d80c8 (patch) | |
| tree | 94abe8c4556a9745256d3c36523ace2a6cec6368 /blog | |
| parent | 06d4bf7d69e7f58f51c49e6f3a712c50412b7ceb (diff) | |
| download | xesite-c07ac3b6c05ada77749ba2ed97c7112bda9d80c8.tar.xz xesite-c07ac3b6c05ada77749ba2ed97c7112bda9d80c8.zip | |
Fix examples to work with Nix >= 2.7 (#467)
Diffstat (limited to 'blog')
| -rw-r--r-- | blog/nix-flakes-1-2022-02-21.markdown | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/blog/nix-flakes-1-2022-02-21.markdown b/blog/nix-flakes-1-2022-02-21.markdown index e28ec80..ae189e3 100644 --- a/blog/nix-flakes-1-2022-02-21.markdown +++ b/blog/nix-flakes-1-2022-02-21.markdown @@ -207,12 +207,12 @@ Let's take a closer look at the higher level things in the flake: your `flake.nix`. Ditto with "flake input" referring to the `inputs` attribute of your `flake.nix`.](conversation://Cadey/enby) -When you ran `nix build` earlier, it defaulted to building the package in -`defaultPackage`. You can also build the `go-hello` package by running this +When you ran `nix build` earlier, it defaulted to building the `default` entry +in `packages`. You can also build the `default` package by running this command: ```console -$ nix build .#go-hello +$ nix build .#default ``` And if you want to build the copy I made for this post: @@ -234,11 +234,13 @@ simplify that above `nix build` and `./result/bin/go-hello` cycle into a single `go-hello` to be the default app: ```nix -# below defaultPackage +# below packages -defaultApp = forAllSystems (system: { - type = "app"; - program = "${self.packages.${system}.go-hello}/bin/go-hello"; +apps = forAllSystems (system: { + default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/go-hello"; + }; }); ``` @@ -281,8 +283,10 @@ can add it to your `flake.nix` using this: devShell = forAllSystems (system: let pkgs = nixpkgsFor.${system}; - in pkgs.mkShell { - buildInputs = with pkgs; [ go gopls goimports go-tools ]; + in { + default = pkgs.mkShell { + buildInputs = with pkgs; [ go gopls gotools go-tools ]; + }; }); ``` |
