diff --git a/configuration.nix b/configuration.nix index 109b6c5..f2d78bd 100644 --- a/configuration.nix +++ b/configuration.nix @@ -5,8 +5,6 @@ ./common ./fake_flake.nix ./users.nix - - ./specific/grimm-nixos-laptop/configuration.nix ]; # Bootloader. diff --git a/fake_flake.nix b/fake_flake.nix index 0493c2a..6697119 100644 --- a/fake_flake.nix +++ b/fake_flake.nix @@ -9,6 +9,14 @@ let nivSources = import ./nix/sources.nix; asGithubRef = src: "github:${src.owner}/${src.repo}/${src.rev}"; + build_target = let env_host = builtins.getEnv "NIXOS_TARGET_HOST"; in if env_host != "" then env_host else builtins.replaceStrings ["\n"] [""] (lib.toLower (builtins.readFile /proc/sys/kernel/hostname)); + + host_modules = { + grimmauld-nixos = [ + ./specific/grimm-nixos-laptop/configuration.nix + ]; + }; + nixpkgs_patches = [ { # tlpui @@ -22,7 +30,7 @@ in "${nivSources.agenix}/modules/age.nix" (import "${nivSources.lix-module}/module.nix" { lix = nivSources.lix-pkg; }) (builtins.getFlake (asGithubRef nivSources.chaotic)).nixosModules.default # fixme: ideally we'd not rely on the flake syntax to load the module - ]; + ] ++ lib.optionals (builtins.hasAttr build_target host_modules) host_modules.${build_target}; nixpkgs.hostPlatform = system;