Compare commits

...

17 Commits

Author SHA1 Message Date
Renovate Bot eb54088230 chore(deps): update gitea actions to de0fac2
CI / flake (pull_request) Successful in 2m3s
2026-06-03 00:01:01 +00:00
lyrathorpe 775fdba160 Merge pull request 'feat(darwin): declare Mac App Store apps' (#11) from feat/darwin-mas-apps into main
CI / flake (push) Successful in 1m45s
Reviewed-on: #11
2026-06-02 17:36:10 +01:00
lyrathorpe 110890508f feat: also include hass and infuse
CI / flake (pull_request) Successful in 1m46s
2026-06-02 17:34:46 +01:00
lyrathorpe 27e12990f4 feat: add mas
CI / flake (push) Successful in 1m58s
2026-06-02 17:33:06 +01:00
Emma Thorpe b47610a2bc feat(darwin): declare Mac App Store apps
CI / flake (pull_request) Successful in 1m58s
Add the installed App Store apps to homebrew.masApps so mas manages them declaratively: Amphetamine, Apple Configurator, Game Controller Tester, Keynote, Numbers, Pages, PDFgear, PL2303Serial, WireGuard.
2026-06-02 16:31:02 +00:00
lyrathorpe eeb1c72d7f Merge pull request 'fix(home-manager): back up clobbered dotfiles on activation' (#10) from fix/hm-dotfile-backup into main
CI / flake (push) Successful in 1m52s
Reviewed-on: #10
2026-06-02 17:30:29 +01:00
Emma Thorpe 27e91508cc fix(home-manager): back up clobbered dotfiles on activation
CI / flake (pull_request) Successful in 1m52s
Set home-manager.backupFileExtension = "backup" on the NixOS and Darwin base modules. Existing machines carry hand-written ~/.zshrc and ~/.zshenv that home-manager would refuse to overwrite, aborting activation. With a backup extension, the originals are saved as .backup and activation proceeds. The oh-my-zsh setup is already declared in lyrathorpe/home/shell.nix, so the generated files supersede the old ones.
2026-06-02 16:28:28 +00:00
lyrathorpe c339b42b45 fix: enable homebrew auto-migrate
CI / flake (push) Successful in 1m50s
2026-06-02 17:21:48 +01:00
lyrathorpe 0360442d44 Merge pull request 'Feat/nix darwin' (#9) from feat/nix-darwin into main
CI / flake (push) Successful in 1m46s
Reviewed-on: #9
2026-06-02 17:15:08 +01:00
Emma Thorpe ba2cb13563 feat(darwin): declare brew/nixpkgs packages for macOS continuity
CI / flake (pull_request) Successful in 2m7s
Migrate the prior Homebrew package set onto the nix-darwin host. Leaf CLI formulae move to nixpkgs (environment.systemPackages); pure library deps are dropped since nix resolves them transitively. firefoxpwa and version-pinned llvm@21/lld@21/python@3.14 stay on brew. All GUI apps remain brew casks, since nixpkgs darwin GUI support is unreliable.
2026-06-02 16:12:42 +00:00
lyrathorpe a81064f086 Merge pull request 'chore(deps): update gitea actions (major)' (#6) from renovate/major-gitea-actions into main
CI / flake (push) Successful in 1m57s
Reviewed-on: #6
2026-06-02 17:11:50 +01:00
Emma Thorpe e67bc0f4d5 feat(darwin): wire nix-homebrew and make Homebrew authoritative
Add the nix-homebrew input and darwin module so the Homebrew prefix is installed and owned declaratively (no manual bootstrap), with enableRosetta for x86_64 formulae on Apple Silicon and user = host username.

Set homebrew.onActivation.cleanup = zap so the taps/brews/casks/masApps lists are authoritative: anything not declared is removed on activation.
2026-06-02 16:10:16 +00:00
Emma Thorpe 532e581696 feat(darwin): enable declarative Homebrew on the macOS host
Turn on nix-darwin's homebrew module with empty taps/brews/casks/masApps lists to fill in, onActivation autoUpdate+upgrade, and cleanup=none (manual formulae left intact; flip to zap for fully authoritative lists). Set system.primaryUser so brew activation runs as the host user.
2026-06-02 16:10:16 +00:00
Emma Thorpe 16cbbdf5e5 feat(darwin): add nix-darwin support with a default macOS host
Add the nix-darwin input (nix-darwin-26.05, follows nixpkgs) and a mkDarwinHost mirroring mkHost: shared commonModule (nixpkgs/nix settings) is factored out and reused, home-manager is wired via darwinModules, and identity is threaded through specialArgs.

New darwinConfigurations.lyrathorpe-mac (aarch64-darwin) reuses the cross-platform ./lyrathorpe/home modules (shell, git, editor); Linux-only sway/desktop modules are excluded. Build with: darwin-rebuild switch --flake .#lyrathorpe-mac.
2026-06-02 16:10:16 +00:00
lyrathorpe 03101eb666 Merge pull request 'ci: only run on nix-related changes' (#8) from ci/nix-path-filter into main
CI / flake (push) Successful in 1m56s
Reviewed-on: #8
2026-06-02 17:09:51 +01:00
Emma Thorpe 0346095822 ci: only run on nix-related changes
CI / flake (pull_request) Successful in 1m53s
Add path filters so the workflow triggers only when *.nix files, flake.lock, or the workflow itself change, skipping CI for docs/markdown/unrelated edits.
2026-06-02 15:58:34 +00:00
Renovate Bot c01bb46393 chore(deps): update gitea actions
CI / flake (pull_request) Successful in 1m49s
2026-06-02 15:49:36 +00:00
4 changed files with 306 additions and 15 deletions
+10 -2
View File
@@ -4,17 +4,25 @@ name: CI
on: on:
push: push:
branches: [main] branches: [main]
paths:
- "**.nix"
- "flake.lock"
- ".gitea/workflows/ci.yaml"
pull_request: pull_request:
paths:
- "**.nix"
- "flake.lock"
- ".gitea/workflows/ci.yaml"
jobs: jobs:
flake: flake:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Nix - name: Install Nix
uses: cachix/install-nix-action@v30 uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31
with: with:
extra_nix_config: | extra_nix_config: |
experimental-features = nix-command flakes experimental-features = nix-command flakes
Generated
+58
View File
@@ -1,5 +1,22 @@
{ {
"nodes": { "nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1778427648,
"narHash": "sha256-pt9KaDGsMyYWB9JeHs4XGHs870f1lOZe3vx9LpVIhUE=",
"owner": "Homebrew",
"repo": "brew",
"rev": "6f293daa9f9f5832e13b497976335e90509886d7",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.1.11",
"repo": "brew",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"locked": { "locked": {
"lastModified": 1761640442, "lastModified": 1761640442,
@@ -72,6 +89,45 @@
"type": "github" "type": "github"
} }
}, },
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1779036909,
"narHash": "sha256-zXcwYQGCT6pzinK+1dBB2ekTVtfxGZAapb3Evdcu4fY=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "56c666e108467d87d13508936aade6d567f2a501",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "nix-darwin-26.05",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src"
},
"locked": {
"lastModified": 1778851564,
"narHash": "sha256-p8wzcnpB2Iys+QzAKM9/Eyw/pUyqCO3sw/NCnDH4dTE=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "b3a87b4793205cc111f3c61e25e018ffac3b8039",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixos-apple-silicon": { "nixos-apple-silicon": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@@ -149,6 +205,8 @@
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nixos-apple-silicon": "nixos-apple-silicon", "nixos-apple-silicon": "nixos-apple-silicon",
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
+80 -6
View File
@@ -15,6 +15,11 @@
# Apple Silicon (Asahi) support for the MacBook host. # Apple Silicon (Asahi) support for the MacBook host.
nixos-apple-silicon.url = "github:nix-community/nixos-apple-silicon"; nixos-apple-silicon.url = "github:nix-community/nixos-apple-silicon";
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs"; nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
# nix-darwin: manage macOS hosts from this same flake.
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# nix-homebrew: declaratively own and install the Homebrew prefix on macOS.
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
# Provides mkFlake: the systems/perSystem scaffolding used below. # Provides mkFlake: the systems/perSystem scaffolding used below.
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
@@ -28,6 +33,8 @@
home-manager, home-manager,
nixos-wsl, nixos-wsl,
nixos-apple-silicon, nixos-apple-silicon,
nix-darwin,
nix-homebrew,
... ...
}: }:
flake-parts.lib.mkFlake { inherit inputs; } ( flake-parts.lib.mkFlake { inherit inputs; } (
@@ -51,10 +58,8 @@
"lens-desktop" "lens-desktop"
]; ];
# Shared scaffolding for every host: common user, overlays, home-manager. # nixpkgs + nix-daemon settings shared by NixOS and Darwin hosts.
baseModules = [ commonModule = {
./lyrathorpe/user.nix
{
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) unfreePackages; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) unfreePackages;
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@@ -64,11 +69,19 @@
# Make `nix shell nixpkgs#...` and <nixpkgs> use the pinned nixpkgs. # Make `nix shell nixpkgs#...` and <nixpkgs> use the pinned nixpkgs.
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
} };
# Shared scaffolding for every NixOS host: common user, settings, home-manager.
baseModules = [
./lyrathorpe/user.nix
commonModule
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
# Back up pre-existing dotfiles (e.g. .zshrc) instead of aborting
# activation when home-manager would overwrite them.
home-manager.backupFileExtension = "backup";
} }
]; ];
@@ -99,6 +112,47 @@
]; ];
}; };
# Shared scaffolding for every Darwin (macOS) host.
darwinBaseModules = [
commonModule
nix-homebrew.darwinModules.nix-homebrew
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
# Back up pre-existing dotfiles (e.g. .zshrc) instead of aborting
# activation when home-manager would overwrite them.
home-manager.backupFileExtension = "backup";
}
];
# mkDarwinHost :: { system, username, fullName, modules, homeModules } -> darwinSystem
# Darwin counterpart of mkHost. macOS already owns the login user, so we
# only attach the platform and home-manager; no NixOS user module here.
mkDarwinHost =
{
system,
username,
fullName,
modules,
homeModules,
}:
nix-darwin.lib.darwinSystem {
specialArgs = { inherit inputs username fullName; };
modules =
darwinBaseModules
++ modules
++ [
{
nixpkgs.hostPlatform = system;
# macOS owns the account; point home-manager at its home dir.
users.users.${username}.home = "/Users/${username}";
home-manager.extraSpecialArgs = { inherit inputs username fullName; };
home-manager.users.${username}.imports = homeModules;
}
];
};
# Host table — declarative registry of every machine. To add a host: # Host table — declarative registry of every machine. To add a host:
# give it a name, its `system`, the owning user, and the module lists. # give it a name, its `system`, the owning user, and the module lists.
# mapAttrs below turns each entry into a nixosConfiguration of the same name. # mapAttrs below turns each entry into a nixosConfiguration of the same name.
@@ -147,11 +201,30 @@
]; ];
}; };
}; };
# Darwin host table — macOS machines built via mkDarwinHost. The shared
# ./lyrathorpe/home modules (shell, git, editor) are reused; the Linux-only
# desktop/sway modules are intentionally left out.
darwinHosts = {
lyrathorpe-mac = {
system = "aarch64-darwin";
username = "lyrathorpe";
fullName = "Lyra Thorpe";
modules = [
./system/machine/Darwin/configuration.nix
];
homeModules = [
./lyrathorpe/home
];
};
};
in in
{ {
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
]; ];
# perSystem is evaluated once per entry in `systems`; `pkgs` is the # perSystem is evaluated once per entry in `systems`; `pkgs` is the
@@ -180,8 +253,9 @@
''; '';
}; };
# Realise the host table: each `hosts` entry becomes a nixosConfiguration. # Realise the host tables: each entry becomes a {nixos,darwin}Configuration.
flake.nixosConfigurations = lib.mapAttrs (_name: mkHost) hosts; flake.nixosConfigurations = lib.mapAttrs (_name: mkHost) hosts;
flake.darwinConfigurations = lib.mapAttrs (_name: mkDarwinHost) darwinHosts;
} }
); );
} }
+151
View File
@@ -0,0 +1,151 @@
# Default nix-darwin host. Minimal macOS baseline; the user environment
# (shell, git, editor) is carried by the shared ./lyrathorpe/home modules,
# the same ones used by the Linux hosts. nixpkgs.hostPlatform is set by
# mkDarwinHost in flake.nix.
{ pkgs, username, ... }:
{
programs.zsh.enable = true;
# CLI tooling sourced from nixpkgs instead of Homebrew formulae. Pure library
# dependencies are omitted; nix pulls them into closures automatically.
environment.systemPackages = with pkgs; [
# Build & toolchain
autoconf
automake
cmake
coreutils
gcc
gettext
gnumake
pkgconf
ruby
zig
# Version control & dev workflow
pre-commit
deno
opentofu
# Compression
lz4
p7zip
xz
zstd
# Crypto & networking
gnupg
gnutls
openssl
pinentry_mac
unbound
wget
# Media
ffmpeg
svt-av1
yt-dlp
# Graphics / Vulkan / SDL
glslang
moltenvk
spirv-tools
vulkan-loader
vulkan-tools
SDL2
sdl3
# Embedded
esptool
picotool
# Misc utilities
f3
gnused
lua5_4
magic-wormhole
ncurses
mas
sqlite
];
# Account that runs user-level activation and Homebrew.
system.primaryUser = username;
# nix-homebrew owns and installs the Homebrew prefix declaratively, so brew
# itself no longer needs a manual bootstrap. enableRosetta permits x86_64
# formulae via Rosetta 2 on Apple Silicon.
nix-homebrew = {
autoMigrate = true;
enable = true;
enableRosetta = true;
user = username;
};
# Declarative Homebrew for packages with no nixpkgs equivalent or that must be
# the vendor build (GUI casks, Mac App Store apps).
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
upgrade = true;
# Lists below are authoritative: anything not declared is uninstalled.
cleanup = "zap";
};
taps = [ ];
# Formulae kept on brew: vendor PWA host and version-pinned toolchains that
# are simpler to track via brew than to match exactly in nixpkgs.
brews = [
"firefoxpwa"
"llvm@21"
"lld@21"
"python@3.14"
];
# GUI applications. macOS app bundles are managed as casks; nixpkgs darwin
# GUI support is unreliable, so these stay on brew for continuity.
casks = [
"alfred"
"android-platform-tools"
"angry-ip-scanner"
"arduino-ide"
"autodesk-fusion"
"bambu-studio"
"bitwarden"
"citrix-workspace"
"curseforge"
"discord"
"firefox"
"freecad"
"gcc-arm-embedded"
"google-chrome"
"istat-menus"
"iterm2"
"macfuse"
"microsoft-teams"
"nextcloud"
"obs"
"omnidisksweeper"
"openscad@snapshot"
"orcaslicer"
"plex"
"plexamp"
"postman"
"signal"
"steam"
"thunderbird"
"virtualbox"
"visual-studio-code"
"vnc-viewer"
"vscodium"
"winbox"
];
masApps = {
Amphetamine = 937984704;
"Apple Configurator" = 1037126344;
"Game Controller Tester" = 1500593102;
"Home Assistant" = 1099568401;
Infuse = 1136220934;
Keynote = 409183694;
Numbers = 409203825;
Pages = 409201541;
PDFgear = 6469021132;
PL2303Serial = 1624835354;
WireGuard = 1451685025;
};
};
# Used for backwards compatibility; read `darwin-rebuild changelog` before changing.
system.stateVersion = 5;
}