Ugh, my attempt at an impure solution.
Perhaps nvfetcher is the direction I should be moving in.
This commit is contained in:
parent
831d304ece
commit
5e4a56b2f5
2 changed files with 29 additions and 11 deletions
|
|
@ -96,6 +96,14 @@
|
|||
mu4e
|
||||
];
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
enableBashIntegration = true; # see note on other shells below
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
bash.enable = true; # see note on other shells below
|
||||
};
|
||||
|
||||
services = {
|
||||
|
|
|
|||
|
|
@ -2,24 +2,34 @@
|
|||
let
|
||||
cfg = config.my.bash-config;
|
||||
|
||||
bash-drv = pkgs.stdenv.mkDerivation {
|
||||
name = "bash-config";
|
||||
src = inputs.bashcfg-input;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp *.sh $out
|
||||
'';
|
||||
# bash-drv = pkgs.stdenv.mkDerivation {
|
||||
# name = "bash-config";
|
||||
# src = inputs.bashcfg-input;
|
||||
# dontBuild = true;
|
||||
# installPhase = ''
|
||||
# mkdir -p $out
|
||||
# cp *.sh $out
|
||||
# '';
|
||||
# };
|
||||
|
||||
bash-drv = builtins.fetchGit {
|
||||
url = "https://github.com/pestctrl/bash-config";
|
||||
ref = "master";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.bash-config.enable = lib.mkEnableOption "Enable bash configuration file";
|
||||
options = {
|
||||
my.bash-config.enable = lib.mkEnableOption "Enable bash configuration file";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Why can't I do the following?
|
||||
# home.file."${config.xdg.configHome}/bash-config/emacs.sh"
|
||||
xdg.configFile."bash-config/emacs.sh".source = "${bash-drv}/emacs.sh";
|
||||
# xdg.configFile."bash-config/emacs.sh".source = "${bash-drv}/emacs.sh";
|
||||
|
||||
home.file.".bashrc".source = "${bash-drv}/bashrc.sh";
|
||||
# home.file.".bashrc".source = "${bash-drv}/bashrc.sh";
|
||||
programs.bash.bashrcExtra = ''
|
||||
source ${bash-drv}/bashrc.sh
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue