From 9b1a4956d4d5925c7f36d23667f293d097db7808 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 13 Jan 2020 21:56:20 -0500 Subject: [PATCH] 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 --- modules/dev/rust.nix | 8 +++++--- modules/editors/emacs.nix | 5 +++-- modules/editors/vim.nix | 5 +++-- options/my.nix | 8 -------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/modules/dev/rust.nix b/modules/dev/rust.nix index ec686bd2..3ed16456 100644 --- a/modules/dev/rust.nix +++ b/modules/dev/rust.nix @@ -24,9 +24,11 @@ alias.rsp = "rustup"; alias.ca = "cargo"; - setup = '' - ${pkgs.rustup}/bin/rustup update nightly - ${pkgs.rustup}/bin/rustup default nightly + init = '' + if [ ! -d "$RUSTUP_HOME" ]; then + ${pkgs.rustup}/bin/rustup update nightly + ${pkgs.rustup}/bin/rustup default nightly + fi ''; }; } diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 0e29d4b4..b4a38d78 100644 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -26,14 +26,15 @@ env.PATH = [ "$HOME/.emacs.d/bin" ]; zsh.rc = lib.readFile ; - 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 ''; }; diff --git a/modules/editors/vim.nix b/modules/editors/vim.nix index 3945f516..c38bbba0 100644 --- a/modules/editors/vim.nix +++ b/modules/editors/vim.nix @@ -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 ''; }; } diff --git a/options/my.nix b/options/my.nix index 6fa3e946..b829fd34 100644 --- a/options/my.nix +++ b/options/my.nix @@ -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; }; }