Skip to content

Commit

Permalink
some adjustments + vagrant with nix
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Sep 23, 2024
1 parent 3ddcd51 commit 8004d0a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .bashrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Idempotent configs

# To allow some scripts to determine which shell they're running in
BASH_VERSION=$(bash --version)
export BASH_VERSION

# kube config
if [ "${KUBECONFIG/:*}" = "$HOME/.kube/config" ]
then
Expand All @@ -14,6 +10,9 @@ then
export KUBE_FUZZY_PREVIEW_ENABLED=true
fi

NIXPKGS_ALLOW_UNFREE=1
export NIXPKGS_ALLOW_UNFREE

# Prevent double .bashrc sourcing in different files
if { test "${TMUX}" != "" && test "${TMUX_BASHRC_ALREADY_EXECUTED}" = ""; } || test "$BASHRC_ALREADY_EXECUTED" = ""
then
Expand Down Expand Up @@ -433,7 +432,7 @@ then
then
PS1=$PS1'$(KUBECTL_CONTEXT=$(kubectl config current-context 2>/dev/null);'
PS1=$PS1'KUBECTL_NAMESPACE=$(kubectl config view -o jsonpath="{.contexts[?(@.context.cluster == '"'"'${KUBECTL_CONTEXT}'"'"')].context.namespace}" 2>/dev/null);'
PS1=$PS1'if ! test "x${KUBECTL_CONTEXT}/${KUBECTL_NAMESPACE}" = "x";'
PS1=$PS1'if ! test "x${KUBECTL_CONTEXT}/${KUBECTL_NAMESPACE}" = "x/";'
PS1=$PS1'then'
PS1=$PS1' echo -e "'${BIRed}'[k8s:'${BIBlue}
PS1=$PS1'${KUBECTL_CONTEXT}/${KUBECTL_NAMESPACE}'${BIRed}'] ";'
Expand Down
9 changes: 3 additions & 6 deletions .config/nix/dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pkgs.mkShell {
pkgs.fortune
pkgs.gh
pkgs.src-cli # sourcegraph
# pkgs.vagrant # unfree and not installable
# Formatting for .nix files
pkgs.nixfmt-rfc-style
pkgs.nixpkgs-fmt
Expand All @@ -90,14 +89,13 @@ pkgs.mkShell {
unstablePkgs.neovim
unstablePkgs.vimPlugins.lazy-nvim
unstablePkgs.gopls
# unfree NIXPKGS_ALLOW_UNFREE=1
pkgs.vagrant # unfree
];

# To find all the packages for FPATH
# for i in $(ls -d /nix/store/*/share/zsh/site-functions | cut -d '-' -f 2 | sort | uniq); do echo "\${pkgs.$i} \\"; done
shellHook = ''
# FIXME: have no idea, why it doesn't work without it.
# ModuleNotFoundError: No module named '_sysconfigdata__linux_x86_64-linux-gnu'
export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_
# glibc has no nss library included and tries to look at the default path instead
export LD_LIBRARY_PATH=${pkgs.sssd}/lib
export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
Expand Down Expand Up @@ -127,9 +125,7 @@ pkgs.mkShell {
GIT_COMPLETION_DIR=${pkgs.git}/share/git/contrib/completion
export GIT_COMPLETION_DIR
# TODO: automatically source zsh plugins
# TODO: automatically source MANPATH
# TODO: automatically source bash and zsh completions
BWRAPPED=1 bwrap \
--die-with-parent \
Expand Down Expand Up @@ -164,6 +160,7 @@ pkgs.mkShell {
--bind-try /home/$(whoami)/.config/i3status /home/$(whoami)/.config/i3status \
--bind-try /home/$(whoami)/.config/nix /home/$(whoami)/.config/nix \
--bind-try /home/$(whoami)/.config/nvim /home/$(whoami)/.config/nvim \
--bind-try /home/$(whoami)/.config/github-copilot /home/$(whoami)/.config/github-copilot \
--bind-try /home/$(whoami)/.config/systemd /home/$(whoami)/.config/systemd \
--bind-try /home/$(whoami)/.config/pulse /home/$(whoami)/.config/pulse \
--bind-try /home/$(whoami)/.config/pycodestyle /home/$(whoami)/.config/pycodestyle \
Expand Down
10 changes: 7 additions & 3 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# To allow some scripts to determine which shell they're running in
ZSH_VERSION=$(zsh --version)
export ZSH_VERSION
# vim: ft=sh
# Idempotent configs

NIXPKGS_ALLOW_UNFREE=1
export NIXPKGS_ALLOW_UNFREE

# Everything else

autoload -Uz compinit
compinit
Expand Down

0 comments on commit 8004d0a

Please sign in to comment.