Testing a theme switcher

This commit is contained in:
iFargle 2023-08-31 20:22:44 +09:00
parent aaf51f0bde
commit 59fb76c778
12 changed files with 53 additions and 22 deletions

View file

@ -60,6 +60,10 @@ Completed ToDo List [here](complete.md)
# Theming # Theming
* To change system-wide themes, you need to change the following: * To change system-wide themes, you need to change the following:
* Current themes:
1. gruvbox
2. synthwave
## Desktops ## Desktops
### gnome ### gnome
1. `nixos/common/desktops/gnome/default.nix` - Change the imports at the bottom. 1. `nixos/common/desktops/gnome/default.nix` - Change the imports at the bottom.

View file

@ -21,12 +21,20 @@
libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; }; libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; };
in { in {
nixosConfigurations = { nixosConfigurations = {
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; gpu = "intel"; }; nixos-laptop = libx.mkHost {
nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; gpu = "nvidia"; }; hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox";
};
nixos-desktop = libx.mkHost {
hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; gpu = "nvidia"; theme = "gruvbox";
};
}; };
homeConfigurations = { homeConfigurations = {
"albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; }; "albert@nixos-laptop" = libx.mkHome {
"albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; }; hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; theme = "gruvbox";
};
"albert@nixos-desktop" = libx.mkHome {
hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; theme = "gruvbox";
};
}; };
}; };
} }

View file

@ -0,0 +1,9 @@
{ pkgs, theme, ... }: {
imports = [
./${theme}/mako-conf.nix
./${theme}/rofi-conf.nix
./${theme}/swaylock-conf.nix
./${theme}/swayosd-conf.nix
./${theme}/wlogout-conf.nix
];
}

View file

@ -1,4 +1,4 @@
{ hostname, ...}: { { ...}: {
home.file = { home.file = {
# https://github.com/davatorium/rofi/blob/next/CONFIG.md # https://github.com/davatorium/rofi/blob/next/CONFIG.md
# Rofi configuration # Rofi configuration

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { { pkgs, ... }: {
programs.swaylock = { programs.swaylock = {
enable = true; enable = true;
# swaylock-effects has extra effects like image blur and stuff. # swaylock-effects has extra effects like image blur and stuff.

View file

@ -1,3 +1,3 @@
{ pkgs, config, ... }: { { ... }: {
services.swayosd.enable = true; services.swayosd.enable = true;
} }

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, inputs, hostname, username, desktop, hmStateVersion, ... }: { { lib, config, pkgs, inputs, hostname, username, desktop, theme, hmStateVersion, ... }: {
home = { home = {
inherit username; inherit username;
@ -28,12 +28,14 @@
./users/${username} ./users/${username}
] ]
++ lib.optional (builtins.isString desktop) ./common/software/gui/firefox.nix ++ lib.optional (builtins.isString desktop) ./common/software/gui/firefox.nix
# ++ lib.optional (builtins.isString desktop) ./common/software/gui/thunderbird.nix ++ lib.optional (builtins.isString desktop) ./common/software/gui/thunderbird.nix
++ lib.optional (builtins.isString desktop) ./common/software/gui/vscodium.nix ++ lib.optional (builtins.isString desktop) ./common/software/gui/vscodium.nix
++ lib.optional (builtins.isString desktop) ./common/desktops/${desktop}/ # Machine-agnostic desktop configs
++ lib.optional (builtins.isString desktop) ./hosts/${hostname}/desktops/${desktop}; # Machine-specific desktop configs ++ lib.optional (builtins.isString desktop) ./hosts/${hostname}/desktops/${desktop}; # Machine-specific desktop configs
nixpkgs = { nixpkgs = {
overlays = [ overlays = [
# Currently in use in the Firefox config
inputs.nur.overlay inputs.nur.overlay
]; ];
}; };

View file

@ -1,11 +1,5 @@
{ ... }: { { theme, ... }: {
imports = [ imports = [
./gruvbox/hyprland-conf.nix ./${theme}/hyprland-conf.nix
./gruvbox/mako-conf.nix
./gruvbox/rofi-conf.nix
./gruvbox/swaylock-conf.nix
./gruvbox/waybar/waybar-conf.nix
./gruvbox/swayosd-conf.nix
./gruvbox/wlogout.nix
]; ];
} }

View file

@ -1,9 +1,15 @@
{ inputs, outputs, stateVersion, hmStateVersion, ... }: { { inputs, outputs, stateVersion, hmStateVersion, ... }: {
# Helper function for generating home-manager configs # Helper function for generating home-manager configs
mkHome = { hostname, username, desktop ? null, platform ? "x86_64-linux" }: inputs.home-manager.lib.homeManagerConfiguration { mkHome = {
hostname,
username,
desktop ? null,
platform ? "x86_64-linux",
theme ? null
}: inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${platform}; pkgs = inputs.nixpkgs.legacyPackages.${platform};
extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion; }; extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion theme; };
modules = [ modules = [
../home-manager ../home-manager
inputs.doom-emacs.hmModule inputs.doom-emacs.hmModule
@ -11,8 +17,16 @@
}; };
# Helper function for generating host configs # Helper function for generating host configs
mkHost = { hostname, username, desktop ? null, installer ? null, gpu ? null, platform ? "x86_64-linux" }: inputs.nixpkgs.lib.nixosSystem { mkHost = {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform; }; hostname,
username,
desktop ? null,
installer ? null,
gpu ? null,
platform ? "x86_64-linux",
theme ? null
}: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; };
modules = [ modules = [
../nixos ../nixos
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, hostname, stateVersion, username, desktop, gpu, inputs, platform, ... }: { { lib, config, pkgs, hostname, stateVersion, username, desktop, gpu, inputs, platform, theme, ... }: {
imports = [ imports = [
# Services # Services
./common/services/openssh.nix ./common/services/openssh.nix