aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-03-17 08:12:44 +0100
committerKarel Kočí <cynerd@email.cz>2023-03-17 08:12:44 +0100
commitf0eab21bab34beb657059cf5dfe91ca8072edb35 (patch)
tree2bbf0afc7108daca6363d449f851b16f3e11a035
parentda54fd0a08cb5d29cf0d52f1688736634ebe03cb (diff)
downloadshellrc-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.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkgs.nix b/pkgs.nix
index ec5be7f..0f5b6a8 100644
--- a/pkgs.nix
+++ b/pkgs.nix
@@ -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