From 70ae1693564ad47ef8e6d5d3c81acc25f0dff160 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Mon, 9 Oct 2023 12:37:26 +0200 Subject: [PATCH] refactor --- hosts/yodaNas/configuration.nix | 18 ++---------------- hosts/yodaTab/configuration.nix | 14 -------------- hosts/yodaTux/configuration.nix | 14 -------------- hosts/yodaYoga/configuration.nix | 18 ++---------------- modules/home-manager.nix | 12 +++++++++++- 5 files changed, 15 insertions(+), 61 deletions(-) diff --git a/hosts/yodaNas/configuration.nix b/hosts/yodaNas/configuration.nix index 895ae59..eb54174 100644 --- a/hosts/yodaNas/configuration.nix +++ b/hosts/yodaNas/configuration.nix @@ -3,27 +3,13 @@ # and in the NixOS manual (accessible by running `nixos-help`). { config, pkgs, ... }: -let - # Import Home Manager with niv. - home-manager = (import ../../nix/sources.nix).home-manager; - #home-manager-source = import (import ../../nix/sources.nix).home-manager {}; -in { - # Paths to other modules. - # Compose this module out of smaller ones. - # https://nixos.wiki/wiki/NixOS_modules imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - # Home Manager. - (import "${home-manager}/nixos") - #home-manager-source.nixos - ../../modules/home-manager.nix - # NUR. - ../../modules/nur.nix ./host-specific.nix - + ../../modules/home-manager.nix + ../../modules/nur.nix ../../modules/base.nix ../../modules/headless.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index 5ac9b36..1511093 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -3,26 +3,12 @@ # and in the NixOS manual (accessible by running `nixos-help`). { config, pkgs, ... }: -let - # Import Home Manager with niv. - home-manager = (import ../../nix/sources.nix).home-manager; - #home-manager-source = import (import ../../nix/sources.nix).home-manager {}; -in { - # Paths to other modules. - # Compose this module out of smaller ones. - # https://nixos.wiki/wiki/NixOS_modules imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - # Home Manager. - (import "${home-manager}/nixos") - #home-manager-source.nixos ../../modules/home-manager.nix - # NUR. ../../modules/nur.nix - ../../modules/base.nix #../../modules/headless.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index ea2cd81..e2272b4 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -3,26 +3,12 @@ # and in the NixOS manual (accessible by running `nixos-help`). { config, pkgs, ... }: -let - # Import Home Manager with niv. - home-manager = (import ../../nix/sources.nix).home-manager; - #home-manager-source = import (import ../../nix/sources.nix).home-manager {}; -in { - # Paths to other modules. - # Compose this module out of smaller ones. - # https://nixos.wiki/wiki/NixOS_modules imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - # Home Manager. - (import "${home-manager}/nixos") - #home-manager-source.nixos ../../modules/home-manager.nix - # NUR. ../../modules/nur.nix - ../../modules/base.nix #../../modules/headless.nix diff --git a/hosts/yodaYoga/configuration.nix b/hosts/yodaYoga/configuration.nix index abb62ab..df54eed 100644 --- a/hosts/yodaYoga/configuration.nix +++ b/hosts/yodaYoga/configuration.nix @@ -3,27 +3,13 @@ # and in the NixOS manual (accessible by running `nixos-help`). { config, pkgs, ... }: -let - # Import Home Manager with niv. - home-manager = (import ../../nix/sources.nix).home-manager; - #home-manager-source = import (import ../../nix/sources.nix).home-manager {}; -in { - # Paths to other modules. - # Compose this module out of smaller ones. - # https://nixos.wiki/wiki/NixOS_modules imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix - # Home Manager. - (import "${home-manager}/nixos") - #home-manager-source.nixos - ../../modules/home-manager.nix - # NUR. - ../../modules/nur.nix ./host-specific.nix - + ../../modules/home-manager.nix + ../../modules/nur.nix ../../modules/base.nix ../../modules/headless.nix diff --git a/modules/home-manager.nix b/modules/home-manager.nix index 49a497e..2b7b3a1 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -1,6 +1,16 @@ { config, pkgs, ... }: - +let + # Import Home Manager with niv. + home-manager = (import ../nix/sources.nix).home-manager; + #home-manager-source = import (import ../nix/sources.nix).home-manager {}; +in { + imports = [ + # Home Manager. + (import "${home-manager}/nixos") + #home-manager-source.nixos + ]; + # This option may become the default value in the future. # https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module home-manager.useUserPackages = true;