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
* To change system-wide themes, you need to change the following:
* Current themes:
1. gruvbox
2. synthwave
## Desktops
### gnome
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; };
in {
nixosConfigurations = {
nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; gpu = "intel"; };
nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; gpu = "nvidia"; };
nixos-laptop = libx.mkHost {
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 = {
"albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; };
"albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; };
"albert@nixos-laptop" = libx.mkHome {
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 = {
# https://github.com/davatorium/rofi/blob/next/CONFIG.md
# Rofi configuration

View file

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

View file

@ -1,3 +1,3 @@
{ pkgs, config, ... }: {
{ ... }: {
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 = {
inherit username;
@ -28,12 +28,14 @@
./users/${username}
]
++ 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/desktops/${desktop}/ # Machine-agnostic desktop configs
++ lib.optional (builtins.isString desktop) ./hosts/${hostname}/desktops/${desktop}; # Machine-specific desktop configs
nixpkgs = {
overlays = [
# Currently in use in the Firefox config
inputs.nur.overlay
];
};

View file

@ -1,11 +1,5 @@
{ ... }: {
{ theme, ... }: {
imports = [
./gruvbox/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
./${theme}/hyprland-conf.nix
];
}

View file

@ -1,9 +1,15 @@
{ inputs, outputs, stateVersion, hmStateVersion, ... }: {
# 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};
extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion; };
extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion theme; };
modules = [
../home-manager
inputs.doom-emacs.hmModule
@ -11,8 +17,16 @@
};
# Helper function for generating host configs
mkHost = { hostname, username, desktop ? null, installer ? null, gpu ? null, platform ? "x86_64-linux" }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform; };
mkHost = {
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 = [
../nixos
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 = [
# Services
./common/services/openssh.nix