Use my.init instead of my.setup

system.userActivationScripts is too sensitive to command failures,
blocking the build process.

Also:
- Make rustup init script idempotent.
- Remove doom sync and vim update; I'll do it manually
This commit is contained in:
Henrik Lissner 2020-01-13 21:56:20 -05:00
parent 5d2c5960b4
commit 9b1a4956d4
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 11 additions and 15 deletions

View file

@ -24,9 +24,11 @@
alias.rsp = "rustup";
alias.ca = "cargo";
setup = ''
init = ''
if [ ! -d "$RUSTUP_HOME" ]; then
${pkgs.rustup}/bin/rustup update nightly
${pkgs.rustup}/bin/rustup default nightly
fi
'';
};
}

View file

@ -26,14 +26,15 @@
env.PATH = [ "$HOME/.emacs.d/bin" ];
zsh.rc = lib.readFile <my/config/emacs/aliases.zsh>;
setup = ''
# My emacs config is too stateful to manage with nix
init = ''
if [ ! -d "$HOME/.emacs.d" ]; then
${pkgs.git}/bin/git clone https://github.com/hlissner/doom-emacs "$HOME/.emacs.d"
fi
if [ ! -d "$XDG_CONFIG_HOME/doom" ]; then
${pkgs.git}/bin/git clone https://github.com/hlissner/doom-emacs-private "$XDG_CONFIG_HOME/doom"
fi
$HOME/.emacs.d/bin/doom sync
'';
};

View file

@ -11,11 +11,12 @@
env.EDITOR = "nvim";
env.VIMINIT = "let \\$MYVIMRC='\\$XDG_CONFIG_HOME/nvim/init.vim' | source \\$MYVIMRC";
setup = ''
# My vim config is too stateful to manage with nix
init = ''
if [ ! -d "$XDG_CONFIG_HOME/nvim" ]; then
${pkgs.git}/bin/git clone https://github.com/hlissner/.vim "$XDG_CONFIG_HOME/nvim"
fi
${pkgs.gnumake}/bin/make -C "$XDG_CONFIG_HOME/nvim" update
'';
};
}

View file

@ -54,12 +54,6 @@ with lib;
description = "...";
};
setup = mkOption {
type = types.lines;
default = "";
description = "...";
};
zsh = {
rc = mkOption {
type = types.lines;
@ -95,7 +89,5 @@ with lib;
${config.my.zsh.rc}
'';
my.home.xdg.configFile."zsh/extra.zshenv".text = config.my.zsh.env;
system.userActivationScripts.mySetup = config.my.setup;
};
}