feat: more macos support

This commit is contained in:
Tine 2024-04-26 22:34:29 +02:00
parent 75d4147dce
commit 68ff85c43f
No known key found for this signature in database
7 changed files with 23 additions and 10 deletions

View file

@ -7,6 +7,8 @@ Expected configuration:
```bash
# Install GUI tools with personal specialization
./install --gui --env personal
# A variation for macos
./install --gui --env personal-macos
# Skip GUI tools and only apply work specialization
./install --env work
```
@ -21,3 +23,8 @@ to match the correct preferences.
To make this work, [night theme switcher](https://extensions.gnome.org/extension/2236/night-theme-switcher/)
extension is needed and configured to use `scripts/sunrise.sh` and `scripts/sunset.sh` as "run commands".
### MacOS support.
Best effort. Known issues are:
- neovim has dbus dependencies (for theme switching).

View file

@ -22,10 +22,6 @@ while [[ $# -gt 0 ]]; do
case $1 in
--env)
ENVIRONMENT=$2
if [ "$ENVIRONMENT" != "personal" ] && [ "$ENVIRONMENT" != "work" ]; then
echo "Unknown environment $ENVIRONMENT"
exit 1
fi
shift # past argument
shift # past value
;;

View file

@ -4,10 +4,12 @@ set -euo pipefail
source common.sh
echo_header "== DotFiles with GUI: $GUI and ENV: $ENVIRONMENT"
LINUX="true"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo_header "== Detected linux"
./install-linux.sh
elif [[ "$OSTYPE" == "darwin"* ]]; then
LINUX="false"
echo_header "== Detected macos"
./install-macos.sh
else
@ -38,7 +40,10 @@ workspace_link nix/work.nix .config/home-manager/work.nix
NIXPKGS_ALLOW_UNFREE=1 ENVIRONMENT=$ENVIRONMENT home-manager switch
echo_header "== Use zsh as default shell"
if [ "${LINUX}" == "true" ]
then
sudo chsh $USER --shell=/bin/zsh
fi
echo_header "== Plug for neovim"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \

View file

@ -72,9 +72,6 @@
# Kubernetes
k9s
kubectl
# Gnome
gnomeExtensions.pop-shell
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage

View file

@ -7,5 +7,7 @@ in
imports =
if environment == "work"
then [ ./core.nix ./work.nix ]
else if environment == "personal-macos"
then [ ./core.nix ./personal-macos.nix ]
else [ ./core.nix ./personal.nix ];
}

6
nix/personal-macos.nix Normal file
View file

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
home.username = "tine";
home.homeDirectory = "/Users/tine";
}

View file

@ -1,4 +1,4 @@
#!/bin/env bash
#!/usr/bin/env bash
source common.sh
echo_header "== DotFiles with ENV: $ENVIRONMENT"