diff --git a/.gitignore b/.gitignore index b2be92b..1574d4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ result +.DS_Store diff --git a/INSTALL b/INSTALL index d05fb48..580e976 100644 --- a/INSTALL +++ b/INSTALL @@ -1,20 +1,26 @@ +### clone git clone --recurse-submodules git@github.com:zy9306/nix-home.git -# install +### INSTALL +install # https://nixos.org/manual/nix/stable/installation/installation . $HOME/.nix-profile/etc/profile.d/nix.sh -./__setup_nix.sh update_nix_channel +### setup nix channel (Optional) +nix-channel --list +nix-channel --remove nixpkgs +nix-channel --add https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixpkgs-unstable nixpkgs +nix-channel --update -./__setup_nix.sh install_cachix +### setup cachix (Optional) +nix-env -iA cachix -f https://cachix.org/api/v1/install +cachix use arcueid -# setup cache mirror # ~/.config/nix/nix.conf # substituters = https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store https://cache.nixos.org https://arcueid.cachix.org +### INSTALL NIXPKGS ./install_nixpkgs.sh ./install_macos_extra.sh - -# ./install_dotfiles.sh diff --git a/__setup_nix.sh b/__setup_nix.sh deleted file mode 100755 index eba41b8..0000000 --- a/__setup_nix.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -set -e - - -update_nix_channel() { - echo ">>> update nix channel ..." - nix-channel --list - nix-channel --remove nixpkgs - nix-channel --add https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixpkgs-unstable nixpkgs - nix-channel --update -} - -install_cachix() { - echo ">>> install cachix ..." - nix-env -iA cachix -f https://cachix.org/api/v1/install - cachix use arcueid -} - -case "$1" in -"update_nix_channel") - update_nix_channel - ;; -"install_cachix") - install_cachix - ;; -*) - echo -e "nothing to do" - ;; -esac diff --git a/install_locked.sh b/install_locked.sh deleted file mode 100755 index a1de89c..0000000 --- a/install_locked.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -nix-env -iA bfg-repo-cleaner -f https://github.com/NixOS/nixpkgs/archive/30d3d79b7d3607d56546dd2a6b49e156ba0ec634.tar.gz diff --git a/install_macos_extra.sh b/install_macos_extra.sh index b2f0345..33d98db 100755 --- a/install_macos_extra.sh +++ b/install_macos_extra.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -install="nix-env -iA pkgs" +install="nix-env -iA nixpkgs" # macOS bsd tools to gnu. case "$(uname -s)" in diff --git a/install_nixpkgs.sh b/install_nixpkgs.sh index 2ac43c8..f5e8874 100755 --- a/install_nixpkgs.sh +++ b/install_nixpkgs.sh @@ -2,4 +2,5 @@ nix-env -i -f nixpkgs.nix -./install_locked.sh +### locked pkgs +nix-env -iA bfg-repo-cleaner -f https://github.com/NixOS/nixpkgs/archive/30d3d79b7d3607d56546dd2a6b49e156ba0ec634.tar.gz