forked from cadey/xesite
Fix examples to work with Nix >= 2.7 (#467)
This commit is contained in:
parent
06d4bf7d69
commit
c07ac3b6c0
|
@ -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
|
your `flake.nix`. Ditto with "flake input" referring to the `inputs` attribute
|
||||||
of your `flake.nix`.](conversation://Cadey/enby)
|
of your `flake.nix`.](conversation://Cadey/enby)
|
||||||
|
|
||||||
When you ran `nix build` earlier, it defaulted to building the package in
|
When you ran `nix build` earlier, it defaulted to building the `default` entry
|
||||||
`defaultPackage`. You can also build the `go-hello` package by running this
|
in `packages`. You can also build the `default` package by running this
|
||||||
command:
|
command:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix build .#go-hello
|
$ nix build .#default
|
||||||
```
|
```
|
||||||
|
|
||||||
And if you want to build the copy I made for this post:
|
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:
|
`go-hello` to be the default app:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
# below defaultPackage
|
# below packages
|
||||||
|
|
||||||
defaultApp = forAllSystems (system: {
|
apps = forAllSystems (system: {
|
||||||
type = "app";
|
default = {
|
||||||
program = "${self.packages.${system}.go-hello}/bin/go-hello";
|
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:
|
devShell = forAllSystems (system:
|
||||||
let pkgs = nixpkgsFor.${system};
|
let pkgs = nixpkgsFor.${system};
|
||||||
in pkgs.mkShell {
|
in {
|
||||||
buildInputs = with pkgs; [ go gopls goimports go-tools ];
|
default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [ go gopls gotools go-tools ];
|
||||||
|
};
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue