|
2 | 2 |
|
3 | 3 | let
|
4 | 4 | # set channel channel to nixpkgs-unstable
|
5 |
| - pkgs = import <nixpkgs> { }; |
| 5 | + pkgs = import <nixpkgs> { |
| 6 | + overlays = [ |
| 7 | + # https://github.com/NixOS/nixpkgs/issues/168984 |
| 8 | + (self: super: { |
| 9 | + golangci-lint = super.golangci-lint.override { |
| 10 | + buildGoModule = super.buildGoModule; |
| 11 | + }; |
| 12 | + }) |
| 13 | + ]; |
| 14 | + }; |
6 | 15 | contrast-detect-secrets = pkgs.python3Packages.callPackage ./detect-secrets.nix { };
|
7 | 16 | # https://github.com/nix-community/neovim-nightly-overlay
|
8 | 17 | in
|
|
23 | 32 | # changes in each release.
|
24 | 33 | home.stateVersion = "20.03";
|
25 | 34 |
|
26 |
| - # fsync on darwin is broken in that it's not a true fsync, so go's |
27 |
| - # syscall wrapper calls F_FULLFSYNC instead to make sure that writes are |
28 |
| - # actually flushed as expected. In general, with a laptop, there's probably |
29 |
| - # no issue, because the battery controler should handle flushing cache when |
30 |
| - # there's a sudden power loss or something. Down the rabbit hole of tweets is |
31 |
| - # more justification on this. This patch changes it to just call fsync. I |
32 |
| - # never use darwin besides on a laptop, so it should be safe enough for me. |
33 |
| - # |
34 |
| - # https://github.com/golang/go/issues/28739 |
35 | 35 | nixpkgs.overlays = [
|
| 36 | + # (import (builtins.fetchTarball { |
| 37 | + # url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz; |
| 38 | + # })) |
36 | 39 | (self: super: {
|
37 |
| - go = super.go.overrideAttrs (old: { |
| 40 | + # fsync on darwin is broken in that it's not a true fsync, so go's |
| 41 | + # syscall wrapper calls F_FULLFSYNC instead to make sure that writes are |
| 42 | + # actually flushed as expected. In general, with a laptop, there's probably |
| 43 | + # no issue, because the battery controler should handle flushing cache when |
| 44 | + # there's a sudden power loss or something. Down the rabbit hole of tweets is |
| 45 | + # more justification on this. This patch changes it to just call fsync. I |
| 46 | + # never use darwin besides on a laptop, so it should be safe enough for me. |
| 47 | + # |
| 48 | + # https://github.com/golang/go/issues/28739 |
| 49 | + go_1_18 = super.go_1_18.overrideAttrs (old: { |
38 | 50 | patches = (old.patches or [ ]) ++ (
|
39 | 51 | if lib.stdenv.isDarwin then [ ./fd_fsync_darwin.patch ]
|
40 | 52 | else [ ]
|
41 | 53 | );
|
42 | 54 | });
|
| 55 | + |
| 56 | + # https://github.com/NixOS/nixpkgs/issues/168984 |
| 57 | + golangci-lint = super.golangci-lint.override { |
| 58 | + buildGoModule = super.buildGoModule; |
| 59 | + }; |
43 | 60 | })
|
44 | 61 | ];
|
45 | 62 |
|
|
56 | 73 | graphviz
|
57 | 74 | jq
|
58 | 75 | tokei
|
59 |
| - hugo |
| 76 | + # hugo |
60 | 77 | age
|
61 | 78 | silver-searcher
|
62 | 79 | zlib
|
|
87 | 104 | # nix language server
|
88 | 105 | # rnix-lsp
|
89 | 106 |
|
90 |
| - golangci-lint |
| 107 | + golangci-lint |
91 | 108 |
|
92 | 109 | contrast-detect-secrets
|
93 | 110 | ];
|
|
110 | 127 |
|
111 | 128 | programs.go = {
|
112 | 129 | enable = true;
|
113 |
| - package = pkgs.go; |
| 130 | + package = pkgs.go_1_18; |
114 | 131 | goPath = "${builtins.getEnv "HOME"}/gopath";
|
115 | 132 | goBin = "${builtins.getEnv "HOME"}/gobin";
|
116 | 133 | };
|
|
0 commit comments