diff --git a/hosts/nix-darwin/apavel-a01/meta.nix b/hosts/nix-darwin/apavel-a01/meta.nix index aa5d02c..98bc5ad 100644 --- a/hosts/nix-darwin/apavel-a01/meta.nix +++ b/hosts/nix-darwin/apavel-a01/meta.nix @@ -1,3 +1,4 @@ { system = "x86_64-darwin"; + enable = false; } diff --git a/hosts/nix-darwin/limontozu/meta.nix b/hosts/nix-darwin/limontozu/meta.nix index aa5d02c..98bc5ad 100644 --- a/hosts/nix-darwin/limontozu/meta.nix +++ b/hosts/nix-darwin/limontozu/meta.nix @@ -1,3 +1,4 @@ { system = "x86_64-darwin"; + enable = false; } diff --git a/modules/flake/configurations/default.nix b/modules/flake/configurations/default.nix index a9a36ff..0564e74 100644 --- a/modules/flake/configurations/default.nix +++ b/modules/flake/configurations/default.nix @@ -294,12 +294,15 @@ in # TODO: put in a more visible place default = { nixos = { - predicate = ({ root, host, configurationFiles, ... }: + predicate = ({ root, host, configurationFiles, ... }: let + meta = import "${root}/meta.nix"; + in and [ (! (host == "__template__")) (hasFiles [ "configuration.nix" "meta.nix" ] configurationFiles) + (meta.enable or true) ]); mkHost = ({ root, host, configurationFiles, ... }: let meta = import "${root}/meta.nix" // { @@ -320,12 +323,15 @@ in }); }; nix-on-droid = { - predicate = ({ root, host, configurationFiles, ... }: + predicate = ({ root, host, configurationFiles, ... }: let + meta = import "${root}/meta.nix"; + in and [ (! (host == "__template__")) (hasFiles [ "configuration.nix" "home.nix" "meta.nix" ] configurationFiles) + (meta.enable or true) ]); mkHost = ({ root, host, configurationFiles, ... }: let meta = import "${root}/meta.nix" // { @@ -340,7 +346,9 @@ in nix-darwin = { hostsName = "darwinHosts"; configurationsName = "darwinConfigurations"; - predicate = ({ root, host, configurationFiles, ... }: + predicate = ({ root, host, configurationFiles, ... }: let + meta = import "${root}/meta.nix"; + in and [ (! (host == "__template__")) (hasFiles @@ -349,6 +357,7 @@ in (hasDirectories [ "home" ] configurationFiles) + (meta.enable or true) ]); mkHost = ({ root, host, configurationFiles, ... }: let meta = import "${root}/meta.nix" // { @@ -371,12 +380,15 @@ in home-manager = { hostsName = "homeHosts"; configurationsName = "homeConfigurations"; - predicate = ({ root, host, configurationFiles, ... }: + predicate = ({ root, host, configurationFiles, ... }: let + meta = import "${root}/meta.nix"; + in and [ (! (host == "__template__")) (hasFiles [ "home.nix" "meta.nix" ] configurationFiles) + (meta.enable or true) ]); mkHost = ({ root, host, configurationFiles, ... }: let meta = import "${root}/meta.nix" // {