1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-15 21:41:09 +01:00

treewide: remove no-ops (#8061)

This commit is contained in:
Benedikt M. Rips 2025-10-26 21:43:53 +01:00 committed by GitHub
parent 879e4d9060
commit f2f1076c1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 302 additions and 414 deletions

View file

@ -17,9 +17,7 @@
lib lib
pkgs pkgs
; ;
configuration = configuration = {
{ ... }:
{
imports = modules ++ [ imports = modules ++ [
{ {
programs.home-manager.path = builtins.path { programs.home-manager.path = builtins.path {

View file

@ -13,9 +13,7 @@ let
renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings); renderSettings = settings: lib.concatStringsSep ";" (lib.mapAttrsToList renderSetting settings);
pluginModule = types.submodule ( pluginModule = types.submodule ({
{ ... }:
{
options = { options = {
src = mkOption { src = mkOption {
type = with types; nullOr path; type = with types; nullOr path;
@ -48,8 +46,7 @@ let
''; '';
}; };
}; };
} });
);
in in
{ {
meta.maintainers = with lib.maintainers; [ thiagokokada ]; meta.maintainers = with lib.maintainers; [ thiagokokada ];

View file

@ -21,9 +21,7 @@ in
options.services.swayidle = options.services.swayidle =
let let
timeoutModule = timeoutModule = {
{ ... }:
{
options = { options = {
timeout = mkOption { timeout = mkOption {
type = types.ints.positive; type = types.ints.positive;
@ -44,9 +42,7 @@ in
}; };
}; };
eventModule = eventModule = {
{ ... }:
{
options = { options = {
event = mkOption { event = mkOption {
type = types.enum [ type = types.enum [

View file

@ -42,7 +42,7 @@ let
if lib.isDerivation value then scrubbedValue // newDrvAttrs else scrubbedValue if lib.isDerivation value then scrubbedValue // newDrvAttrs else scrubbedValue
else else
value; value;
scrubDerivations = attrs: lib.mapAttrs scrubDerivation attrs; scrubDerivations = lib.mapAttrs scrubDerivation;
# Globally unscrub a few selected packages that are used by a wide selection of tests. # Globally unscrub a few selected packages that are used by a wide selection of tests.
whitelist = whitelist =
@ -111,10 +111,7 @@ let
pkgs = pkgs =
let let
overlays = overlays =
config.test.stubOverlays config.test.stubOverlays ++ lib.optionals (config.nixpkgs.overlays != null) config.nixpkgs.overlays;
++ lib.optionals (
config.nixpkgs.overlays != null && config.nixpkgs.overlays != [ ]
) config.nixpkgs.overlays;
stubbedPkgs = stubbedPkgs =
if overlays == [ ] then if overlays == [ ] then
scrubbedPkgs scrubbedPkgs

View file

@ -4,9 +4,7 @@
name = "nixos-basics"; name = "nixos-basics";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ ../../../nixos ]; # Import the HM NixOS module. imports = [ ../../../nixos ]; # Import the HM NixOS module.
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
@ -18,9 +16,7 @@
uid = 1000; uid = 1000;
}; };
home-manager.users.alice = home-manager.users.alice = {
{ ... }:
{
home.stateVersion = "24.11"; home.stateVersion = "24.11";
home.file.test.text = "testfile"; home.file.test.text = "testfile";
# Enable a light-weight systemd service. # Enable a light-weight systemd service.

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
imports = [ ../../../nixos ]; # Import the HM NixOS module. imports = [ ../../../nixos ]; # Import the HM NixOS module.
@ -9,9 +8,7 @@
}; };
home-manager = { home-manager = {
users.alice = users.alice = {
{ ... }:
{
home.stateVersion = "24.11"; home.stateVersion = "24.11";
home.file.test.text = "testfile new profile"; home.file.test.text = "testfile new profile";
}; };

View file

@ -4,9 +4,7 @@
name = "nixos-legacy-profile-management"; name = "nixos-legacy-profile-management";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ imports = [
# Make the nixpkgs channel available. # Make the nixpkgs channel available.
"${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix"
@ -26,9 +24,7 @@
# Force legacy profile management. # Force legacy profile management.
enableLegacyProfileManagement = true; enableLegacyProfileManagement = true;
users.alice = users.alice = {
{ ... }:
{
home.stateVersion = "24.11"; home.stateVersion = "24.11";
home.file.test.text = "testfile legacy"; home.file.test.text = "testfile legacy";
}; };
@ -40,9 +36,7 @@
# Assert that we expect the option to default to false. # Assert that we expect the option to default to false.
enableLegacyProfileManagement = pkgs.lib.mkOptionDefault false; enableLegacyProfileManagement = pkgs.lib.mkOptionDefault false;
users.alice = users.alice = {
{ ... }:
{
home.stateVersion = "24.11"; home.stateVersion = "24.11";
home.file.test.text = "testfile modern"; home.file.test.text = "testfile modern";
}; };

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
home.username = "alice"; home.username = "alice";
home.homeDirectory = "/home/alice"; home.homeDirectory = "/home/alice";

View file

@ -4,9 +4,7 @@
name = "standalone-flake-basics"; name = "standalone-flake-basics";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 3072; virtualisation.memorySize = 3072;
nix = { nix = {

View file

@ -10,9 +10,7 @@ in
name = "home-with-symbols"; name = "home-with-symbols";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -3,9 +3,7 @@
name = "kitty-theme-path"; name = "kitty-theme-path";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -2,9 +2,7 @@
{ {
name = "mu-store-init"; name = "mu-store-init";
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -9,9 +9,7 @@ in
name = "works-with-nh-stable"; name = "works-with-nh-stable";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
environment.systemPackages = [ pkgs.nh ]; environment.systemPackages = [ pkgs.nh ];

View file

@ -24,9 +24,7 @@ in
{ {
name = "restic"; name = "restic";
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -4,9 +4,7 @@
name = "standalone-specialisation"; name = "standalone-specialisation";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -4,9 +4,7 @@
name = "standalone-standard-basics"; name = "standalone-standard-basics";
meta.maintainers = [ pkgs.lib.maintainers.rycee ]; meta.maintainers = [ pkgs.lib.maintainers.rycee ];
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
users.users.alice = { users.users.alice = {

View file

@ -36,9 +36,7 @@ in
}; };
}; };
home-cursor-legacy-disabled = home-cursor-legacy-disabled = {
{ ... }:
{
config = { config = {
home.pointerCursor = null; home.pointerCursor = null;

View file

@ -1,7 +1,5 @@
{ {
i18n = i18n = {
{ ... }:
{
config = { config = {
nmt.script = '' nmt.script = ''
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh

View file

@ -1,22 +1,8 @@
{ ... }:
{ {
imports = [ home.sessionPath = [
(
{ ... }:
{
config.home.sessionPath = [ "foo" ];
}
)
(
{ ... }:
{
config.home.sessionPath = [
"bar" "bar"
"baz" "baz"
]; "foo"
}
)
]; ];
nmt.script = '' nmt.script = ''

View file

@ -1,22 +1,8 @@
{ ... }:
{ {
imports = [ home.sessionSearchVariables.TEST = [
(
{ ... }:
{
config.home.sessionSearchVariables.TEST = [ "foo" ];
}
)
(
{ ... }:
{
config.home.sessionSearchVariables.TEST = [
"bar" "bar"
"baz" "baz"
]; "foo"
}
)
]; ];
nmt.script = '' nmt.script = ''

View file

@ -37,7 +37,6 @@ let
in in
{ {
config = {
home.sessionVariables = { home.sessionVariables = {
V1 = "v1"; V1 = "v1";
V2 = "v2-${config.home.sessionVariables.V1}"; V2 = "v2-${config.home.sessionVariables.V1}";
@ -48,5 +47,4 @@ in
assertFileContent home-path/etc/profile.d/hm-session-vars.sh \ assertFileContent home-path/etc/profile.d/hm-session-vars.sh \
${expected} ${expected}
''; '';
};
} }

View file

@ -1,6 +1,4 @@
{ ... }:
{ {
config = {
xdg.mime.enable = true; xdg.mime.enable = true;
xdg.desktopEntries = { xdg.desktopEntries = {
mime-test = { mime-test = {
@ -25,5 +23,4 @@
assertDirectoryNotEmpty home-path/share/mime # Check that update-mime-database created files assertDirectoryNotEmpty home-path/share/mime # Check that update-mime-database created files
''; '';
};
} }

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
programs.ashell = { programs.ashell = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
programs = { programs = {
bash.enable = true; bash.enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
programs.keepassxc = { programs.keepassxc = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
programs.keepassxc = { programs.keepassxc = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
programs = { programs = {
kubeswitch.enable = true; kubeswitch.enable = true;

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
programs.lazydocker = { programs.lazydocker = {
enable = true; enable = true;

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
programs.lazydocker.enable = true; programs.lazydocker.enable = true;
test.stubs.lazydocker = { }; test.stubs.lazydocker = { };

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
programs.swaylock.settings = { }; programs.swaylock.settings = { };

View file

@ -1,4 +1,3 @@
{ ... }:
{ {
programs.uv = { programs.uv = {
enable = true; enable = true;

View file

@ -1,20 +1,11 @@
{ {
imports = [ programs.zsh = {
( enable = true;
{ ... }: history.ignorePatterns = [
{ "echo *"
config.programs.zsh.history.ignorePatterns = [ "echo *" ]; "rm *"
}
)
(
{ ... }:
{
config.programs.zsh.history.ignorePatterns = [ "rm *" ];
}
)
]; ];
};
programs.zsh.enable = true;
nmt.script = '' nmt.script = ''
assertFileContains home-files/.zshrc "HISTORY_IGNORE='(echo *|rm *)'" assertFileContains home-files/.zshrc "HISTORY_IGNORE='(echo *|rm *)'"

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
services.clipse = { services.clipse = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
services.easyeffects = { services.easyeffects = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
services.easyeffects = { services.easyeffects = {
enable = true; enable = true;

View file

@ -1,5 +1,3 @@
{ ... }:
{ {
systemd.user.slices.app-test = { systemd.user.slices.app-test = {
Unit = { Unit = {

View file

@ -108,8 +108,7 @@ in
lib.test.mkStubPackage = mkStubPackage; lib.test.mkStubPackage = mkStubPackage;
test.stubOverlays = test.stubOverlays =
[ ] lib.optional (config.test.stubs != { }) (
++ lib.optional (config.test.stubs != { }) (
self: super: self: super:
lib.mapAttrs ( lib.mapAttrs (
n: v: n: v: