diff --git a/flake.nix b/flake.nix index 411c84cd..32c68e6e 100644 --- a/flake.nix +++ b/flake.nix @@ -123,7 +123,6 @@ ; in recursiveMergeAttrs [ - # Templates { inherit lib; templates = { @@ -134,6 +133,9 @@ }; }; overlays.default = import ./overlays { flake = self; }; + darwinModules.default = import ./modules/nix-darwin; + homeModules.default = import ./modules/home-manager; + nixosModules.default = import ./modules/nixos; } # NixOS configs diff --git a/hosts/Sekai-MacBook-Pro/default.nix b/hosts/Sekai-MacBook-Pro/default.nix index fbb74174..309e4ff6 100644 --- a/hosts/Sekai-MacBook-Pro/default.nix +++ b/hosts/Sekai-MacBook-Pro/default.nix @@ -1,7 +1,7 @@ -{ ... }: +{ flake, ... }: { - imports = [ ../../modules/nix-darwin ]; + imports = [ flake.outputs.darwinModules.default ]; mainUser.username = "thiago.okada"; diff --git a/hosts/hachune-nixos/default.nix b/hosts/hachune-nixos/default.nix index 0639f099..fc7fb7ba 100644 --- a/hosts/hachune-nixos/default.nix +++ b/hosts/hachune-nixos/default.nix @@ -9,15 +9,12 @@ ... }: -let - inherit (flake) inputs; -in { imports = [ ./hardware-configuration.nix - ../../modules/nixos - inputs.hardware.nixosModules.common-cpu-amd - inputs.hardware.nixosModules.common-gpu-amd + flake.inputs.hardware.nixosModules.common-cpu-amd + flake.inputs.hardware.nixosModules.common-gpu-amd + flake.outputs.nixosModules.default ]; device = { diff --git a/hosts/miku-nixos/default.nix b/hosts/miku-nixos/default.nix index 00f8e009..e2c8aed2 100644 --- a/hosts/miku-nixos/default.nix +++ b/hosts/miku-nixos/default.nix @@ -9,14 +9,11 @@ ... }: -let - inherit (flake) inputs; -in { imports = [ ./hardware-configuration.nix - ../../modules/nixos - inputs.hardware.nixosModules.common-cpu-intel + flake.inputs.hardware.nixosModules.common-cpu-intel + flake.outputs.nixosModules.default ]; nixos = { diff --git a/hosts/mirai-nixos/default.nix b/hosts/mirai-nixos/default.nix index cbd48fc2..7120d64e 100644 --- a/hosts/mirai-nixos/default.nix +++ b/hosts/mirai-nixos/default.nix @@ -8,8 +8,8 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../modules/nixos flake.inputs.disko.nixosModules.disko + flake.outputs.nixosModules.default ]; disko.devices = import ./disk-config.nix; diff --git a/hosts/sankyuu-nixos/default.nix b/hosts/sankyuu-nixos/default.nix index ec5873e4..8a08b4af 100644 --- a/hosts/sankyuu-nixos/default.nix +++ b/hosts/sankyuu-nixos/default.nix @@ -9,14 +9,11 @@ ... }: -let - inherit (flake) inputs; -in { imports = [ ./hardware-configuration.nix - ../../modules/nixos - inputs.hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 + flake.inputs.hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 + flake.outputs.nixosModules.default ]; device = { diff --git a/hosts/zachune-nixos/default.nix b/hosts/zachune-nixos/default.nix index bc347f50..6ff2e6f9 100644 --- a/hosts/zachune-nixos/default.nix +++ b/hosts/zachune-nixos/default.nix @@ -13,8 +13,8 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../modules/nixos flake.inputs.disko.nixosModules.disko + flake.outputs.nixosModules.default ] ++ oci-common.imports; boot = { diff --git a/hosts/zatsune-nixos/default.nix b/hosts/zatsune-nixos/default.nix index 16c06f8a..28ffc045 100644 --- a/hosts/zatsune-nixos/default.nix +++ b/hosts/zatsune-nixos/default.nix @@ -13,8 +13,8 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../modules/nixos flake.inputs.disko.nixosModules.disko + flake.outputs.nixosModules.default ] ++ oci-common.imports; boot = { diff --git a/lib/flake-helpers.nix b/lib/flake-helpers.nix index b8d51b54..a056f0be 100644 --- a/lib/flake-helpers.nix +++ b/lib/flake-helpers.nix @@ -154,7 +154,7 @@ in username ? "thiagoko", homePath ? "/home", homeDirectory ? "${homePath}/${username}", - configuration ? ../modules/home-manager, + configuration ? self.outputs.homeModules.default, deviceType ? "desktop", extraModules ? [ ], system ? "x86_64-linux",