summaryrefslogtreecommitdiff
path: root/lib/default.nix
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2024-10-13 00:47:25 +0200
committerMike Vink <mike@pionative.com>2024-10-13 00:47:25 +0200
commitd5d25f1fbb4d44cc7816c47363b1c24414fc1549 (patch)
tree14e247061e41b9a8f06038bbefe6ae624be09a92 /lib/default.nix
parent0d5b62cb0eaa0dd2a2906d2f1077015869f88bcc (diff)
cleanup flake for syncthing
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix21
1 files changed, 14 insertions, 7 deletions
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);