Skip to content

nix-darwin #13

@wangkev

Description

@wangkev

First off, thanks for creating doom and sharing your dotfiles - really appreciate it!

I understand that this config is geared toward nixos (and you don't use mac), but was wondering if you would be able to help me understand how I might adapt the libs (and general configs) to also work with darwin and specifically nix-darwin flakes.

For example, I think I need to adapt the mkHost function, to something like:

  mkHost = path: attrs @ { system ? system, ... }:
    if system == "x86_64-darwin" then inputs.nix-darwin.lib.darwinSystem else nixosSystem {
      inherit system;
      specialArgs = { inherit lib inputs; };
      modules = [
        {
          nixpkgs.pkgs = pkgs;
          networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
        }
        (filterAttrs (n: v: !elem n [ "system" ]) attrs)
        ../.
        (import path)
      ];
    };

and in flake.nix, need to additionally set darwinModules and darwinConfigurations.

      nixosModules = # shared modules and maybe some nixos specific modules in ./modules/os-specific/nixos
      nixosConfigurations = # nixos specific hosts

      darwinModules = # shared modules and maybe some darwin specific modules in ./modules/os-specific/darwin
      darwinConfigurations = # darwin specific hosts

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions