-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
108 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
{ pkgs, config, lib, ... } @ args: | ||
{ pkgs, lib, ... } @ args: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.stylix.cursor; | ||
fromOs = import ./fromos.nix { inherit lib args; }; | ||
in { | ||
{ | ||
options.stylix.cursor = { | ||
name = mkOption { | ||
description = "The cursor name within the package."; | ||
type = types.str; | ||
default = fromOs [ "cursor" "name" ] "Vanilla-DMZ"; | ||
default = "Vanilla-DMZ"; | ||
}; | ||
package = mkOption { | ||
description = "Package providing the cursor theme."; | ||
type = types.package; | ||
default = fromOs [ "cursor" "package" ] pkgs.vanilla-dmz; | ||
default = pkgs.vanilla-dmz; | ||
}; | ||
size = mkOption { | ||
description = "The cursor size."; | ||
type = types.int; | ||
default = fromOs [ "cursor" "size" ] 32; | ||
default = 32; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
homeManagerModule: | ||
{ lib, config, options, ... }: | ||
|
||
let | ||
alwaysCopy = path: { | ||
inherit path; | ||
condition = lib.const true; | ||
}; | ||
|
||
copyModules = builtins.map | ||
( | ||
{ path, condition ? lib.const true }: | ||
{ config, osConfig, ... }: | ||
lib.mkIf (condition config) | ||
(lib.setAttrByPath path (lib.mkDefault (lib.getAttrFromPath path osConfig))) | ||
) | ||
[ | ||
(alwaysCopy [ "stylix" "autoEnable" ]) | ||
{ | ||
path = [ "stylix" "base16Scheme" ]; | ||
condition = homeConfig: config.stylix.image == homeConfig.stylix.image; | ||
} | ||
(alwaysCopy [ "stylix" "cursor" "name" ]) | ||
(alwaysCopy [ "stylix" "cursor" "package" ]) | ||
(alwaysCopy [ "stylix" "cursor" "size" ]) | ||
(alwaysCopy [ "stylix" "fonts" "serif" ]) | ||
(alwaysCopy [ "stylix" "fonts" "sansSerif" ]) | ||
(alwaysCopy [ "stylix" "fonts" "monospace" ]) | ||
(alwaysCopy [ "stylix" "fonts" "emoji" ]) | ||
(alwaysCopy [ "stylix" "fonts" "sizes" "desktop" ]) | ||
(alwaysCopy [ "stylix" "fonts" "sizes" "applications" ]) | ||
(alwaysCopy [ "stylix" "fonts" "sizes" "terminal" ]) | ||
(alwaysCopy [ "stylix" "fonts" "sizes" "popups" ]) | ||
(alwaysCopy [ "stylix" "image" ]) | ||
(alwaysCopy [ "stylix" "opacity" "desktop" ]) | ||
(alwaysCopy [ "stylix" "opacity" "applications" ]) | ||
(alwaysCopy [ "stylix" "opacity" "terminal" ]) | ||
(alwaysCopy [ "stylix" "opacity" "popups" ]) | ||
{ | ||
path = [ "stylix" "override" ]; | ||
condition = homeConfig: config.stylix.base16Scheme == homeConfig.stylix.base16Scheme; | ||
} | ||
(alwaysCopy [ "stylix" "polarity" ]) | ||
]; | ||
|
||
in { | ||
options.stylix.homeManagerIntegration = { | ||
followSystem = lib.mkOption { | ||
description = '' | ||
When this option is `true`, Home Manager will follow | ||
the system theme by default, rather than requiring a theme to be set. | ||
This will only affect Home Manager configurations which are built | ||
within the NixOS configuration. | ||
''; | ||
type = lib.types.bool; | ||
default = true; | ||
}; | ||
|
||
autoImport = lib.mkOption { | ||
description = '' | ||
Whether to enable Stylix automatically for every user. | ||
This only applies to users for which Home Manager is set up within the | ||
NixOS configuration. | ||
''; | ||
type = lib.types.bool; | ||
default = options ? home-manager; | ||
defaultText = lib.literalMD '' | ||
`true` when Home Manager is present. | ||
''; | ||
}; | ||
}; | ||
|
||
config = | ||
lib.optionalAttrs (options ? home-manager) | ||
(lib.mkIf config.stylix.homeManagerIntegration.autoImport { | ||
home-manager.sharedModules = [ homeManagerModule ] ++ copyModules; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
{ pkgs, config, lib, ... } @ args: | ||
{ lib, ... } @ args: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.stylix.opacity; | ||
fromOs = import ./fromos.nix { inherit lib args; }; | ||
in { | ||
{ | ||
options.stylix.opacity = { | ||
desktop = mkOption { | ||
description = "The opacity of the windows of bars/widgets, the amount of applications supported is currently limited"; | ||
type = types.float; | ||
default = fromOs [ "opacity" "desktop" ] 1.0; | ||
default = 1.0; | ||
}; | ||
applications = mkOption { | ||
description = "The opacity of the windows of applications, the amount of applications supported is currently limited"; | ||
type = types.float; | ||
default = fromOs [ "opacity" "applications" ] 1.0; | ||
default = 1.0; | ||
}; | ||
terminal = mkOption { | ||
description = "The opacity of the windows of terminals, this works across all terminals supported by stylix"; | ||
type = types.float; | ||
default = fromOs [ "opacity" "terminal" ] 1.0; | ||
default = 1.0; | ||
}; | ||
popups = mkOption { | ||
description = "The opacity of the windows of notifications/popups, the amount of applications supported is currently limited"; | ||
type = types.float; | ||
default = fromOs [ "opacity" "popups" ] 1.0; | ||
default = 1.0; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.