···44 set dir $argv[2]
55 end
6677- test (realpath $dir) != /
77+ test (builtin realpath --no-symlinks $dir) != /
88 or return 1
991010 if test -e $dir/$argv[1]
1111- realpath $dir/$argv[1]
1111+ builtin realpath --no-symlinks $dir/$argv[1]
1212 else
1313 upfind $argv[1] $dir/..
1414 end
···11-{
22- description = "Darwin flake configuration";
33-44- inputs = {
55- nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
66- unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
77-88- nix-darwin = {
99- # https://github.com/LnL7/nix-darwin/pull/741
1010- url = "github:Enzime/nix-darwin/default-flake-location";
1111- inputs.nixpkgs.follows = "nixpkgs";
1212- };
1313-1414- home-manager-config = {
1515- # This seems to be the only way to properly deal with the dotfiles
1616- # checkout being in a different place for different usernames:
1717- # https://discourse.nixos.org/t/flake-input-from-local-git-repo/27609/3
1818- # In theory I could probably even add the registry as part of nix-darwin activation,
1919- # although it's kinda chicken + egg. Maybe just part of yadm bootstrap?
2020- #
2121- # Also TBD: does it require things to be checked in? At least it's still local,
2222- # so I guess it would just require committing home-manager config before evaluation,
2323- # which is a pain but better than having to push to github first.
2424- url = "flake:home-manager-configuration";
2525- inputs.nixpkgs.follows = "nixpkgs";
2626- inputs.unstable.follows = "unstable";
2727- };
2828- };
2929-3030- outputs = { self, nix-darwin, nixpkgs, home-manager-config, ... } @ inputs:
3131- let
3232- hosts = {
3333- MacBook-Pro = {
3434- system = "aarch64-darwin";
3535- user = "ianchamberlain";
3636- };
3737- ichamberlain-mbp-2 = {
3838- system = "x86_64-darwin";
3939- user = "ichamberlain";
4040- };
4141- };
4242- inherit (nixpkgs) lib;
4343- inherit (nix-darwin.lib) darwinSystem;
4444- in {
4545- darwinConfigurations = lib.mapAttrs (hostname: host: darwinSystem {
4646- inherit (host) system;
4747-4848- modules = [
4949- ./configuration.nix
5050- home-manager-config.inputs.home-manager.darwinModules.home-manager
5151- home-manager-config.homeConfigurations.${host.user}
5252- ];
5353- specialArgs = { inherit self host; };
5454- }) hosts;
5555-5656- # Expose the package set, including overlays, for convenience.
5757- darwinPackages = lib.mapAttrs (hostname: _: self.darwinConfigurations.${hostname}.pkgs) hosts;
5858- };
5959-}