-
-
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
10 changed files
with
138 additions
and
143 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
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,79 @@ | ||
homeManagerModule: | ||
{ lib, config, options, ... }: | ||
|
||
let | ||
copyModules = builtins.map | ||
( | ||
{ path, condition ? lib.const true }: | ||
{ config, osConfig, ... }: | ||
lib.mkIf (condition config) | ||
(lib.setAttrByPath path (lib.mkDefault (lib.getAttrFromPath path osConfig))) | ||
) | ||
[ | ||
{ path = [ "stylix" "autoEnable" ]; } | ||
{ | ||
path = [ "stylix" "base16Scheme" ]; | ||
condition = homeConfig: config.stylix.image == homeConfig.stylix.image; | ||
} | ||
{ path = [ "stylix" "cursor" "name" ]; } | ||
{ path = [ "stylix" "cursor" "package" ]; } | ||
{ path = [ "stylix" "cursor" "size" ]; } | ||
{ path = [ "stylix" "enable" ]; } | ||
{ path = [ "stylix" "fonts" "serif" ]; } | ||
{ path = [ "stylix" "fonts" "sansSerif" ]; } | ||
{ path = [ "stylix" "fonts" "monospace" ]; } | ||
{ path = [ "stylix" "fonts" "emoji" ]; } | ||
{ path = [ "stylix" "fonts" "sizes" "desktop" ]; } | ||
{ path = [ "stylix" "fonts" "sizes" "applications" ]; } | ||
{ path = [ "stylix" "fonts" "sizes" "terminal" ]; } | ||
{ path = [ "stylix" "fonts" "sizes" "popups" ]; } | ||
{ path = [ "stylix" "image" ]; } | ||
{ path = [ "stylix" "imageScalingMode" ]; } | ||
{ path = [ "stylix" "opacity" "desktop" ]; } | ||
{ path = [ "stylix" "opacity" "applications" ]; } | ||
{ path = [ "stylix" "opacity" "terminal" ]; } | ||
{ path = [ "stylix" "opacity" "popups" ]; } | ||
{ | ||
path = [ "stylix" "override" ]; | ||
condition = homeConfig: config.stylix.base16Scheme == homeConfig.stylix.base16Scheme; | ||
} | ||
{ path = [ "stylix" "polarity" ]; } | ||
]; | ||
|
||
in { | ||
options.stylix.homeManagerIntegration = { | ||
followSystem = lib.mkOption { | ||
description = '' | ||
When this option is `true`, Home Manager configurations will follow | ||
the NixOS configuration by default, rather than using the standard | ||
default settings. | ||
This only applies to Home Manager configurations managed by | ||
[`stylix.homeManagerIntegration.autoImport`](#stylixhomemanagerintegrationautoimport). | ||
''; | ||
type = lib.types.bool; | ||
default = true; | ||
example = false; | ||
}; | ||
|
||
autoImport = lib.mkOption { | ||
description = '' | ||
Whether to import Stylix automatically for every Home Manager user. | ||
This only works if you are using `home-manager.users.«name»` within | ||
your NixOS configuration, rather than running Home Manager independently. | ||
''; | ||
type = lib.types.bool; | ||
default = true; | ||
example = false; | ||
}; | ||
}; | ||
|
||
config = | ||
lib.optionalAttrs (options ? home-manager) | ||
(lib.mkIf config.stylix.homeManagerIntegration.autoImport { | ||
home-manager.sharedModules = | ||
[ homeManagerModule ] ++ | ||
(lib.optionals config.stylix.homeManagerIntegration.followSystem 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.