diff options
author | Karel Kočí <cynerd@email.cz> | 2023-03-17 08:12:44 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2023-03-17 08:12:44 +0100 |
commit | f0eab21bab34beb657059cf5dfe91ca8072edb35 (patch) | |
tree | 2bbf0afc7108daca6363d449f851b16f3e11a035 | |
parent | da54fd0a08cb5d29cf0d52f1688736634ebe03cb (diff) | |
download | shellrc-f0eab21bab34beb657059cf5dfe91ca8072edb35.tar.gz shellrc-f0eab21bab34beb657059cf5dfe91ca8072edb35.tar.bz2 shellrc-f0eab21bab34beb657059cf5dfe91ca8072edb35.zip |
pkgs: add shellrc-setup
This is intended to be used to setup user environment on system that
are not managed by nixos module.
-rw-r--r-- | pkgs.nix | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -36,7 +36,7 @@ done ''; }; - shellrc-zsh= pkgs.stdenvNoCC.mkDerivation { + shellrc-zsh = pkgs.stdenvNoCC.mkDerivation { name = "shellrc-zsh"; src = ./.; nativeBuildInputs = [pkgs.installShellFiles]; @@ -56,6 +56,21 @@ done ''; }; + shellrc-setup = pkgs.writeScriptBin "shellrc-setup" '' + #!/usr/bin/env bash + cat >~/.bashrc <<EOF + for sh in ~/.nix-profile/etc/bashrc.d/*; do + [ -r "\$sh" ] || continue + source "\$sh" + done + EOF + cat >~/.zshrc <<EOF + for sh in ~/.nix-profile/etc/zshrc.d/*; do + [ -r "\$sh" ] || continue + source "\$sh" + done + EOF + ''; }; in shellrcPkgs |