From d5d25f1fbb4d44cc7816c47363b1c24414fc1549 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Sun, 13 Oct 2024 00:47:25 +0200 Subject: cleanup flake for syncthing --- lib/default.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/default.nix b/lib/default.nix index 960a7a4..bca0a8e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -33,8 +33,18 @@ inputs: lib: prev: with lib; rec { }: let machine = machines.${name}; + systemClosure = + (if hasInfix "darwin" system then + darwinSystem + else + nixosSystem); + home-manager = + (if hasInfix "darwin" system then + [inputs.home-manager.darwinModules.default] + else + [inputs.home-manager.nixosModules.default]); in - lib.nixosSystem { + systemClosure { inherit lib system; specialArgs = { inherit (inputs) self; @@ -43,10 +53,7 @@ inputs: lib: prev: with lib; rec { modules = modules ++ - (if lib.hasInfix "darwin" system then - [inputs.home-manager.darwinModules.default] - else - [inputs.home-manager.nixosModules.default]) + home-manager ++ [ ({pkgs, ...}: { nixpkgs.overlays = with lib; [ @@ -60,9 +67,9 @@ inputs: lib: prev: with lib; rec { ]; }; - mkSystems = systems: + mkSystemsFor = allSystems: systems: let - machines = mkMachines (mapAttrs (name: value: value.opts) systems); + machines = mkMachines (mapAttrs (name: value: value.opts) allSystems); in (mapAttrs (mkSystem machines) systems); -- cgit v1.2.3