diff --git a/lib/default.nix b/lib/default.nix index 94949c07..057ab43e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -114,15 +114,15 @@ in rec { attrs@{ system ? sys, ... }: lib.nixosSystem { inherit system; + + # Additional attributes to be referred to our modules. specialArgs = { inherit lib system inputs; }; # We also set the following in order for priority. # Later modules will override previously imported modules. modules = [ # Set the hostname. - { - networking.hostName = builtins.baseNameOf file; - } + { networking.hostName = builtins.baseNameOf file; } # Put the given attribute set (except for the system). (lib.filterAttrs (n: v: !lib.elem n [ "system" ]) attrs) @@ -131,7 +131,7 @@ in rec { file ] # Append with our custom modules from the modules folder. - ++ (lib.mapAttrsToList (n: v: import v) (filesToAttr ../modules)); + ++ (lib.modulesToList (filesToAttr ../modules)); }; /* Return an attribute set of valid users from a given list of users. diff --git a/modules/themes/a-happy-gnome/default.nix b/modules/themes/a-happy-gnome/default.nix index 4f3a38fd..611993e7 100644 --- a/modules/themes/a-happy-gnome/default.nix +++ b/modules/themes/a-happy-gnome/default.nix @@ -11,6 +11,11 @@ in services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; + # Import the configuration with dconf. + programs.dconf.enable = true; + environment.etc."dconf/profile/gnome".text = "user-db:user"; + environment.etc."dconf/db/gnome".source = ./schemas; + # I'm pretty sure this is already done but just to make sure. services.gnome.chrome-gnome-shell.enable = true; @@ -18,8 +23,15 @@ in # It is required for custom menus in extensions. gnome-menus + # My preferred extensions. gnomeExtensions.arcmenu + gnomeExtensions.gsconnect gnomeExtensions.x11-gestures + + # Setting up Pop shell. + gnome-shell-extension-pop-shell + pop-launcher + pop-launcher-plugin-duckduckgo-bangs ]; }; } diff --git a/modules/themes/a-happy-gnome/schemas/desktop.conf b/modules/themes/a-happy-gnome/schemas/desktop.conf new file mode 100644 index 00000000..aab6629c --- /dev/null +++ b/modules/themes/a-happy-gnome/schemas/desktop.conf @@ -0,0 +1,30 @@ +[org/gnome/desktop/interface] +enable-animations=true +enable-hot-corners=false +gtk-im-module='gtk-im-context-simple' +show-battery-percentage=true + +[org/gnome/desktop/notifications] +show-banners=true + +[org/gnome/desktop/privacy] +disable-microphone=false + +[org/gnome/shell] +disable-user-extensions=false +enabled-extensions=['arcmenu@arcmenu/com', 'just-perfection-desktop@just-perfection', 'gsconnect@andyholmes/github/io', 'pop-shell@system76/com', 'flypie@schneegans/github/com'] + +[org/gnome/mutter] +attach-modal-dialogs=true +dynamic-workspaces=true +edge-tiling=true +focus-change-on-pointer-rest=true +overlay-key='Super_L' +workspaces-only-on-primary=true + +[org/gnome/shell/world-clocks] +locations=[<(uint32 2, <('New York', 'KNYC', true, [(0/71180344078725644, -1/2909618758762367)], [(0/71059804659265924, -1/2916478949920254)])>)>, <(uint32 2, <('Coordinated Universal Time (UTC)', '@UTC', false, @a(dd) [], @a(dd) [])>)>, <(uint32 2, <('Cairo', 'HECA', true, [(0/52592587544986047, 0/54803338512621935)], [(0/52447144022429604, 0/54541539124822791)])>)>] + +[org/gnome/system/location] +enabled=false + diff --git a/modules/themes/a-happy-gnome/schemas/keybindings.conf b/modules/themes/a-happy-gnome/schemas/keybindings.conf new file mode 100644 index 00000000..67fc8dbb --- /dev/null +++ b/modules/themes/a-happy-gnome/schemas/keybindings.conf @@ -0,0 +1,24 @@ +[org/gnome/desktop/wm/keybindings] +begin-resize=['r'] +close=['q'] +maximize=@as [] +minimize=@as [] +panel-main-menu=@as [] +switch-input-source=['i'] +switch-input-source-backward=['i'] +toggle-fullscreen=['f'] +toggle-maximized=['f'] +toggle-overview=['s'] +toggle-tiled-left=@as [] +toggle-tiled-right=@as [] + +[org/gnome/shell/keybindings] +toggle-message-tray=['v'] + +[org/gnome/mutter/wayland/keybindings] +restore-shortcuts=@as [] + +[org/gnome/settings-daemon/plugins/media-keys] +screensaver=['Escape'] +logout=['Escape'] +help=@as [] diff --git a/modules/themes/a-happy-gnome/schemas/shell-extensions.conf b/modules/themes/a-happy-gnome/schemas/shell-extensions.conf new file mode 100644 index 00000000..c9cf7b34 --- /dev/null +++ b/modules/themes/a-happy-gnome/schemas/shell-extensions.conf @@ -0,0 +1,30 @@ +[org/gnome/shell/extensions/arcmenu] +arc-menu-icon=64 +arc-menu-placement='Panel' +available-placement=[true, false, false] +disable-recently-installed-apps=false +menu-button-icon='Arc_Menu_Icon' +menu-height=550 +menu-hotkey='Super_L' +menu-layout='Runner' +runner-position='Centered' +runner-show-frequent-apps=true +search-provider-open-windows=true +show-activities-button=false +show-search-result-details=true + +[org/gnome/shell/extensions/just-perfection] +activities-button=false +workspace-wrap-around=true +window-demands-attention-focus=true +ripple-box=false + +# The default keybindings for this extension are enough but we'll have to adjust the shell keybindings. +[org/gnome/shell/extensions/pop-shell] +active-hint=true +smart-gaps=true +tile-by-default=true +hint-color-rgba='rgba(223, 147, 122, 1)' + +[org/gnome/shell/extensions/flypie] +menu-configuration='[{"name":"Global palette","icon":"🐶️","shortcut":"space","centered":false,"id":0,"children":[{"name":"Close window","type":"Shortcut","icon":"window-close","data":{"shortcut":"q"},"angle":-1},{"name":"Next Workspace","icon":"go-next","type":"Shortcut","data":{"shortcut":"l"},"angle":90},{"name":"Favorites","icon":"emblem-favorite","type":"Favorites","data":{},"angle":-1},{"name":"Fly-Pie Settings","icon":"applications-system","type":"Command","data":"gnome-extensions prefs flypie@schneegans.github.com","angle":-1},{"name":"Previous Workspace","icon":"go-previous","type":"Shortcut","data":{"shortcut":"h"},"angle":270},{"name":"Running Apps","icon":"flypie-menu-running-apps-symbolic-#74a","type":"RunningApps","data":{"activeWorkspaceOnly":false,"appGrouping":true,"hoverPeeking":true,"nameRegex":""},"angle":-1}],"type":"CustomMenu","data":{}}]' diff --git a/modules/users.nix b/modules/users.nix index 70fa34d4..c12503bd 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -4,8 +4,7 @@ let cfg = config.modules.users; invalidUsernames = [ "config" "modules" ]; - userModules = lib.filterAttrs (n: _: !lib.elem n invalidUsernames) - (lib.filesToAttr ../users); + userModules = lib.getUsers cfg.users; homeManagerModules = lib.filterAttrs (n: _: n == "modules") (lib.filesToAttr ../users);