-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall-nix-ubuntu.sh
More file actions
executable file
·35 lines (24 loc) · 1.38 KB
/
install-nix-ubuntu.sh
File metadata and controls
executable file
·35 lines (24 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -ve
sudo apt update
sudo apt install -y vim git curl build-essential dkms linux-headers-$(uname -r) bspwm libglfw3-dev libgles2-mesa-dev libgl1-mesa-dev xorg-dev
#git clone https://github.com/ericdallo/dotfiles.git ~/.dotfiles
sudo mkdir -p /nix
sudo chown "$USERNAME" /nix
sh <(curl -L https://nixos.org/nix/install) --no-daemon
source "/home/$USERNAME/.nix-profile/etc/profile.d/nix.sh"
echo "export NIX_PATH=$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels${NIX_PATH:+:$NIX_PATH}" >> ~/.bashrc
echo "export NIXPKGS_ALLOW_UNFREE=1" >> ~/.bashrc
nix-env -iA nixpkgs.home-manager
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
cd ~/.dotfiles/nix
home-manager switch --flake .
echo "export XDG_DATA_DIRS=$HOME/.nix-profile/share:$HOME/.share:\"${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}\"" >> ~/.profile
echo "export XDG_DATA_DIRS=$HOME/.nix-profile/share:$HOME/.share:\"${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}\"" >> ~/.zprofile
echo "if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi" >> ~/.zprofile
echo "/home/greg/.nix-profile/bin/zsh" | sudo tee -a /etc/shells > /dev/null
sudo chsh -s /home/greg/.nix-profile/bin/zsh
# Natural scrolling
echo "xinput set-prop 13 324 1" >> ~/.profile
echo "xinput set-prop 13 324 1" >> ~/.zprofile