Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nix config list ++ list attempt
# ... some things here ...
environment.systemPackages = let
basePkgs = import "${configDir}/pkgs/basePackages.nix" pkgs;
devPkgs = import "${configDir}/pkgs/devPackages.nix" pkgs;
desktopPkgs = import "${configDir}/pkgs/desktopPackages.nix" pkgs;
networkPkgs = import "${configDir}/pkgs/networkingPackages.nix" pkgs;
vim = import "${configDir}/pkgs/vim/default.nix" pkgs;
in
basePkgs ++ devPkgs ++ desktopPkgs ++ networkPkgs ++ vim;
# ... some things here ...
{ pkgs ? import <nixpkgs> {}
, stdenv
, lib
, writeTextFile
, writeText
, buildEnv
, fetchurl
, fetchgit
, fetchFromGitHub
, ...
}:
let
plugins = import ./plugins.nix;
vimrc = import ./vimrc.nix;
in
plugins ++ [(lib.overrideDerivation pkgs.vim_configurable (o: {
postInstall = (o.postInstall or "") + ''
ln -sf "${vimrc}" "$out/share/vim/vimrc"
'';
}))]
{ stdenv
, lib
, writeTextFile
, writeText
, buildEnv
, fetchurl
, fetchgit
, fetchFromGitHub
, vim_configurable
}:
# copied from aszlig, thanks a lot!
let
fetchVimScript = { srcId, sha256, type, name }:
let
baseUrl = "http://www.vim.org/scripts/download_script.php";
src = fetchurl {
name = "script${toString srcId}.vim";
url = "${baseUrl}?src_id=${toString srcId}";
inherit sha256;
};
in stdenv.mkDerivation {
name = "vim-${type}-${toString srcId}";
buildCommand = ''
install -vD -m 0644 "${src}" "$out/${type}/${name}.vim"
'';
};
extractSubdir = subdir: src: stdenv.mkDerivation {
name = "${src.name}-subdir";
phases = [ "unpackPhase" "installPhase" ];
inherit src;
installPhase = ''
cp -Rd "${subdir}" "$out"
'';
};
mkVimPlugins = plugins: buildEnv {
name = "vim-plugins";
paths = with lib; mapAttrsToList (const id) plugins;
ignoreCollisions = true;
postBuild = ''
find -L "$out" -mindepth 1 -maxdepth 1 -type f -delete
'';
};
pluginDeps = {
vimPlug = fetchFromGitHub {
owner = "junegunn";
repo = "vim-plug";
rev = "ebe8635043a068197b41d757db6b549c1e1caa87";
sha256 = "20056d12f1e9cc170ca49b156267635c83d5e54c3a9803c24dd44970390751ab";
};
};
plugins = mkVimPlugins (pluginDeps // {
vimYouCompleteMe = fetchFromGitHub {
owner = "Valloric";
repo = "YouCompleteMe";
rev = "13266679edd9a3e8cb0f067e6eaa1905914c6fc2";
sha256 = "67e48da1ed88c2ecd542f5b3b5b84c02ec5a0fa0eee540cb8835d3f36dc1bea8";
};
# ... more ...
});
in
[
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment