From c08dc9e86f2abd715cbc73d7c01ad509e0ff283f Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:40:35 +0200 Subject: [PATCH] use different stylix version to have an enable option --- flake.lock | 11 ++++++----- flake.nix | 13 +++++-------- home-manager/stylix.nix | 3 +++ modules/graphical/stylix.nix | 3 ++- users/anon/home.nix | 1 - users/kopatz/home.nix | 5 +++-- 6 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 home-manager/stylix.nix diff --git a/flake.lock b/flake.lock index a8ea6a3..948f163 100644 --- a/flake.lock +++ b/flake.lock @@ -840,15 +840,16 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1717268716, - "narHash": "sha256-hKM/D6Ni3+Ihvmy8pF+rOFgIqhphOEHUWqxJd+5ZV6Y=", - "owner": "danth", + "lastModified": 1717250350, + "narHash": "sha256-l7y55WbUrj4NVCzgo3GLmM1Z2HC2uLb8dLUt7FxfI5g=", + "owner": "jalil-salame", "repo": "stylix", - "rev": "3befd5d693a2669dc7d2086b57298838ff71f24b", + "rev": "03a8c7744903f29f017fabeda833834bd873f956", "type": "github" }, "original": { - "owner": "danth", + "owner": "jalil-salame", + "ref": "enable-option", "repo": "stylix", "type": "github" } diff --git a/flake.nix b/flake.nix index d24c6f0..8ffbc41 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - stylix.url = "github:danth/stylix"; + stylix.url = "github:jalil-salame/stylix/enable-option"; disko.url = "github:nix-community/disko"; disko.inputs.nixpkgs.follows = "nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; @@ -41,7 +41,7 @@ system = "x86_64-linux"; # helper function to create a machine mkHost = { modules, specialArgs ? { pkgsVersion = nixpkgs-unstable; } - , system ? "x86_64-linux", minimal ? false, stylixEnabled ? false }: + , system ? "x86_64-linux", minimal ? false }: specialArgs.pkgsVersion.lib.nixosSystem { inherit system; modules = modules ++ [ @@ -59,13 +59,11 @@ ] ++ (if !minimal then [ home-manager-unstable.nixosModules.home-manager nixos-cosmic.nixosModules.default + stylix.nixosModules.stylix + ./modules/graphical/stylix.nix ./modules/graphical/cosmic.nix ] else - [ ]) ++ (if stylixEnabled then [ - stylix.nixosModules.stylix - ./modules/graphical/stylix.nix - ] else - [ ]); + [ ]); specialArgs = specialArgs // { inherit inputs outputs; }; }; in flake-utils.lib.eachDefaultSystem (system: { @@ -90,7 +88,6 @@ }; }; "kop-pc" = mkHost { - stylixEnabled = true; modules = [ ./users/kopatz ./systems/pc/configuration.nix ]; }; "nix-laptop" = mkHost { diff --git a/home-manager/stylix.nix b/home-manager/stylix.nix new file mode 100644 index 0000000..612ea82 --- /dev/null +++ b/home-manager/stylix.nix @@ -0,0 +1,3 @@ +{ osConfig, pkgs, config, lib, ... }: +let cfg = osConfig.custom.graphical.stylix; +in { config = lib.mkIf cfg.enable { stylix.enable = true; }; } diff --git a/modules/graphical/stylix.nix b/modules/graphical/stylix.nix index 9176f59..b499904 100644 --- a/modules/graphical/stylix.nix +++ b/modules/graphical/stylix.nix @@ -40,6 +40,7 @@ in { }; }; stylix = { + enable = true; autoEnable = lib.mkForce true; polarity = "dark"; image = cfg.image; @@ -57,7 +58,7 @@ in { desktop = 0.7; terminal = 0.7; }; - targets.hyprland.enable = false; + #targets.hyprland.enable = false; does not exist in the MR version yet fonts = { serif = config.stylix.fonts.sansSerif; sansSerif = { diff --git a/users/anon/home.nix b/users/anon/home.nix index 00dbcb0..5c5202f 100644 --- a/users/anon/home.nix +++ b/users/anon/home.nix @@ -21,5 +21,4 @@ inputs.nix-colors.homeManagerModule ]; - colorScheme = inputs.nix-colors.colorSchemes.tokyo-night-dark; } diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index c289dc1..9214ec4 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -28,9 +28,10 @@ #../../home-manager/theme.nix ../../home-manager/zsh.nix ../../home-manager/i3.nix + ../../home-manager/stylix.nix inputs.nixvim.homeManagerModules.nixvim inputs.nix-colors.homeManagerModule - ] ++ lib.optional osConfig.custom.graphical.i3.enable ../../home-manager/i3.nix; # need this hack because i3 uses stylix, and it errors otherwise + ]; - colorScheme = import ../../home-manager/themes/yorha/colors.nix; + #colorScheme = import ../../home-manager/themes/yorha/colors.nix; }