diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-09-01 09:27:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-09-02 01:18:23 +0900 |
| commit | f8d23391c64acfd9db15816aa2522ce0ef4ad1a5 (patch) | |
| tree | d455cea2f448f3b0da0673b6e5cc80f0d00cb67a /bootstrap.sh | |
| parent | f1e3ca6f971c2c5177174896e1fa3e6f695ca2a1 (diff) | |
| download | dotfiles-f8d23391c64acfd9db15816aa2522ce0ef4ad1a5.tar.gz dotfiles-f8d23391c64acfd9db15816aa2522ce0ef4ad1a5.tar.zst dotfiles-f8d23391c64acfd9db15816aa2522ce0ef4ad1a5.zip | |
home-manager: introduce nix flake
Diffstat (limited to 'bootstrap.sh')
| -rwxr-xr-x | bootstrap.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..641fac9 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ ! -d .bootstrap ]; then + mkdir .bootstrap +fi +if [ ! -f .bootstrap/nix-install ]; then + curl -o .bootstrap/nix-install -L https://nixos.org/nix/install +fi +if [ ! -d /nix ]; then + sh .bootstrap/nix-install --daemon +fi +if grep -q "nix-command flakes" /etc/nix/nix.conf; then + : +else + echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf > /dev/null +fi +if [ ! -d "$HOME/.local/state/nix/profiles" ]; then + mkdir -p "$HOME/.local/state/nix/profiles" +fi +if type home-manager > /dev/null 2>&1; then + : +else + nix run "nixpkgs#home-manager" -- switch --flake ".#ken" +fi |
