From f94de157a64723876f48d8dad03355f23e466a7d Mon Sep 17 00:00:00 2001 From: Lilith Date: Wed, 12 Mar 2025 16:50:15 +0100 Subject: [PATCH] refactor3 --- flake.nix | 7 +++---- default.nix => home/default.nix | 0 2 files changed, 3 insertions(+), 4 deletions(-) rename default.nix => home/default.nix (100%) diff --git a/flake.nix b/flake.nix index 7ee76c46..95676e3c 100644 --- a/flake.nix +++ b/flake.nix @@ -52,16 +52,15 @@ } @ inputs: let inherit (nixpkgs) lib; - systemFromHardwareConf = { + systemFromHardwareConf = hostname: let hardware = import ./hosts/${hostname}/hardware-configuration.nix; args = builtins.functionArgs hardware // { lib.mkdefault = lib.id; }; in (hardware args).nixpkgs.hostPlatform; - }; - importNixpks = system: nixpkgs: + importNixpkgs = system: nixpkgs: let config.allowUnfreePredicate = pkg: @@ -88,7 +87,7 @@ builtins.readDir (lib.filterAttrs (_: type: type == "directory")) # (lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix)) - (builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name)) + (builtins.mapAttrs (name: _: makeHost name (systemFromHardwareConf name))) ]; }; } diff --git a/default.nix b/home/default.nix similarity index 100% rename from default.nix rename to home/default.nix