From e857249d866b4c7ff4eba948009256c779a59627 Mon Sep 17 00:00:00 2001
From: Robert Helgesson <robert@rycee.net>
Date: Sat, 11 Jan 2020 19:36:24 +0100
Subject: [PATCH] go: use attribute set to define files

To avoid warning message concerning deprecation of the `loaOf` type.
---
 modules/programs/go.nix | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/programs/go.nix b/modules/programs/go.nix
index dd907591e..39788e040 100644
--- a/modules/programs/go.nix
+++ b/modules/programs/go.nix
@@ -77,14 +77,11 @@ in
       home.file =
         let
           goPath = if cfg.goPath != null then cfg.goPath else "go";
-
-          mkSrc = n: v: {
-            target = "${goPath}/src/${n}";
-            source = v;
-          };
+          mkSrc = n: v: { "${goPath}/src/${n}".source = v; };
         in
-        mapAttrsToList mkSrc cfg.packages;
+          foldl' (a: b: a // b) {} (mapAttrsToList mkSrc cfg.packages);
     }
+
     (mkIf (cfg.goPath != null) {
       home.sessionVariables.GOPATH =
         concatStringsSep ":"
@@ -92,6 +89,7 @@ in
         (map (path: "${config.home.homeDirectory}/${path}")
         ([cfg.goPath] ++ cfg.extraGoPaths)));
     })
+
     (mkIf (cfg.goBin != null) {
       home.sessionVariables.GOBIN = builtins.toPath "${config.home.homeDirectory}/${cfg.goBin}";
     })