dotfiles

My PC Dotfiles & Website
commit d0d9101aed92186fccd2bcd87affb173b6e3ed6e
parent 534bfbac98cbb615abab5fb9994c7f310cdbd012
Author: maydayv7 <maydayv7@gmail.com>
Date:   Fri, 19 Jan 2024 19:16:06 +0530

fix: GNOME `dconf` and `xdg-portal`

+ Refactor and add `hardware.cpu`

Diffstat:

MREADME.md | 14+++++++++++---
Mdevices/futura.nix | 2+-
Mdevices/vortex.nix | 7+++++--
Mfiles/gnome/dconf/extensions.nix | 53++++++++++++++++++++++++++++++++++++++++++++++-------
Afiles/images/desktop/gnome/desktop.png | 0
Rfiles/images/desktop/gnome.png -> files/images/desktop/gnome/overview.png | 0
Mfiles/pantheon/dconf.nix | 31+++++++++++++++++++++++++++++--
Mmodules/README.md | 4+++-
Mmodules/base/firmware.nix | 5+----
Mmodules/configuration.nix | 8+-------
Mmodules/gui/desktop/gnome.nix | 28+++++++++++++++-------------
Mmodules/gui/desktop/xfce.nix | 1+
Mmodules/gui/gtk.nix | 1-
Mmodules/hardware/boot.nix | 3+--
Mmodules/hardware/default.nix | 26+++++++++++++++++++++-----
15 files changed, 135 insertions(+), 48 deletions(-)

diff --git a/README.md b/README.md @@ -8,21 +8,28 @@ This [repository](https://github.com/maydayv7/dotfiles) contains the configuration and `dotfiles` for my continuously evolving multi-PC setup (using [Nix](https://nixos.org/)). All the devices I own, controlled by code. It also builds and deploys my website to [maydayv7.tk](https://maydayv7.tk). You can follow along with my [NixOS Desktop](https://maydayv7.tk/series/nixos-desktop/) Series -![GNOME Desktop](./files/images/desktop/gnome.png) - <details> -<summary><i>More...</i></summary> +<summary>Desktop Pictures</summary> + +![GNOME Desktop](./files/images/desktop/gnome/desktop.png) + +![GNOME Overview](./files/images/desktop/gnome/overview.png) ![Pantheon Desktop](./files/images/desktop/pantheon.png) ![XFCE Desktop](./files/images/desktop/xfce.png) +<details> +<summary><i>Older...</i></summary> + ![GNOME 44](./files/images/desktop/old/gnome_44.png) [![GNOME 41](./files/images/desktop/old/gnome_41.png)](https://www.reddit.com/r/unixporn/comments/ssb7mf/gnome_my_dream/) </details> +</details> + ## Features <img alt="Built with Nix" src="https://raw.githubusercontent.com/nix-community/builtwithnix.org/62897617ceefe428f135e82c3a87ea093e29e045/img/built_with_nix.svg" width="130" height="50"/> @@ -408,6 +415,7 @@ You can navigate to the `README`s present in the various directories to know mor - Fix Android Virtualisation - Add AppImage Support - Add `gui.gtk` Module +- Refactor and add `hardware.cpu` - Add `sql` Shell - Actually persist `~/.local/share/Trash` diff --git a/devices/futura.nix b/devices/futura.nix @@ -10,7 +10,7 @@ kernel = "lts"; hardware = { boot = "efi"; - cores = 4; + cpu.cores = 4; filesystem = "simple"; support = ["laptop"]; modules = ["common-cpu-intel" "common-pc" "common-pc-laptop"]; diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -11,11 +11,14 @@ hardware = { boot = "secure"; - cores = 8; filesystem = "advanced"; support = ["laptop" "mobile" "printer" "virtualisation"]; modules = ["dell-inspiron-5509"]; vm.android.enable = false; + cpu = { + cores = 8; + mode = "performance"; + }; }; shell.utilities = true; @@ -37,7 +40,7 @@ }; gui = { - desktop = "pantheon"; + desktop = "gnome"; wallpaper = "Wave"; }; diff --git a/files/gnome/dconf/extensions.nix b/files/gnome/dconf/extensions.nix @@ -6,9 +6,8 @@ ... }: with lib.hm.gvariant; let - inherit (builtins) head; homeDir = config.home.homeDirectory; - fonts = sys.fonts.fontconfig.defaultFonts; + font = builtins.head sys.fonts.fontconfig.defaultFonts.sansSerif; in { # Shell Extensions dconf.settings = { @@ -29,12 +28,13 @@ in { "guillotine@fopdoodle.net" "langTray@a7medkhalaf" "lockkeys@vaina.lt" + "openbar@neuromorph" + "overviewhover@mattdavis90" "pano@elhan.io" "quick-settings-avatar@d-go" "Shortcuts@kyle.aims.ac.za" "status-area-horizontal-spacing@mathematical.coffee.gmail.com" "top-bar-organizer@julian.gse.jsts.xyz" - "transparent-top-bar@zhanghai.me" "user-theme@gnome-shell-extensions.gcampax.github.com" "vertical-workspaces@G-dH.github.com" "Vitals@CoreCoding.com" @@ -135,6 +135,45 @@ in { visibility = 50; }; + "org/gnome/shell/extensions/openbar" = { + balpha = 1.0; + bartype = "Floating"; + bcolor = ["0.9647058844566345" "0.9607843160629272" "0.95686274766922"]; + bgalpha = 0.8; + bgalpha2 = 0.0; + bgcolor = ["0.1411764770746231" "0.1411764770746231" "0.1411764770746231"]; + bgcolor2 = ["0.10980392247438431" "0.4431372582912445" "0.8470588326454163"]; + bgpalette = false; + bradius = 15.0; + bwidth = 1.0; + default-font = "${font} 12"; + fgcolor = ["1" "1" "1"]; + font = "${font} Bold 15"; + gradient = false; + gradient-direction = "vertical"; + hcolor = ["0.46666666865348816" "0.4627451002597809" "0.48235294222831726"]; + heffect = false; + height = 32.0; + hpad = 0.0; + margin = 1.0; + mbalpha = 1.0; + mbcolor = ["0.9647058844566345" "0.9607843160629272" "0.95686274766922"]; + mbgalpha = 0.8; + mbgcolor = ["0.1411764770746231" "0.1411764770746231" "0.1411764770746231"]; + menustyle = true; + mhcolor = ["0.3843137323856354" "0.6274510025978088" "0.9176470637321472"]; + mscolor = ["0.10980392247438431" "0.4431372582912445" "0.8470588326454163"]; + mshalpha = 0.25; + mshcolor = ["0.8784313797950745" "0.8980392217636108" "0.9137254953384399"]; + neon = false; + overview = true; + reloadstyle = false; + removestyle = false; + shadow = false; + shalpha = 1.0; + vpad = 4.0; + }; + "org/gnome/shell/extensions/pano" = { database-location = "${homeDir}/.local/share/clipboard"; global-shortcut = ["<Super>v"]; @@ -143,11 +182,11 @@ in { play-audio-on-copy = false; send-notification-on-copy = false; window-position = mkUint32 2; - item-date-font-family = head fonts.sansSerif; + item-date-font-family = font; item-date-font-size = 11; - item-title-font-family = head fonts.sansSerif; + item-title-font-family = font; item-title-font-size = 20; - search-bar-font-family = head fonts.sansSerif; + search-bar-font-family = font; search-bar-font-size = 14; }; @@ -224,7 +263,7 @@ in { "org/gnome/shell/extensions/vertical-workspaces" = { aaa-loading-profile = true; - always-activate-selected-window = true; + always-activate-selected-window = false; animation-speed-factor = 120; app-display-module = true; app-favorites-module = true; diff --git a/files/images/desktop/gnome/desktop.png b/files/images/desktop/gnome/desktop.png Binary files differ. diff --git a/files/images/desktop/gnome.png b/files/images/desktop/gnome/overview.png Binary files differ. diff --git a/files/pantheon/dconf.nix b/files/pantheon/dconf.nix @@ -152,10 +152,18 @@ in { "io/elementary/code/saved-state".outline-visible = true; "io/elementary/code/settings" = { - strip-trailing-on-save = true; + autosave = false; + prefer-dark-style = true; show-mini-map = true; show-right-margin = true; - prefer-dark-style = true; + strip-trailing-on-save = true; + plugins-enabled = [ + "editorconfig" + "word-completion" + "brackets-completion" + "preserve-indent" + "detect-indent" + ]; }; "com/github/hezral/clips" = { @@ -279,5 +287,24 @@ in { command = "gtk-launch com.github.hezral.clips"; name = "gtk-launch com.github.hezral.clips"; }; + + # Gestures + "org/gnome/shell/extensions/windowgestures" = { + fn-fullscreen = true; + fn-maximized-snap = true; + fn-move = true; + fn-move-snap = true; + fn-resize = true; + pinch-enable = true; + pinch3-in = 0; + pinch3-out = 0; + pinch4-in = 14; + pinch4-out = 3; + swipe3-down = 1; + swipe4-updown = 22; + taphold-move = true; + three-finger = false; + use-active-window = true; + }; }; } diff --git a/modules/README.md b/modules/README.md @@ -42,7 +42,9 @@ Configuration [Builder](./configuration.nix) - [`hardware`](./hardware): Module that configures device and additional hardware - - `boot`: Supported Boot Firmware - `"mbr" / "efi" / "secure"` - - `cores`: Number of CPU Cores - Ex. `4` + - `cpu` - + - `cores`: Number of CPU Cores - Ex. `4` + - `mode`: CPU Frequency Governor Mode - `"ondemand" / "performance" / "powersave"` - `filesystem`: Disk File System Choice - `"simple" / "advanced"` - - `persist`: System Files to Preserve across Reboots (while using `advanced` File System Layout) - `modules`: List of Hardware Configuration Modules imported from [`inputs.hardware`](https://github.com/nixos/nixos-hardware) - Ex. `[ "common-pc" ]` diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -64,10 +64,7 @@ # Power Management services.thermald.enable = true; - powerManagement = { - enable = true; - cpuFreqGovernor = "powersave"; - }; + powerManagement.enable = true; # Memory systemd.oomd.enable = false; diff --git a/modules/configuration.nix b/modules/configuration.nix @@ -109,7 +109,7 @@ in else [] ); - inherit apps gui hardware shell; + inherit apps gui hardware nix shell; base = {inherit kernel kernelModules;}; # Device Name @@ -124,12 +124,6 @@ in # Package Configuration nixpkgs = {inherit pkgs;}; - nix = - { - settings.max-jobs = hardware.cores or 4; - } - // nix; - system = { # Updates autoUpgrade = { diff --git a/modules/gui/desktop/gnome.nix b/modules/gui/desktop/gnome.nix @@ -167,7 +167,7 @@ in { etc."xdg/Kvantum/kvantum.kvconfig".text = mkAfter "theme=KvLibadwaitaDark"; ## Package List - systemPackages = with pkgs.gnome; + systemPackages = with pkgs; (with gnome; [ # GNOME Apps gnome-boxes @@ -181,7 +181,7 @@ in { gnome-mines quadrapassel ] - ++ (with pkgs; [ + ++ [ # GNOME Circle apostrophe blackbox-terminal @@ -205,9 +205,9 @@ in { dconf2nix gnuchess custom.kvlibadwaita - ]) - ++ (with pkgs; - with unstable.gnomeExtensions // gnomeExtensions; [ + ] + ++ ( + with unstable.gnomeExtensions; [ # GNOME Shell Extensions alttab-mod appindicator @@ -219,18 +219,20 @@ in { gamemode-indicator-in-system-settings guillotine lock-keys + open-bar + overview-hover pano shortcuts status-area-horizontal-spacing top-bar-organizer - transparent-top-bar user-avatar-in-quick-settings vertical-workspaces vitals window-gestures window-title-is-back xlanguagetray - ]); + ] + )); }; # Persisted Files @@ -259,9 +261,8 @@ in { ## Minimal GNOME Desktop Configuration (mkIf (desktop == "gnome-minimal") { - # Disable Suspension services.xserver = { - displayManager.gdm.autoSuspend = false; + displayManager.gdm.autoSuspend = false; # Disable Suspension desktopManager.gnome = { extraGSettingsOverrides = gnome.iso; extraGSettingsOverridePackages = [pkgs.gnome.gnome-settings-daemon]; @@ -273,15 +274,16 @@ in { }; # Essential Utilities - environment.systemPackages = with pkgs.gnome; [ + environment.systemPackages = with (pkgs.gnome // pkgs); [ epiphany - pkgs.gnome-console - pkgs.gnome-text-editor + gnome-console + gnome-text-editor gnome-system-monitor + gparted nautilus ]; - # Additional Excluded Packages + # Excluded Packages xdg.portal.enable = mkForce false; qt.enable = mkForce false; diff --git a/modules/gui/desktop/xfce.nix b/modules/gui/desktop/xfce.nix @@ -61,6 +61,7 @@ in { }; # Essential Utilities + xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; services = { blueman.enable = true; touchegg.enable = true; diff --git a/modules/gui/gtk.nix b/modules/gui/gtk.nix @@ -14,7 +14,6 @@ in { # Environment Setup programs.dconf.enable = true; services.dbus.packages = [pkgs.dconf]; - xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk]; # Platform Integration programs.gnupg.agent.pinentryFlavor = "gtk2"; diff --git a/modules/hardware/boot.nix b/modules/hardware/boot.nix @@ -33,7 +33,7 @@ in { }; # Plymouth - consoleLogLevel = 0; + consoleLogLevel = 3; initrd.verbose = false; plymouth.enable = true; kernelParams = [ @@ -41,7 +41,6 @@ in { "splash" "boot.shell_on_fail" "i915.fastboot=1" - "loglevel=3" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix @@ -1,23 +1,34 @@ { + config, + inputs, lib, util, ... }: let inherit (util.map) modules; inherit (lib) mkOption types; + cfg = config.hardware; in { imports = modules.list ./.; options.hardware = with types; { - cores = mkOption { - description = "Number of CPU Cores"; - type = int; - default = 4; + cpu = { + cores = mkOption { + description = "Number of CPU Cores"; + type = int; + default = 4; + }; + + mode = mkOption { + description = "CPU Frequency Governor Mode"; + type = enum ["ondemand" "performance" "powersave"]; + default = "powersave"; + }; }; modules = mkOption { description = "List of Modules imported from 'inputs.hardware'"; - type = listOf str; + type = listOf (enum (attrNames inputs.hardware.nixosModules)); default = []; }; @@ -26,5 +37,10 @@ in { type = listOf (enum (modules.name ./.)); default = []; }; + + config = { + powerManagement.cpuFreqGovernor = cfg.cpu.mode; + nix.settings.max-jobs = cfg.cpu.cores; + }; }; }