0

I'm just getting started with NixOS, and I'm trying to us home-manager to declaratively control which packages I have installed and deploy their configurations to my home directory.

I told home-manager to install vim_configurable

# ~/.config/nixpkgs/home.nix
{ config, pkgs, ... }:
{
  home.packages = [
    pkgs.vim_configurable
    #...
  ]
  #...

Which worked fine, but I ran into errors when I tried to use program.vim to configure it:

  #...
  programs.vim = {
    enable = true;
    settings = {
      expandtab = true;
      tabstop = 2;
    };
  };

Running home-manager switch gave me an error due to conflicting versions of gvimdiff

; home-manager switch
these 3 derivations will be built:
  /nix/store/z8imrylbxzmk161gc1jjj2nsjdaiv0ca-home-manager-path.drv
  /nix/store/2wwz04y7yqrzizicc160n630a6kja778-activation-script.drv
  /nix/store/pyx34c22lz2f6nw2pdjgddsg8sy5wz0c-home-manager-generation.drv
building '/nix/store/z8imrylbxzmk161gc1jjj2nsjdaiv0ca-home-manager-path.drv'...
error: collision between `/nix/store/vvb9a43fpmsijx42k3jvrr1a8l6jq6da-vim_configurable-8.2.5172/bin/gvimdiff' and `/nix/store/xyhfc9g3qk3i42gqmp05r0lsab7nng14-vim/bin/gvimdiff'
error: builder for '/nix/store/z8imrylbxzmk161gc1jjj2nsjdaiv0ca-home-manager-path.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/vvb9a43fpmsijx42k3jvrr1a8l6jq6da-vim_configurable-8.2.5172/bin/gvimdiff' and `/nix/store/xyhfc9g3qk3i42gqmp05r0lsab7nng14-vim/bin/gvimdiff'
       For full logs, run 'nix log /nix/store/z8imrylbxzmk161gc1jjj2nsjdaiv0ca-home-manager-path.drv'.
error: 1 dependencies of derivation '/nix/store/pyx34c22lz2f6nw2pdjgddsg8sy5wz0c-home-manager-generation.drv' failed to build

I'm guessing this is because programs.vim.enable = true instructs home-manager to add the system vim, or something, and that's conflicting?

Removing enable = true got rid of the error, but none of the configuration settings seemed to come through, which made specifying the programs.vim block at all rather pointless.

Am I doing something wrong? Should this work, or does this sort of configuration expect me to have installed packages by updating /etc/nixos/configuration.nix instead?

1 Answer 1

1

The issue is that you need to choose an approach: either you install vim/vim_configurable yourself or you let home manager do it for you.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.