make * composable; add install medium; archive prevoius code
This commit is contained in:
parent
5ab3bfc58c
commit
93b1488bd9
74 changed files with 955 additions and 1132 deletions
89
_archive/environments/dev/go/default.nix
Normal file
89
_archive/environments/dev/go/default.nix
Normal file
|
@ -0,0 +1,89 @@
|
|||
{ gitpkgs ? import /home/steveej/src/github/NixOS/nixpkgs {}
|
||||
, pkgs ? gitpkgs
|
||||
, name ? "generic"
|
||||
, version
|
||||
, extraBuildInputs ? []
|
||||
, extraShellHook ? ""
|
||||
}:
|
||||
let
|
||||
go = builtins.getAttr "go_${version}" pkgs;
|
||||
commonVimRC = ''
|
||||
let g:tagbar_type_go = {
|
||||
\ 'ctagstype' : 'go',
|
||||
\ 'kinds' : [
|
||||
\ 'p:package',
|
||||
\ 'i:imports:1',
|
||||
\ 'c:constants',
|
||||
\ 'v:variables',
|
||||
\ 't:types',
|
||||
\ 'n:interfaces',
|
||||
\ 'w:fields',
|
||||
\ 'e:embedded',
|
||||
\ 'm:methods',
|
||||
\ 'r:constructor',
|
||||
\ 'f:functions'
|
||||
\ ],
|
||||
\ 'sro' : '.',
|
||||
\ 'kind2scope' : {
|
||||
\ 't' : 'ctype',
|
||||
\ 'n' : 'ntype'
|
||||
\ },
|
||||
\ 'scope2kind' : {
|
||||
\ 'ctype' : 't',
|
||||
\ 'ntype' : 'n'
|
||||
\ },
|
||||
\ 'ctagsbin' : 'gotags',
|
||||
\ 'ctagsargs' : '-sort -silent'
|
||||
\ }
|
||||
|
||||
" 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 = 'gofmt'
|
||||
let g:go_fmt_options= '-s'
|
||||
let g:go_def_mode = 'godef'
|
||||
let g:go_def_reuse_buffer = 0
|
||||
|
||||
au FileType go nmap <Leader>gds <Plug>(go-def-split)
|
||||
au FileType go nmap <Leader>gdv <Plug>(go-def-vertical)
|
||||
au FileType go nmap <Leader>gdt <Plug>(go-def-tab)
|
||||
au FileType go nmap <Leader>gi <Plug>(go-imports)
|
||||
" }
|
||||
'';
|
||||
buildInputs = with pkgs; [
|
||||
glibc.out
|
||||
glibc.static
|
||||
|
||||
go
|
||||
gotools
|
||||
#gotools.bin
|
||||
#gocode.bin
|
||||
#godef godef.bin
|
||||
godep
|
||||
#godep.bin
|
||||
gox.bin
|
||||
#ginkgo ginkgo.bin
|
||||
#gomega
|
||||
# ( import ./vim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } )
|
||||
# ( import ./neovim-go.nix { pkgs=gitpkgs; commonRC=commonVimRC; } )
|
||||
];
|
||||
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
inherit name;
|
||||
buildInputs = extraBuildInputs ++ buildInputs;
|
||||
shellHook = ''
|
||||
goname=${go.version}_$name
|
||||
# FIXME: setPS1 $goname
|
||||
export GOROOT=${go}/share/go
|
||||
export GOPATH="$HOME/.gopath_$goname"
|
||||
export PATH="$HOME/.gopath_$goname/bin:$PATH"
|
||||
unset name
|
||||
unset SSL_CERT_FILE
|
||||
|
||||
${extraShellHook}
|
||||
'';
|
||||
}
|
15
_archive/environments/dev/go/neovim-go.nix
Normal file
15
_archive/environments/dev/go/neovim-go.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ commonRC, ... } @ args :
|
||||
|
||||
(import ../../pkg-configuration/vim-derivates/neovim.nix args // {
|
||||
additionalRC = commonRC + ''
|
||||
" deoplete {
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
let g:deoplete#enable_smart_case = 1
|
||||
" }
|
||||
'';
|
||||
additionalPlugins = [
|
||||
"deoplete-go"
|
||||
"deoplete-nvim"
|
||||
"vim-go"
|
||||
];
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue