hlissner / dotfiles

And I say hey, what's going on?
https://youtu.be/ZZ5LpwO-An4
MIT License
1.62k stars 98 forks source link

nix-darwin #13

Open wangkev opened 3 years ago

wangkev commented 3 years ago

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!