From e2cb67573509e4bde23c2ca5aa093794ddfb69b1 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 17 Feb 2024 22:51:13 +0100 Subject: Nix: Initial darwin setup --- hosts/darwin.nix | 4 ++++ hosts/default.nix | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 hosts/darwin.nix (limited to 'hosts') diff --git a/hosts/darwin.nix b/hosts/darwin.nix new file mode 100644 index 0000000..5c17eea --- /dev/null +++ b/hosts/darwin.nix @@ -0,0 +1,4 @@ +{...}: +{ + services.nix-daemon.enable = true; +} \ No newline at end of file diff --git a/hosts/default.nix b/hosts/default.nix index 7623863..0fc93e7 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,6 +1,6 @@ -{ lib, inputs, secrets, dotfiles, hosts, hardwares, systems, isNixOS, isIso, isHardware, user, nixpkgs, home-manager, ... }: +{ lib, inputs, secrets, dotfiles, hosts, hardwares, systems, isNixOS, isMacOS, isIso, isHardware, user, nixpkgs, home-manager, nix-darwin, ... }: let - mkHost = { host, hardware, stateVersion, system, timezone, location, extraOverlays, extraModules }: isNixOS: isIso: isHardware: + mkHost = { host, hardware, stateVersion, system, timezone, location, extraOverlays, extraModules }: isNixOS: isMacOS: isIso: isHardware: let pkgs = import nixpkgs { inherit system; @@ -43,6 +43,14 @@ let } ] ++ extraSpecialModules; } + else if isMacOS + then + nix-darwin.lib.darwinSystem + { + inherit system; + modules = [ ./darwin.nix ]; + specialArgs = extraArgs; + } else home-manager.lib.homeManagerConfiguration { @@ -63,4 +71,4 @@ in Map each element of the list applying the mkHost function to its elements and returning a set in the listToAttrs format builtins.listToAttrs on the result */ -builtins.listToAttrs (map (mInput@{ host, hardware, system, ... }: { name = host + "-" + hardware + "-" + system; value = mkHost mInput isNixOS isIso isHardware; }) permutatedHosts) +builtins.listToAttrs (map (mInput@{ host, hardware, system, ... }: { name = host + "-" + hardware + "-" + system; value = mkHost mInput isNixOS isMacOS isIso isHardware; }) permutatedHosts) -- cgit 1.4.1