From c524472caa0c4f24410c1fdc610bffde2aae489f Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 1 Sep 2021 16:37:36 +0200 Subject: [PATCH] host: Refactor a bit --- hosts/ayame.nix | 8 ++------ hosts/miku.nix | 8 ++------ modules/default.nix | 7 +++++++ modules/host.nix | 6 ++++-- 4 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 modules/default.nix diff --git a/hosts/ayame.nix b/hosts/ayame.nix index d241a08..6c7ad6b 100644 --- a/hosts/ayame.nix +++ b/hosts/ayame.nix @@ -1,12 +1,8 @@ { config, pkgs, lib, ... }: let - mkHost = import ../modules/host.nix { - config = config; - lib = lib; - pkgs = pkgs; - }; -in mkHost { + mkHost = (import ../modules { lib = lib; pkgs = pkgs; }).mkHost; +in mkHost config { userName = "alexander"; hostName = "ayame"; wireless = true; diff --git a/hosts/miku.nix b/hosts/miku.nix index b05485a..e678f9d 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -1,12 +1,8 @@ { config, lib, pkgs, ... }: let - mkHost = import ../modules/host.nix { - config = config; - lib = lib; - pkgs = pkgs; - }; -in mkHost { + mkHost = (import ../modules { lib = lib; pkgs = pkgs; }).mkHost; +in mkHost config { userName = "alexander"; hostName = "miku"; overlays = [ "nur" "steam" "unstable" "simple" "custom" "emacs" ]; diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..ca63ca5 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,7 @@ +{ + lib, pkgs +}: + +{ + mkHost = import ./host.nix { lib = lib; pkgs = pkgs; }; +} diff --git a/modules/host.nix b/modules/host.nix index 1212f60..3b8d966 100644 --- a/modules/host.nix +++ b/modules/host.nix @@ -1,6 +1,8 @@ -{ config, lib, pkgs, ... }: - { + lib, pkgs +}: + +config: { userName , hostName , wireless ? false