From 3cf16ff880a0ced4e0a284299f365939afc0890a Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 13:47:55 -0400 Subject: [PATCH] added install script and git config --- cli-tools.nix | 13 +++++++++++++ install.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 install.sh diff --git a/cli-tools.nix b/cli-tools.nix index 51b92a6..e4c5f16 100644 --- a/cli-tools.nix +++ b/cli-tools.nix @@ -6,6 +6,19 @@ ll = "ls -la"; }; + programs.git = { + enable = true; + config = { + user = { + name = "Brian Nelson"; + email = "brian@briannelson.dev"; + }; + init = { + defaultBranch = "main"; + }; + }; + }; + environment.etc."yt-dlp.conf".text = '' -o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s --no-mtime diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..3050239 --- /dev/null +++ b/install.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "==> Checking for Nix..." +if ! command -v nix >/dev/null 2>&1; then + echo "==> Installing Nix vis Determinate Systems installer..." + curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install + . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh +else + echo "Nix already installed, skipping." +fi + +echo "==> Copying config to /etc/nix-darwin..." +sudo mkdir -p /etc/nix-darwin +sudo cp -r . /etc/nix-darwin +sudo chown -R root:wheel /etc/nix-darwin + +echo "==> Renaming conflicting shell files if present..." +[ -f /etc/bashrc ] && sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin +[ -f /etc/zshrc ] && sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin +[ -f /etc/zshenv ] && sudo mv /etc/zshenv /etc/zshenv.before-nix-darwin + +echo "==> Bootstraping nix-darwin..." +nix run nix-darwin/master#darwin-rebuild -- switch --flake /etc/nix-darwin + +echo "==> Done! Restart your terminal to apply all changes." \ No newline at end of file