From 973e30998f4a8db6ebdb1fdeab3cd4d92e6084f5 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Mon, 19 Sep 2022 16:09:58 +0200 Subject: Misc: Remove code duplication by merging sets --- flake.nix | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/flake.nix b/flake.nix index 2becc78..3d8534a 100644 --- a/flake.nix +++ b/flake.nix @@ -31,45 +31,36 @@ outputs = inputs @ { self, nixpkgs, home-manager, ... }: let user = "baitinq"; + commonInherits = { + inherit (nixpkgs) lib; + inherit inputs user nixpkgs home-manager; + extraModules = [ ]; + }; in { - nixosConfigurations = import ./hosts { - isNixOS = true; - extraModules = [ ]; + nixosConfigurations = import ./hosts (commonInherits // { + isNixOS = true; isIso = false; isHardware = true; - inherit (nixpkgs) lib; - inherit inputs user nixpkgs home-manager; - }; + }); - homeConfigurations = import ./hosts { + homeConfigurations = import ./hosts (commonInherits // { isNixOS = false; - extraModules = [ ]; isIso = false; isHardware = false; - #no COde duplication here: TODO - inherit (nixpkgs) lib; - inherit inputs user nixpkgs home-manager; - }; + }); - isoConfigurations = import ./hosts { + isoConfigurations = import ./hosts (commonInherits // { isNixOS = true; - extraModules = [ ]; isIso = true; isHardware = false; user = "nixos"; - #no COde duplication here: TODO - inherit (nixpkgs) lib; - inherit inputs nixpkgs home-manager; - }; + }); - nixosNoHardwareConfigurations = import ./hosts { + nixosNoHardwareConfigurations = import ./hosts (commonInherits // { isNixOS = true; - extraModules = [ ]; isIso = false; isHardware = false; - inherit (nixpkgs) lib; - inherit inputs user nixpkgs home-manager; - }; + }); }; } -- cgit 1.4.1