From e02c8c77a4baf4803cde3d2ba79a7c4e6350e803 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sun, 24 Apr 2022 11:38:24 +0100 Subject: [PATCH] Apply home-manager settings to all users automatically :children_crossing: --- README.md | 7 +------ flake.nix | 1 - modules/dunst.nix | 4 ++-- modules/fish.nix | 4 +++- modules/gtk.nix | 4 ++-- modules/helix.nix | 4 ++-- modules/kitty.nix | 4 ++-- modules/qutebrowser.nix | 4 ++-- modules/sway.nix | 4 ++-- modules/vim.nix | 4 ++-- stylix/home-manager.nix | 25 ------------------------- 11 files changed, 18 insertions(+), 47 deletions(-) delete mode 100644 stylix/home-manager.nix diff --git a/README.md b/README.md index 4e6b640..4790fa7 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,7 @@ Stylix can be installed using the experimental Stylix relies on [Home Manager](https://github.com/nix-community/home-manager) to install a lot of its theming. This requires Home Manager to be installed as -a NixOS module; how to do this is shown in the example above. Users must be -listed in `stylix.homeManagerUsers` to enable styles which rely on Home Manager -for that user. +a NixOS module; how to do this is shown in the example above. ## Configuration @@ -65,8 +63,5 @@ for that user. name = "Noto Color Emoji"; }; }; - - # Add users to this list to enable Home Manager integration - stylix.homeManagerUsers = [ "danth" ]; } ``` diff --git a/flake.nix b/flake.nix index 5aff1e7..040ffd0 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,6 @@ base16 = base16.lib args; }) ./stylix/fonts.nix - ./stylix/home-manager.nix ./stylix/pixel.nix ]; }; diff --git a/modules/dunst.nix b/modules/dunst.nix index 4dc7fb6..063a3da 100644 --- a/modules/dunst.nix +++ b/modules/dunst.nix @@ -4,7 +4,7 @@ with config.lib.stylix.colors.withHashtag; with config.stylix.fonts; { - stylix.homeModule = { + home-manager.sharedModules = [{ services.dunst.settings = { global = { separator_color = base02; @@ -29,5 +29,5 @@ with config.stylix.fonts; frame_color = base08; }; }; - }; + }]; } diff --git a/modules/fish.nix b/modules/fish.nix index 2dc8537..770da2c 100644 --- a/modules/fish.nix +++ b/modules/fish.nix @@ -18,5 +18,7 @@ let in { programs.fish.promptInit = promptInit; - stylix.homeModule = { programs.fish.interactiveShellInit = promptInit; }; + home-manager.sharedModules = [{ + programs.fish.interactiveShellInit = promptInit; + }]; } diff --git a/modules/gtk.nix b/modules/gtk.nix index 0324ce5..e57511a 100644 --- a/modules/gtk.nix +++ b/modules/gtk.nix @@ -145,13 +145,13 @@ in lib.mkIf (config.services.xserver.enable || config.programs.sway.enable) { # Required for Home Manager's GTK settings to work programs.dconf.enable = true; - stylix.homeModule = { + home-manager.sharedModules = [{ gtk = { enable = true; inherit theme; font = config.stylix.fonts.sansSerif; }; - }; + }]; services.xserver.displayManager.lightdm.greeters.gtk.theme = theme; } diff --git a/modules/helix.nix b/modules/helix.nix index 4134e69..82a34f1 100644 --- a/modules/helix.nix +++ b/modules/helix.nix @@ -99,10 +99,10 @@ let theme = { }; in { - stylix.homeModule = { + home-manager.sharedModules = [{ programs.helix = { settings.theme = "stylix"; themes.stylix = theme; }; - }; + }]; } diff --git a/modules/kitty.nix b/modules/kitty.nix index 21b7a27..19857a4 100644 --- a/modules/kitty.nix +++ b/modules/kitty.nix @@ -1,7 +1,7 @@ { config, ... }: { - stylix.homeModule = { + home-manager.sharedModules = [{ programs.kitty = { font = config.stylix.fonts.monospace; @@ -39,5 +39,5 @@ color15 = base07; }; }; - }; + }]; } diff --git a/modules/qutebrowser.nix b/modules/qutebrowser.nix index d492df5..daae541 100644 --- a/modules/qutebrowser.nix +++ b/modules/qutebrowser.nix @@ -15,7 +15,7 @@ let error = base08; in { - stylix.homeModule = { + home-manager.sharedModules = [{ programs.qutebrowser.settings = { hints.border = background; colors = { @@ -206,5 +206,5 @@ in { }; }; }; - }; + }]; } diff --git a/modules/sway.nix b/modules/sway.nix index 8484073..912a789 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -14,7 +14,7 @@ let }; in { - stylix.homeModule = { + home-manager.sharedModules = [{ wayland.windowManager.sway.config = { inherit fonts; @@ -52,7 +52,7 @@ in { output."*".bg = "${config.stylix.image} fill"; }; - }; + }]; # Merge this with your bar configuration using //config.lib.stylix.sway.bar lib.stylix.sway.bar = { diff --git a/modules/vim.nix b/modules/vim.nix index c3e04f5..4762b17 100644 --- a/modules/vim.nix +++ b/modules/vim.nix @@ -28,8 +28,8 @@ let }; in { - stylix.homeModule = { + home-manager.sharedModules = [{ programs.vim = vimOptions; programs.neovim = vimOptions; - }; + }]; } diff --git a/stylix/home-manager.nix b/stylix/home-manager.nix deleted file mode 100644 index 7e446df..0000000 --- a/stylix/home-manager.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, config, options, ... }: - -with lib; - -let cfg = config.stylix; - -in { - options.stylix = { - homeManagerUsers = mkOption { - type = types.listOf types.str; - description = "Users for which to enable Home Manager integration."; - default = [ ]; - }; - - homeModule = mkOption { - internal = true; - type = types.anything; - description = "Home Manager module to apply for all users."; - }; - }; - - config = { - home-manager.users = genAttrs cfg.homeManagerUsers (user: cfg.homeModule); - }; -}