From b18db5be1a755a1b5d188dbba4f55c0d42ac4bcb Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Tue, 28 Jun 2016 11:39:21 -0700 Subject: [PATCH] *: adapt to new Go structure --- configuration/common/pkg/neovim.nix | 44 +++++++++++++++++----------- configuration/steveej-laptop/pkg.nix | 3 +- derivations/dev/go.nix | 38 ++++++++++++------------ derivations/dev/rkt.nix | 4 +-- 4 files changed, 49 insertions(+), 40 deletions(-) diff --git a/configuration/common/pkg/neovim.nix b/configuration/common/pkg/neovim.nix index d434444..9308011 100644 --- a/configuration/common/pkg/neovim.nix +++ b/configuration/common/pkg/neovim.nix @@ -4,11 +4,13 @@ let commonPkgs = with pkgs; [ xsel ]; - goPkgs = with pkgs.go16Packages; [ - go - tools.bin - godef.bin - godep.bin + + goPkgs = with gitpkgs; [ + go_1_6 + gotools.bin +# godef.bin + godep +# go-errcheck.bin ]; pythonPkgs = with pkgs.python2Packages; [ blockdiag @@ -63,11 +65,6 @@ in { set expandtab "set textwidth=80 - " GoDef mappings - au FileType go nmap gds (go-def-split) - au FileType go nmap gdv (go-def-vertical) - au FileType go nmap gdt (go-def-tab) - let g:tagbar_type_go = { \ 'ctagstype' : 'go', \ 'kinds' : [ @@ -115,7 +112,6 @@ in { \ 'file': '\v\.(exe|so|dll)$$', \ } - let g:go_fmt_command = "goimports" "au BufRead,BufNewFile *.txt,*.md,*.markdown setlocal spell spelllang=de_de,en_us @@ -169,6 +165,21 @@ in { setlocal autoindent sw=2 et tabstop=2 shiftwidth=2 softtabstop=2 augroup END " }}} + + " vim-go { + let g:go_highlight_functions = 1 + let g:go_highlight_methods = 1 + let g:go_highlight_structs = 1 + let g:go_highlight_interfaces = 1 + let g:go_highlight_operators = 1 + let g:go_highlight_build_constraints = 1 +" let g:go_fmt_command = "goimports" + + au FileType go nmap gds (go-def-split) + au FileType go nmap gdv (go-def-vertical) + au FileType go nmap gdt (go-def-tab) + " } + ''; vam.knownPlugins = gitpkgs.vimPlugins; # optional @@ -179,18 +190,17 @@ in { "vim-addon-nix" "ctrlp" "vim-go" - "syntastic" +# "syntastic" "tagbar" "vim-css-color" "rainbow_parentheses" "vim-colorschemes" "vim-colorstepper" "vim-signify" - "vim-pandoc" - "vim-pandoc-syntax" - "vim-pandoc-after" - "vimpreviewpandoc" - "rust-vim" +# "vim-pandoc" +# "vim-pandoc-syntax" +# "vim-pandoc-after" +# "vimpreviewpandoc" ]; }; extraPythonPackages = with gitpkgs.python2Packages; [ diff --git a/configuration/steveej-laptop/pkg.nix b/configuration/steveej-laptop/pkg.nix index c4d446a..e08e226 100644 --- a/configuration/steveej-laptop/pkg.nix +++ b/configuration/steveej-laptop/pkg.nix @@ -10,7 +10,7 @@ in allowBroken = false; packageOverrides = pkgs: rec { - goPackages = gitpkgs.go16Packages; + go = gitpkgs.go1_6; bluez = pkgs.bluez5; linuxPackages = pkgs.linuxPackages_latest; #pythonPackages.sqlalchemy7 = pkgs.pythonPackages.sqlalchemy7.override { doCheck = false; }; @@ -100,5 +100,6 @@ in ] ++ [ gitpkgs.rkt gitpkgs.flannel + gitpkgs.remmina ]; } diff --git a/derivations/dev/go.nix b/derivations/dev/go.nix index 0b8a3a0..57d1f8f 100644 --- a/derivations/dev/go.nix +++ b/derivations/dev/go.nix @@ -4,32 +4,30 @@ name ? "generic", version, extraBuildInputs ? [] }: let - goPackages = builtins.getAttr "go${version}Packages" pkgs; - goBuildInputs = { goPackages }: [ - goPackages.go - goPackages.tools - goPackages.tools.bin - goPackages.gocode - goPackages.gocode.bin - goPackages.godef - goPackages.godef.bin - goPackages.godep - goPackages.godep.bin - goPackages.gox.bin - goPackages.ginkgo - goPackages.ginkgo.bin - goPackages.gomega + go = builtins.getAttr "go_${version}" pkgs; + goBuildInputs = with pkgs; [ + go + gotools + #gotools.bin + gocode + gocode.bin + #godef godef.bin + godep + #godep.bin + gox.bin + #ginkgo ginkgo.bin + #gomega ]; - goShellHook = { goPackages, name }: '' - goname=${goPackages.go.version}_$name + goShellHook = { go, name }: '' + goname=${go.version}_$name setPS1 $goname - export GOROOT=${goPackages.go}/share/go + export GOROOT=${go}/share/go export GOPATH="$HOME/.gopath_$goname" export PATH="$HOME/.gopath_$goname/bin:$PATH" unset name ''; in pkgs.stdenv.mkDerivation { inherit name; - buildInputs = extraBuildInputs ++ (goBuildInputs){ inherit goPackages; }; - shellHook = (goShellHook) { inherit name; inherit goPackages; }; + buildInputs = extraBuildInputs ++ goBuildInputs; + shellHook = (goShellHook) { inherit name; inherit go; }; } diff --git a/derivations/dev/rkt.nix b/derivations/dev/rkt.nix index c06a80e..bf0b3fd 100644 --- a/derivations/dev/rkt.nix +++ b/derivations/dev/rkt.nix @@ -29,7 +29,7 @@ in { inherit pkgs; name = "rktGo15"; - version = "15"; + version = "1_5"; extraBuildInputs = rktBasebuildInputs; }; @@ -37,7 +37,7 @@ in { inherit pkgs; name = "rktGo16"; - version = "16"; + version = "1_6"; extraBuildInputs = rktBasebuildInputs; }; }