From 6eb422e4ee01eeafb19cb0067f2a7ac8ae47cb55 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 6 Sep 2023 19:29:51 +0200 Subject: [PATCH] GNOME configuration --- hosts/yodaTab/home-manager.nix | 1 + hosts/yodaTux/home-manager.nix | 2 ++ modules/gnome-config.home.nix | 21 +++++++++++++++++++++ modules/gnome-extensions.home.nix | 6 +++--- modules/gnome-fractional-scaling.home.nix | 16 ++++++++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 modules/gnome-config.home.nix create mode 100644 modules/gnome-fractional-scaling.home.nix diff --git a/hosts/yodaTab/home-manager.nix b/hosts/yodaTab/home-manager.nix index 47d0359..e39d9c5 100644 --- a/hosts/yodaTab/home-manager.nix +++ b/hosts/yodaTab/home-manager.nix @@ -7,6 +7,7 @@ in imports = [ (import "${home-manager}/nixos") ../../modules/base.home.nix + ../../modules/gnome-config.home.nix ../../modules/gnome-extensions.home.nix ../../modules/git.home.nix ../../modules/zsh.home.nix diff --git a/hosts/yodaTux/home-manager.nix b/hosts/yodaTux/home-manager.nix index 47d0359..0700b8c 100644 --- a/hosts/yodaTux/home-manager.nix +++ b/hosts/yodaTux/home-manager.nix @@ -7,7 +7,9 @@ in imports = [ (import "${home-manager}/nixos") ../../modules/base.home.nix + ../../modules/gnome-config.home.nix ../../modules/gnome-extensions.home.nix + ../../modules/gnome-fractional-scaling.home.nix ../../modules/git.home.nix ../../modules/zsh.home.nix ../../modules/nitrokey-ssh-gpg.home.nix diff --git a/modules/gnome-config.home.nix b/modules/gnome-config.home.nix new file mode 100644 index 0000000..4f7a638 --- /dev/null +++ b/modules/gnome-config.home.nix @@ -0,0 +1,21 @@ +{ config, pkgs, ... }: + +{ + # https://github.com/danieldk/nix-home/blob/master/home/cfg/desktop.nix + + programs.dconf.enable = true; + + home-manager.users.yoda = { osConfig, config, pkgs, ... }: { + dconf.settings = { + "org/gnome/settings-daemon/plugins/color" = { + night-light-enabled = true; + #night-light-temperature = "uint32 3700"; + }; + + "org/gnome/mutter" = { + dynamic-workspaces = true; + workspaces-only-on-primary = true; + }; + }; + }; +} diff --git a/modules/gnome-extensions.home.nix b/modules/gnome-extensions.home.nix index ffdb883..de84cb8 100644 --- a/modules/gnome-extensions.home.nix +++ b/modules/gnome-extensions.home.nix @@ -5,6 +5,8 @@ # https://the-empire.systems/nixos-gnome-settings-and-keyboard-shortcuts # https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/ + programs.dconf.enable = true; + users.users.yoda = { packages = with pkgs.gnomeExtensions; [ caffeine @@ -12,8 +14,6 @@ ]; }; - programs.dconf.enable = true; - home-manager.users.yoda = { osConfig, config, pkgs, ... }: { # TODO: Alternative # home.packages = with pkgs.gnomeExtensions; [ @@ -30,7 +30,7 @@ pkgs.gnomeExtensions.openweather.extensionUuid ]; # TODO: Alternative to the above - # "org/gnome/shell".enabled-extensions = map (extension: extension.extensionUuid) home.packages; + # enabled-extensions = map (extension: extension.extensionUuid) home.packages; }; # Configure openweather extension. diff --git a/modules/gnome-fractional-scaling.home.nix b/modules/gnome-fractional-scaling.home.nix new file mode 100644 index 0000000..0b27635 --- /dev/null +++ b/modules/gnome-fractional-scaling.home.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + # https://wiki.archlinux.org/title/HiDPI#Wayland + # Results in blurry font in non-Wayland applications :/ + + programs.dconf.enable = true; + + home-manager.users.yoda = { osConfig, config, pkgs, ... }: { + dconf.settings = { + "org/gnome/mutter" = { + experimental-features = [ "scale-monitor-framebuffer" ]; + }; + }; + }; +}