From c8dafb187b7b010bf279a7bf0842eaadf3e387a8 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 13 Jun 2023 08:44:30 +0200 Subject: [PATCH] specialisation: renamed from specialization Renamed to be consistent with NixOS. Fixes #4074 --- ...{specialization.nix => specialisation.nix} | 25 +++++++++++-------- modules/modules.nix | 2 +- tests/default.nix | 2 +- tests/modules/misc/specialization/default.nix | 2 +- .../misc/specialization/specialization.nix | 6 ++--- 5 files changed, 20 insertions(+), 17 deletions(-) rename modules/misc/{specialization.nix => specialisation.nix} (78%) diff --git a/modules/misc/specialization.nix b/modules/misc/specialisation.nix similarity index 78% rename from modules/misc/specialization.nix rename to modules/misc/specialisation.nix index 105f0d67..e9844f2d 100644 --- a/modules/misc/specialization.nix +++ b/modules/misc/specialisation.nix @@ -3,7 +3,10 @@ with lib; { - options.specialization = mkOption { + imports = + [ (mkRenamedOptionModule [ "specialization" ] [ "specialisation" ]) ]; + + options.specialisation = mkOption { type = types.attrsOf (types.submodule { options = { configuration = mkOption { @@ -11,10 +14,10 @@ with lib; extended = extendModules { modules = [{ # Prevent infinite recursion - specialization = mkOverride 0 { }; + specialisation = mkOverride 0 { }; # If used inside the NixOS/nix-darwin module, we get conflicting definitions - # of `name` inside the specialization: one is the user name coming from the + # of `name` inside the specialisation: one is the user name coming from the # NixOS module definition and the other is `configuration`, the name of this # option. Thus we need to explicitly wire the former into the module arguments. # See discussion at https://github.com/nix-community/home-manager/issues/3716 @@ -34,19 +37,19 @@ with lib; description = '' A set of named specialized configurations. These can be used to extend your base configuration with additional settings. For example, you can - have specializations named light and dark + have specialisations named light and dark that applies light and dark color theme configurations. Note, this is an experimental option for now and you therefore have to - activate the specialization by looking up and running the activation + activate the specialisation by looking up and running the activation script yourself. Note, running the activation script will create a new Home Manager generation. - For example, to activate the dark specialization. You can + For example, to activate the dark specialisation. You can first look up your current Home Manager generation by running @@ -57,7 +60,7 @@ with lib; then run - $ /nix/store/jy…ac-home-manager-generation/specialization/dark/activate + $ /nix/store/jy…ac-home-manager-generation/specialisation/dark/activate Starting Home Manager activation … @@ -69,14 +72,14 @@ with lib; ''; }; - config = mkIf (config.specialization != { }) { + config = mkIf (config.specialisation != { }) { home.extraBuilderCommands = let link = n: v: let pkg = v.configuration.home.activationPackage; - in "ln -s ${pkg} $out/specialization/${n}"; + in "ln -s ${pkg} $out/specialisation/${n}"; in '' - mkdir $out/specialization - ${concatStringsSep "\n" (mapAttrsToList link config.specialization)} + mkdir $out/specialisation + ${concatStringsSep "\n" (mapAttrsToList link config.specialisation)} ''; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 73008004..2cff12dc 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -32,7 +32,7 @@ let ./misc/numlock.nix ./misc/pam.nix ./misc/qt.nix - ./misc/specialization.nix + ./misc/specialisation.nix ./misc/submodule-support.nix ./misc/tmpfiles.nix ./misc/version.nix diff --git a/tests/default.nix b/tests/default.nix index 1b5067a7..fa202ff2 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -53,7 +53,7 @@ import nmt { ./modules/home-environment ./modules/misc/fontconfig ./modules/misc/nix - ./modules/misc/specialization + ./modules/misc/specialisation ./modules/programs/aerc ./modules/programs/alacritty ./modules/programs/alot diff --git a/tests/modules/misc/specialization/default.nix b/tests/modules/misc/specialization/default.nix index ddbc22c6..33c240ff 100644 --- a/tests/modules/misc/specialization/default.nix +++ b/tests/modules/misc/specialization/default.nix @@ -1 +1 @@ -{ specialization = ./specialization.nix; } +{ specialisation = ./specialisation.nix; } diff --git a/tests/modules/misc/specialization/specialization.nix b/tests/modules/misc/specialization/specialization.nix index 9d6149a0..a8d417d4 100644 --- a/tests/modules/misc/specialization/specialization.nix +++ b/tests/modules/misc/specialization/specialization.nix @@ -4,7 +4,7 @@ with lib; { home.file.testfile.text = "not special"; - specialization.test.configuration = { + specialisation.test.configuration = { home.file.testfile.text = "very special"; }; @@ -12,7 +12,7 @@ with lib; assertFileExists home-files/testfile assertFileContains home-files/testfile "not special" - assertFileExists specialization/test/home-files/testfile - assertFileContains specialization/test/home-files/testfile "not special" + assertFileExists specialisation/test/home-files/testfile + assertFileContains specialisation/test/home-files/testfile "not special" ''; }