Compare commits

...

20 Commits

Author SHA1 Message Date
29314ffa7b Update README.md 2026-11-13 10:56:46 -05:00
3d01855c3d added homebrew.autoMigrate 2026-11-13 10:08:22 -05:00
e5a27bcbd3 added altersend to work dock 2026-11-12 20:06:40 -05:00
2e34604ac5 turned personalized advertising off 2026-11-12 16:44:29 -05:00
c1f9a1d8e6 added altersend to personal dock 2026-11-12 16:30:46 -05:00
d227e5c9e1 updated work profile username 2026-11-12 10:52:36 -05:00
bf2b9c8762 dock apps for work 2026-11-12 10:14:11 -05:00
9ebe106841 fix config 2026-11-11 08:17:01 -05:00
700fbdc2b4 added nd to aliases 2026-11-11 08:15:11 -05:00
6ee6cad1df updated apps 2026-11-11 08:13:21 -05:00
d37abc556d updated nixpkgs 2026-11-10 16:19:31 -05:00
928b090957 updated apps and added touchId for sudo 2026-11-10 15:05:19 -05:00
6b9a18c948 updated README 2026-11-10 14:38:27 -05:00
51f82bd25f note about adding google chrome 2026-11-10 11:44:54 -05:00
6c0d871f16 added 1Pass to work and set work dock apps 2026-11-10 11:41:10 -05:00
0a9c270e31 added apps to personal dock 2026-11-10 11:33:50 -05:00
833cad7df8 added prismlauncher to personal 2026-11-09 19:16:22 -05:00
25cf488f18 added fladder to personal 2026-11-09 18:49:08 -05:00
9542e348cd added rusty-pw as global 2026-11-09 18:39:27 -05:00
d8ebcad70c updated README 2026-11-09 18:31:37 -05:00
11 changed files with 123 additions and 39 deletions

View File

@@ -1,15 +1,33 @@
# My nix-darwin Configuration # 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. 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 This config contains options for both personal user and work use. There are shared packages found in [modules/apps](./modules/apps.nix) along with "profile" specific packages in their respective directories [profiles/personal](./profiles/personal/) and [profiles/work](./profiles/work/).
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.
> [!important]
> Ignore the `install.sh` file for now, it's out dated and I don't believe will work in the current state.
> I'll think about adding a new install script but the default installation by cloning the repo into `/etc/nix-darwin` works pretty good.
## Installation
1. Have an implementation of nix installed [nixos.org](https://nixos.org/download/)
2. 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`
3. Copy the repo into `/etc/nix-darwin`
```bash
sudo mkdir -p /etc/nix-darwin
sudo chown $(id -nu):$(id -ng) /etc/nix-darwin
sudo cp [PATH/TO/REPO] /etc/nix-darwin
```
4. Install nix-darwin and the profile you want with
```bash
sudo nix run nix-darwin/nix-darwin-26.05#darwin-rebuild --extra-experimental-features "nix-command flakes" -- switch --flake "/etc/nix-darwin#PROFILE_NAME"
# where PROFILE_NAME is either personal or work
```
5. Maintianing nix-darwin if any changes get made locally you can run the rebuild switch command. If changes get made remotely make sure to run `git pull` then the rebuild switch command.
```bash
cd /etc/nix-darwin
git pull
sudo darwin-rebuild switch --flake ".#PROFILE"
```
## Homebrew ## 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. 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.

23
flake.lock generated
View File

@@ -76,7 +76,28 @@
"inputs": { "inputs": {
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew", "nix-homebrew": "nix-homebrew",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"rusty-pw": "rusty-pw"
}
},
"rusty-pw": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1792878430,
"narHash": "sha256-SZm2FqJr6tWrDdoEBa1+WUmSQZn514uXulM9opozoQ8=",
"ref": "refs/heads/main",
"rev": "d8faadac139e0856c6730cf9f5fcc74383362bef",
"revCount": 13,
"type": "git",
"url": "https://git.briannelson.dev/brian/rusty-pw"
},
"original": {
"type": "git",
"url": "https://git.briannelson.dev/brian/rusty-pw"
} }
} }
}, },

View File

@@ -6,13 +6,18 @@
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05"; nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
nix-homebrew.url = "github:zhaofengli/nix-homebrew"; nix-homebrew.url = "github:zhaofengli/nix-homebrew";
rusty-pw = {
url = "git+https://git.briannelson.dev/brian/rusty-pw";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }:
let let
mkDarwin = { profile, user, system ? "aarch-64-dawin" }: mkDarwin = { profile, user, system ? "aarch-64-dawin" }:
nix-darwin.lib.darwinSystem { nix-darwin.lib.darwinSystem {
specialArgs = { inherit user system; }; specialArgs = { inherit inputs user system; };
modules = [ modules = [
./modules ./modules
./profiles/${profile} ./profiles/${profile}
@@ -22,6 +27,7 @@
enable = true; enable = true;
enableRosetta = true; enableRosetta = true;
user = "briannelson"; user = "briannelson";
autoMigrate = true;
}; };
} }
]; ];
@@ -30,7 +36,7 @@
{ {
darwinConfigurations = { darwinConfigurations = {
personal = mkDarwin { profile = "personal"; user = "briannelson"; }; personal = mkDarwin { profile = "personal"; user = "briannelson"; };
work = mkDarwin { profile = "work"; user = "YOUR-WORK-USERNAME"; }; work = mkDarwin { profile = "work"; user = "briannelson"; };
}; };
}; };
} }

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { inputs, pkgs, ... }:
{ {
# This file installs these apps on all configurations # This file installs these apps on all configurations
@@ -12,11 +12,16 @@
archiveApps = []; archiveApps = [];
nixpkgs.overlays = [
inputs.rusty-pw.overlays.default
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
exif exif
exiftool exiftool
git git
helix helix
rusty-pw
]; ];
homebrew.brews = [ homebrew.brews = [
@@ -24,10 +29,10 @@
"defaultbrowser" "defaultbrowser"
"harper" "harper"
"rust" "rust"
"ykman"
]; ];
homebrew.casks = [ homebrew.casks = [
"altersend"
"bitwarden" "bitwarden"
"harper-desktop" "harper-desktop"
"nextcloud" "nextcloud"

View File

@@ -8,6 +8,8 @@
system.stateVersion = 6; system.stateVersion = 6;
system.primaryUser = "briannelson"; system.primaryUser = "briannelson";
security.pam.services.sudo_local.touchIdAuth = true;
homebrew = { homebrew = {
enable = true; enable = true;
onActivation = { onActivation = {

View File

@@ -3,6 +3,7 @@
{ {
environment.shellAliases = { environment.shellAliases = {
ll = "ls -la"; ll = "ls -la";
nd = "cd /etc/nix-darwin";
}; };
environment.etc."gitconfig".text = '' environment.etc."gitconfig".text = ''

View File

@@ -20,29 +20,11 @@
dock = { dock = {
autohide = true; autohide = true;
largesize = 40; tilesize = 45;
largesize = 85;
magnification = true; magnification = true;
mineffect = "scale"; mineffect = "scale";
minimize-to-application = true; 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-br-corner = 11; # Launchpad or Apps
wvous-tl-corner = 13; # lock screen wvous-tl-corner = 13; # lock screen
}; };
@@ -60,5 +42,9 @@
TrackpadPinch = true; TrackpadPinch = true;
TrackpadRightClick = true; TrackpadRightClick = true;
}; };
CustomUserPreferences = {
"com.apple.AdLib".allowApplePersonalizedAdvertising = false;
};
}; };
} }

View File

@@ -15,7 +15,9 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
ffmpeg ffmpeg
flac flac
fladder
librewolf librewolf
qbittorrent
tea tea
yt-dlp yt-dlp
]; ];
@@ -29,6 +31,7 @@
"discord" "discord"
"docker-desktop" "docker-desktop"
"libreoffice" "libreoffice"
"prismlauncher"
"protonvpn" "protonvpn"
"rustdesk" "rustdesk"
]; ];

View File

@@ -5,4 +5,24 @@
./cli-tools.nix ./cli-tools.nix
./apps.nix ./apps.nix
]; ];
system.defaults.dock = {
persistent-apps = [
{ app = "/System/Applications/Apps.app"; }
{ app = "/Applications/Nix Apps/LibreWolf.app"; }
{ app = "/System/Applications/Utilities/Terminal.app"; }
{ app = "/System/Applications/Messages.app"; }
{ app = "/Applications/Obsidian.app"; }
{ app = "/Applications/VSCodium.app"; }
{ app = "/System/Applications/Maps.app"; }
{ app = "/System/Applications/Calendar.app"; }
{ app = "/System/Applications/Reminders.app"; }
{ app = "/Applications/Bitwarden.app"; }
{ app = "/Applications/ProtonVPN.app"; }
{ app = "/Applications/Nix Apps/Fladder.app"; }
{ app = "/System/Applications/App Store.app"; }
{ app = "/Applications/AlterSend.app"; }
{ app = "/System/Applications/System Settings.app"; }
];
};
} }

View File

@@ -7,7 +7,13 @@
environment.systemPackages = with pkgs; []; environment.systemPackages = with pkgs; [];
homebrew.brews = []; homebrew.brews = [
"ykman"
];
homebrew.casks = []; homebrew.casks = [
"1Password"
# I would add google chrome but that will be installed by Mosyle
# "google-chrome"
];
} }

View File

@@ -5,4 +5,20 @@
./apps.nix ./apps.nix
./cli-tools.nix ./cli-tools.nix
]; ];
system.defaults.dock = {
persistent-apps = [
{ app = "/System/Applications/Apps.app"; }
{ app = "/Applications/Firefox.app"; }
{ app = "/System/Applications/Utilities/Terminal.app"; }
{ app = "/Applications/Obsidian.app"; }
{ app = "/Applications/VSCodium.app"; }
{ app = "/System/Applications/App Store.app"; }
{ app = "/Applications/1Password.app"; }
{ app = "/Applications/Manager.app"; }
{ app = "/Applications/CUPS Admin.app"; }
{ app = "/Applications/AlterSend.app"; }
{ app = "/System/Applications/System Settings.app"; }
];
};
} }