Skip to content

Instantly share code, notes, and snippets.

@frenata
Last active January 8, 2024 21:12
Show Gist options
  • Save frenata/17de45a9220b232dae0c1a88117e8424 to your computer and use it in GitHub Desktop.
Save frenata/17de45a9220b232dae0c1a88117e8424 to your computer and use it in GitHub Desktop.
OSX reset nix commands
# ~/Desktop/Alacritty.command
~/reset-nix.sh
alacritty &
exit
# ~/.config/nixpkgs/config.nix
packageOverrides = pkgs: with pkgs; {
tools = pkgs.buildEnv {
name = "standard";
paths = [
httpie
tmux
alacritty
emacs
jq
zsh
docker
unixtools.watch
dpkg
ranger
tree
gnutar
graphviz
tldr
htop
inetutils
nmap
got
gimp
packer
];
};
dev = pkgs.buildEnv {
name = "dev";
paths = [
clojure
stack
go
ruff
];
};
};
}
# ~/Desktop/Doom.command
~/reset-nix.sh
emacs &
exit
# ~/reset-nix.sh
#! /bin/sh
function reset () {
sudo rm /etc/zshrc.backup-before-nix
sudo rm /etc/bash.bashrc.backup-before-nix
sudo rm /etc/bashrc.backup-before-nix
curl -L https://nixos.org/nix/install -o nix.sh
sh nix.sh
rm nix.sh
}
function init() {
nix-env -iA nixpkgs.tools
nix-env -iA nixpkgs.dev
}
which alacritty
if [ $? -ne 0 ]; then
yes | reset
$(init)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment