From b6711ec221e5fe932b07ebfacb477e5b4595f64d Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 09:46:14 -0400 Subject: [PATCH 01/23] initial commit --- README.md | 5 ++++ configuration.nix | 64 +++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 27 ++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 README.md create mode 100644 configuration.nix create mode 100644 flake.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..04933eb --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# My nix-darwin Configuration +This repo is meant to be a declarative setup for new macOS devices, specifically focused on the application installs. All GUI applications will be handled by homebrew and some brews or CLI tools. The more stable and maintained CLI tools are installed via nixpkgs. + +## Homebrew +I like using homebrew as my package manager for most apps as its really easy and convienent to run `brew upgrade` to update all apps in 1 go. I love nix for many other reasons but some of the packages on the stable branch aren't always up-to-date and take a while to update. diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..2354b92 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,64 @@ +{ config, pkgs, ... }: + +{ + nixpkgs.hostPlatform = "aarch64-darwin"; + + nix.enable = false; + + nix.settings.experimental-features = "nix-command flakes"; + + system.stateVersion = 6; + system.primaryUser = "briannelson"; + + environment.systemPackages = with pkgs; [ + ffmpeg + flac + helix + tea + yt-dlp + ]; + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + cleanup = "none"; + }; + + brews = [ + "bun" + "harper" + ]; + + casks = [ + "bitwarden" + "cap" + "discord" + "harper-desktop" + "librewolf" + "nextcloud" + "protonvpn" + "rustdesk" + "signal" + "twingate" + "vlc" + "vscodium" + "firefox" + ]; + }; + + environment.shellAliases = { + yt = "yt-dlp"; + ll = "ls -la"; + }; + + environment.etc."yt-dlp.conf".text = '' + -o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s + --no-mtime + --restrict-filenames + --embed-thumbnails + --embed-metadata + --format "bestvideo[height<=1080]+bestaudio/best[height<=1080]" + --merge-output-format mp4 + ''; +} \ No newline at end of file diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dfd6172 --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "Brian's macOS nix-darwin configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:nix-darwin/nix-darwin"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + nix-homebrew.url = "github:zhaofengli/nix-homebrew"; + }; + + outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: { + darwinConfigurations."YOUR-HOSTNAME" = nix-darwin.lib.darwinSystem { + modules = [ + ./configuration.nix + nix-homebrew.darwinModules.nix-homebrew + { + nix-homebrew = { + enable = true; + enableRosetta = true; + user = "briannelson"; + autoMigrate = true; + }; + } + ]; + }; + }; +} \ No newline at end of file From ca5ea4e1ab54baca394aef88747c453ded6e4d35 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 09:59:14 -0400 Subject: [PATCH 02/23] added ykman and updated README --- README.md | 5 +++++ configuration.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 04933eb..57a205b 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,8 @@ This repo is meant to be a declarative setup for new macOS devices, specifically ## Homebrew I like using homebrew as my package manager for most apps as its really easy and convienent to run `brew upgrade` to update all apps in 1 go. I love nix for many other reasons but some of the packages on the stable branch aren't always up-to-date and take a while to update. + +## Future Options +I like the option of setting the dock up using some of the options in nix-darwin but only on initial build. I found that getting the macOS machine setup with nix-darwin and setting all the dock apps was cool but if you made changes to to dock for whatever reason (installing a new app, having a different prefernce, etc.), rebuilding the system would then set the dock back to the original option. + +I think that the use of Homebrew can help with this a little bit in the sense that I can update most apps without having to rebuild the system. So making changes to the dock via the "normal" click and drag on macOS can stay persistent for the most part but remembering to set the change in the config will be important for rebuilds. diff --git a/configuration.nix b/configuration.nix index 2354b92..7dc1579 100644 --- a/configuration.nix +++ b/configuration.nix @@ -28,6 +28,7 @@ brews = [ "bun" "harper" + "ykman" ]; casks = [ From ea7507e7e3c0abded1d50cef95d7226374e09403 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 10:57:47 -0400 Subject: [PATCH 03/23] started on mac-settings --- mac-settings.nix | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mac-settings.nix diff --git a/mac-settings.nix b/mac-settings.nix new file mode 100644 index 0000000..c25b5c4 --- /dev/null +++ b/mac-settings.nix @@ -0,0 +1,65 @@ +# This is a WIP, this file is not yet imported to the config +{ config, ... }: + +{ + system.defaults = { + NSGlobalDomain = { + AppleEnableSwipeNavigateWithScrolls = true; + AppleIconAppearanceTheme = "RegularDark"; + AppleInterfaceStyle = "Dark"; + NSDocumentSaveNewDocumentsToCloud = false; + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + "com.apple.trackpad.enableSecondaryClick" = true; + }; + + controlcenter = { + AirDrop = 18; #true; + Bluetooth = 18; #true; + Sound = 18; #true; + }; + + dock = { + autohide = true; + largesize = 20; + magnification = 40; + mineffect = "scale"; + minimize-to-application = true; + # This is all an example of how to set the apps in the Dock. + # The key is to remember to update this before rebuilding. + # I may move this item to another file to keep things clean. + # persistent-apps = [ + # { + # app = "/Applications/Safari.app"; + # } + # { + # spacer = { + # small = true; + # }; + # } + # { + # folder = "/System/Applications/Utilities"; + # } + # { + # file = "/User/example/Downloads/test.csv"; + # } + # ] + wvous-br-corner = 11; # Launchpad or Apps + wvous-tl-corner = 13; # lock screen + }; + + finder = { + AppleShowAllExtensions = true; + AppleShowAllFiles = true; + FXPreferredViewStyle = "clmv"; + ShowPathbar = true; + }; + + magicmouse.MouseButtonMode = "TwoButton"; + + trackpad = { + TrackpadPinch = true; + TrackpadRightClick = true; + } + }; +} \ No newline at end of file From fe2053bd10365d12f72c464aa82635ffd5a6c010 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 11:06:07 -0400 Subject: [PATCH 04/23] fixed magnification value --- mac-settings.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mac-settings.nix b/mac-settings.nix index c25b5c4..794e2da 100644 --- a/mac-settings.nix +++ b/mac-settings.nix @@ -1,5 +1,5 @@ # This is a WIP, this file is not yet imported to the config -{ config, ... }: +{ ... }: { system.defaults = { @@ -21,8 +21,8 @@ dock = { autohide = true; - largesize = 20; - magnification = 40; + largesize = 40; + magnification = true; mineffect = "scale"; minimize-to-application = true; # This is all an example of how to set the apps in the Dock. @@ -60,6 +60,6 @@ trackpad = { TrackpadPinch = true; TrackpadRightClick = true; - } + }; }; } \ No newline at end of file From c9d180680df33a51946484e6c749e171901285d0 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 11:10:26 -0400 Subject: [PATCH 05/23] updated hostname --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index dfd6172..a6889ba 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ }; outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: { - darwinConfigurations."YOUR-HOSTNAME" = nix-darwin.lib.darwinSystem { + darwinConfigurations."briannelson" = nix-darwin.lib.darwinSystem { modules = [ ./configuration.nix nix-homebrew.darwinModules.nix-homebrew From f9a722aad8e14b35905a85d20a2ba09d5b705d9a Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 11:13:32 -0400 Subject: [PATCH 06/23] moved some cli stuff to cli-tools.nix --- cli-tools.nix | 18 ++++++++++++++++++ configuration.nix | 19 ++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 cli-tools.nix diff --git a/cli-tools.nix b/cli-tools.nix new file mode 100644 index 0000000..51b92a6 --- /dev/null +++ b/cli-tools.nix @@ -0,0 +1,18 @@ +{ config, ... }: + +{ + environment.shellAliases = { + yt = "yt-dlp"; + ll = "ls -la"; + }; + + environment.etc."yt-dlp.conf".text = '' + -o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s + --no-mtime + --restrict-filenames + --embed-thumbnails + --embed-metadata + --format "bestvideo[height<=1080]+bestaudio/best[height<=1080]" + --merge-output-format mp4 + ''; +} \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index 7dc1579..76a3c14 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,6 +1,10 @@ { config, pkgs, ... }: { + imports = [ + ./cli-tools.nix + ]; + nixpkgs.hostPlatform = "aarch64-darwin"; nix.enable = false; @@ -47,19 +51,4 @@ "firefox" ]; }; - - environment.shellAliases = { - yt = "yt-dlp"; - ll = "ls -la"; - }; - - environment.etc."yt-dlp.conf".text = '' - -o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s - --no-mtime - --restrict-filenames - --embed-thumbnails - --embed-metadata - --format "bestvideo[height<=1080]+bestaudio/best[height<=1080]" - --merge-output-format mp4 - ''; } \ No newline at end of file From 863b47e663d28b0da616b66a83ba84b6ce17137a Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 11:22:40 -0400 Subject: [PATCH 07/23] added git and obsidian --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index 76a3c14..5694a33 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,6 +17,7 @@ environment.systemPackages = with pkgs; [ ffmpeg flac + git helix tea yt-dlp @@ -42,6 +43,7 @@ "harper-desktop" "librewolf" "nextcloud" + "obsidian" "protonvpn" "rustdesk" "signal" From 3cf16ff880a0ced4e0a284299f365939afc0890a Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 13:47:55 -0400 Subject: [PATCH 08/23] 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 From 8750caa5d2579693f804f49d192fad5299b0ce4c Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 13:52:19 -0400 Subject: [PATCH 09/23] updated README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 57a205b..c5748d1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # My nix-darwin Configuration This repo is meant to be a declarative setup for new macOS devices, specifically focused on the application installs. All GUI applications will be handled by homebrew and some brews or CLI tools. The more stable and maintained CLI tools are installed via nixpkgs. +## Installation +1. Clone this repo onto the machine (probably fastest via usb) or install `tea` seperatly and run `tea clone https://git.briannelson.dev/brian/nix-darwin.git` +2. `cd` into the repo +3. Run `./install.sh` this will run a bash script that handles all of the installation of nix, file renaming and copying the files to the correct directory. + ## Homebrew I like using homebrew as my package manager for most apps as its really easy and convienent to run `brew upgrade` to update all apps in 1 go. I love nix for many other reasons but some of the packages on the stable branch aren't always up-to-date and take a while to update. From 2bb2eaa7517291119e40ca9ece2756352d1fe6de Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 13:52:55 -0400 Subject: [PATCH 10/23] updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5748d1..22cfc57 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repo is meant to be a declarative setup for new macOS devices, specifically focused on the application installs. All GUI applications will be handled by homebrew and some brews or CLI tools. The more stable and maintained CLI tools are installed via nixpkgs. ## Installation -1. Clone this repo onto the machine (probably fastest via usb) or install `tea` seperatly and run `tea clone https://git.briannelson.dev/brian/nix-darwin.git` +1. Clone this repo onto the machine (probably fastest via usb) or install `git` seperatly and run `git clone https://git.briannelson.dev/brian/nix-darwin.git` 2. `cd` into the repo 3. Run `./install.sh` this will run a bash script that handles all of the installation of nix, file renaming and copying the files to the correct directory. From 8b159a2eeeb5efdb0770acc0ecd2391aff380ab6 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 14:00:20 -0400 Subject: [PATCH 11/23] added mac-settings to imports --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 5694a33..8053edc 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,6 +3,7 @@ { imports = [ ./cli-tools.nix + ./mac-settings.nix ]; nixpkgs.hostPlatform = "aarch64-darwin"; From 32d5892ddd321d2e547ac84398685656b269c5d1 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Tue, 20 Oct 2026 14:05:20 -0400 Subject: [PATCH 12/23] updated install script for usb installation --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 3050239..2fee2b0 100644 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ fi echo "==> Copying config to /etc/nix-darwin..." sudo mkdir -p /etc/nix-darwin -sudo cp -r . /etc/nix-darwin +sudo cp -r "$(pwd)/." /etc/nix-darwin sudo chown -R root:wheel /etc/nix-darwin echo "==> Renaming conflicting shell files if present..." From ba26a2c3a28e5fbd566c76ce2acd2476d007824d Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Mon, 2 Nov 2026 10:43:01 -0500 Subject: [PATCH 13/23] added packages and brews --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index 8053edc..ae655a0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,6 +20,7 @@ flac git helix + nicotine-plus tea yt-dlp ]; @@ -34,6 +35,7 @@ brews = [ "bun" "harper" + "rust" "ykman" ]; From ef2fe843b1d3d4f2aa93b948c28abde7b8a58ad8 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 17:59:45 -0500 Subject: [PATCH 14/23] moved some brews to pkgs and changed hostname --- configuration.nix | 7 +++++-- flake.nix | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configuration.nix b/configuration.nix index ae655a0..055acd2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -16,12 +16,16 @@ system.primaryUser = "briannelson"; environment.systemPackages = with pkgs; [ + exif + exiftool ffmpeg flac git helix + librewolf nicotine-plus tea + vlc yt-dlp ]; @@ -43,15 +47,14 @@ "bitwarden" "cap" "discord" + "docker-desktop" "harper-desktop" - "librewolf" "nextcloud" "obsidian" "protonvpn" "rustdesk" "signal" "twingate" - "vlc" "vscodium" "firefox" ]; diff --git a/flake.nix b/flake.nix index a6889ba..d7ab37d 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ }; outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: { - darwinConfigurations."briannelson" = nix-darwin.lib.darwinSystem { + darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem { modules = [ ./configuration.nix nix-homebrew.darwinModules.nix-homebrew From ec53448c908e4b37446c967748b63869d8a9ce01 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 18:02:57 -0500 Subject: [PATCH 15/23] git isnt a program in nix --- cli-tools.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/cli-tools.nix b/cli-tools.nix index e4c5f16..1e96e2d 100644 --- a/cli-tools.nix +++ b/cli-tools.nix @@ -6,18 +6,13 @@ ll = "ls -la"; }; - programs.git = { - enable = true; - config = { - user = { - name = "Brian Nelson"; - email = "brian@briannelson.dev"; - }; - init = { - defaultBranch = "main"; - }; - }; - }; + environment.etc."gitconfig".text = '' + [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 From a1b639bfa591595a13f19e8cc9836fd8c3c8b669 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 18:04:08 -0500 Subject: [PATCH 16/23] allow unfree --- configuration.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configuration.nix b/configuration.nix index 055acd2..a086fca 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,6 +12,8 @@ nix.settings.experimental-features = "nix-command flakes"; + nixpkgs.config.allowUnsupportedSystem = true; + system.stateVersion = 6; system.primaryUser = "briannelson"; From 60f507311473b4bc42f572b7b6fbc6547e71a412 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 18:18:26 -0500 Subject: [PATCH 17/23] warn problems --- configuration.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configuration.nix b/configuration.nix index a086fca..c85eee4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -8,6 +8,10 @@ nixpkgs.hostPlatform = "aarch64-darwin"; + nixpkgs.config.problems.handlers = { + live555.broken = "warn"; + }; + nix.enable = false; nix.settings.experimental-features = "nix-command flakes"; From 262c5ae62348a4ae15676f81ce9bbb4db61df95a Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 18:19:35 -0500 Subject: [PATCH 18/23] fix mac-settings --- mac-settings.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mac-settings.nix b/mac-settings.nix index 794e2da..ffeed87 100644 --- a/mac-settings.nix +++ b/mac-settings.nix @@ -14,9 +14,9 @@ }; controlcenter = { - AirDrop = 18; #true; - Bluetooth = 18; #true; - Sound = 18; #true; + AirDrop = true; + Bluetooth = true; + Sound = true; }; dock = { From 0774d02c5c6b8fd883c62cce75f12b90e5c6200e Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Thu, 5 Nov 2026 18:22:06 -0500 Subject: [PATCH 19/23] vlc as cask --- configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index c85eee4..a6e34b2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -31,7 +31,6 @@ librewolf nicotine-plus tea - vlc yt-dlp ]; @@ -61,6 +60,7 @@ "rustdesk" "signal" "twingate" + "vlc" "vscodium" "firefox" ]; From 1368ac7d233561ab8ed32992fbbe98366f45c8e2 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Fri, 6 Nov 2026 09:16:38 -0500 Subject: [PATCH 20/23] added task-manager --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index a6e34b2..762b70c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -59,6 +59,7 @@ "protonvpn" "rustdesk" "signal" + "task-manager-tmog" "twingate" "vlc" "vscodium" From 6b61eaf75d4f75b39d5345c65af16b5ea36703fc Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Fri, 6 Nov 2026 10:37:18 -0500 Subject: [PATCH 21/23] added libreoffice --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 762b70c..3c3882e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -54,6 +54,7 @@ "discord" "docker-desktop" "harper-desktop" + "libreoffice" "nextcloud" "obsidian" "protonvpn" From f36234ea8c6352f88e592668e123d8062664f97b Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Fri, 6 Nov 2026 11:03:32 -0500 Subject: [PATCH 22/23] added cupsadmin as input and native build --- cli-tools.nix | 18 +++++++++++++++++- flake.nix | 6 ++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cli-tools.nix b/cli-tools.nix index 1e96e2d..bc64c68 100644 --- a/cli-tools.nix +++ b/cli-tools.nix @@ -1,6 +1,22 @@ -{ config, ... }: +{ inputs, ... }: { + system.activationScripts.postActivation.text = '' + stamp=/usr/local/share/cupsadmin.stamp + want="${inputs.cupsadmin}" + if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then + echo "building cupsadmin..." + tmp=$(mktmp -d) + cp -R "$want"/. "$tmp" + chmod -R u+w "$tmp" + ( cd "$tmp" && /user/bin/swift build -c release ) \ + && install -m 755 "$tmp/.build/release/cupsadmin" /usr/local/bin/cupsadmin \ + && mkdir -p /usr/local/share && echo #$want" > "$stamp" \ + || echo "cupsadmin build failed, skipping" + rm -rf "$tmp" + fi + ''; + environment.shellAliases = { yt = "yt-dlp"; ll = "ls -la"; diff --git a/flake.nix b/flake.nix index d7ab37d..9a0ad75 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,16 @@ nix-darwin.url = "github:nix-darwin/nix-darwin"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-homebrew.url = "github:zhaofengli/nix-homebrew"; + + cupsadmin = { + url = "github:kfattic/cupsadmin"; + flake = false; + }; }; outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: { darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem { + specialArgs = { inherit inputs; }; modules = [ ./configuration.nix nix-homebrew.darwinModules.nix-homebrew From b4ce55c1514e4175cfb464bd6f85f69b9df4c577 Mon Sep 17 00:00:00 2001 From: Brian Nelson Date: Sat, 7 Nov 2026 08:07:54 -0500 Subject: [PATCH 23/23] changed cupsadmin --- cli-tools.nix | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/cli-tools.nix b/cli-tools.nix index bc64c68..00b551f 100644 --- a/cli-tools.nix +++ b/cli-tools.nix @@ -1,19 +1,24 @@ -{ inputs, ... }: +{ inputs, pkgs, ... }: + +let + cupsadminPkg = pkgs.fetchurl { + url = "https://github.com/kfattic/cupsadmin/releases/download/v1.4.1/cupsadmin-1.4.1.pkg"; + hash = "sha256-DyIyDYSjAlcU7ivyfldMapIZw5nczEBXfnLicnK6k7Y="; + }; +in { system.activationScripts.postActivation.text = '' - stamp=/usr/local/share/cupsadmin.stamp - want="${inputs.cupsadmin}" + want="${cupsadminPkg}" + stamp=/usr/local/share/cupsadmin-pkg.stamp if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then - echo "building cupsadmin..." - tmp=$(mktmp -d) - cp -R "$want"/. "$tmp" - chmod -R u+w "$tmp" - ( cd "$tmp" && /user/bin/swift build -c release ) \ - && install -m 755 "$tmp/.build/release/cupsadmin" /usr/local/bin/cupsadmin \ - && mkdir -p /usr/local/share && echo #$want" > "$stamp" \ - || echo "cupsadmin build failed, skipping" - rm -rf "$tmp" + echo "installing cupsadmin..." + if /usr/sbin/installer -pkg "$want" -target /; then + mkdir -p /usr/local/share + echo "$want" > "$stamp" + else + echo "cupsadmin install failed, skipping" + fi fi '';