mirror of
https://github.com/danth/stylix
synced 2024-11-10 06:34:15 +00:00
Apply home-manager settings to all users automatically 🚸
This commit is contained in:
parent
c2358177dc
commit
e02c8c77a4
11 changed files with 18 additions and 47 deletions
|
@ -33,9 +33,7 @@ Stylix can be installed using the experimental
|
||||||
|
|
||||||
Stylix relies on [Home Manager](https://github.com/nix-community/home-manager)
|
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
|
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
|
a NixOS module; how to do this is shown in the example above.
|
||||||
listed in `stylix.homeManagerUsers` to enable styles which rely on Home Manager
|
|
||||||
for that user.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -65,8 +63,5 @@ for that user.
|
||||||
name = "Noto Color Emoji";
|
name = "Noto Color Emoji";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Add users to this list to enable Home Manager integration
|
|
||||||
stylix.homeManagerUsers = [ "danth" ];
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -59,7 +59,6 @@
|
||||||
base16 = base16.lib args;
|
base16 = base16.lib args;
|
||||||
})
|
})
|
||||||
./stylix/fonts.nix
|
./stylix/fonts.nix
|
||||||
./stylix/home-manager.nix
|
|
||||||
./stylix/pixel.nix
|
./stylix/pixel.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@ with config.lib.stylix.colors.withHashtag;
|
||||||
with config.stylix.fonts;
|
with config.stylix.fonts;
|
||||||
|
|
||||||
{
|
{
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
services.dunst.settings = {
|
services.dunst.settings = {
|
||||||
global = {
|
global = {
|
||||||
separator_color = base02;
|
separator_color = base02;
|
||||||
|
@ -29,5 +29,5 @@ with config.stylix.fonts;
|
||||||
frame_color = base08;
|
frame_color = base08;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,5 +18,7 @@ let
|
||||||
in {
|
in {
|
||||||
programs.fish.promptInit = promptInit;
|
programs.fish.promptInit = promptInit;
|
||||||
|
|
||||||
stylix.homeModule = { programs.fish.interactiveShellInit = promptInit; };
|
home-manager.sharedModules = [{
|
||||||
|
programs.fish.interactiveShellInit = promptInit;
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,13 +145,13 @@ in lib.mkIf (config.services.xserver.enable || config.programs.sway.enable) {
|
||||||
# Required for Home Manager's GTK settings to work
|
# Required for Home Manager's GTK settings to work
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit theme;
|
inherit theme;
|
||||||
font = config.stylix.fonts.sansSerif;
|
font = config.stylix.fonts.sansSerif;
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
|
|
||||||
services.xserver.displayManager.lightdm.greeters.gtk.theme = theme;
|
services.xserver.displayManager.lightdm.greeters.gtk.theme = theme;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,10 +99,10 @@ let theme = {
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
settings.theme = "stylix";
|
settings.theme = "stylix";
|
||||||
themes.stylix = theme;
|
themes.stylix = theme;
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
font = config.stylix.fonts.monospace;
|
font = config.stylix.fonts.monospace;
|
||||||
|
|
||||||
|
@ -39,5 +39,5 @@
|
||||||
color15 = base07;
|
color15 = base07;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ let
|
||||||
error = base08;
|
error = base08;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
programs.qutebrowser.settings = {
|
programs.qutebrowser.settings = {
|
||||||
hints.border = background;
|
hints.border = background;
|
||||||
colors = {
|
colors = {
|
||||||
|
@ -206,5 +206,5 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
wayland.windowManager.sway.config = {
|
wayland.windowManager.sway.config = {
|
||||||
inherit fonts;
|
inherit fonts;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ in {
|
||||||
|
|
||||||
output."*".bg = "${config.stylix.image} fill";
|
output."*".bg = "${config.stylix.image} fill";
|
||||||
};
|
};
|
||||||
};
|
}];
|
||||||
|
|
||||||
# Merge this with your bar configuration using //config.lib.stylix.sway.bar
|
# Merge this with your bar configuration using //config.lib.stylix.sway.bar
|
||||||
lib.stylix.sway.bar = {
|
lib.stylix.sway.bar = {
|
||||||
|
|
|
@ -28,8 +28,8 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
stylix.homeModule = {
|
home-manager.sharedModules = [{
|
||||||
programs.vim = vimOptions;
|
programs.vim = vimOptions;
|
||||||
programs.neovim = vimOptions;
|
programs.neovim = vimOptions;
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue