1
0
Fork 0

linux-setup.sh: no need to run on NixOS

This commit is contained in:
Pratham Patel 2024-01-12 11:35:34 +05:30
parent 39be9495cb
commit 339ed8e2e3
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,12 @@
#!/usr/bin/env bash
if [[ "$(uname -s)" == 'Linux' ]]; then
if grep 'ID=nixos' /etc/os-release > /dev/null; then
echo 'You are on NixOS, no need, have a great day, bye!'
exit 0
fi
fi
if sudo grep '^#.*NOPASSWD.*' /etc/sudoers > /dev/null; then
echo 'You forgot to set NOPASSWD.'
exit 1
@ -126,10 +133,8 @@ function nix_setup() {
function home_manager_setup() {
if [[ ! -f "${HOME}/.config/home-manager/home.nix" ]]; then
if [[ "$(uname -s)" == 'Linux' ]]; then
if ! grep 'ID=nixos' /etc/os-release > /dev/null; then
ln -s "${HOME}/.config/home-manager/"{common,home}.nix
ln -s "${HOME}/.config/home-manager/"{linux,platform}.nix
fi
elif [[ "$(uname -s)" == 'Darwin' ]]; then
ln -s "${HOME}/.config/home-manager/"{common,home}.nix
ln -s "${HOME}/.config/home-manager/"{darwin,platform}.nix