Update modules

- 'A happy GNOME' config
- Refactoring some parts of the codebase
This commit is contained in:
Gabriel Arazas 2021-12-04 23:27:10 +08:00
parent 97ef9f3382
commit b7b641aacd
6 changed files with 73 additions and 26 deletions

View File

@ -20,6 +20,7 @@ in {
enable = true;
dev.enable = true;
nixos.enable = true;
man.generateCaches = true;
};
# Configure all of the development-related configuration in the system.
@ -36,6 +37,7 @@ in {
curl # Our favorite network client.
cmake # The poster boy for the hated build system.
direnv # The power of local development environment.
gcc # The usual toolchain.
gnumake # Make your life easier with GNU Make.
moreutils # Less is more but more utilities, the merrier.
];

View File

@ -1,7 +1,13 @@
{ config, options, lib, pkgs, ... }:
let
name = "a-happy-gnome";
cfg = config.modules.themes.a-happy-gnome;
dconf = pkgs.gnome3.dconf;
customDconfDb = pkgs.stdenv.mkDerivation {
name = "${name}-dconf-db";
buildCommand = "${dconf}/bin/dconf compile $out ${./schemas}";
};
in
{
options.modules.themes.a-happy-gnome.enable = lib.mkEnableOption "Enables my configuration of GNOME Shell.";
@ -11,10 +17,36 @@ 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;
# Don't need most of the GNOME's offering so...
environment.gnome.excludePackages = with pkgs.gnome; [
gedit
eog
geary
totem
epiphany
gnome-terminal
gnome-music
gnome-software
yelp
] ++ [
gnome-user-docs
gnome-tour
];
programs.dconf = {
enable = true;
# This is an internal function which is subject to change.
# However, this seems to be in for some time but still, be wary.
# The function is found on `nixos/programs/dconf.nix` from nixpkgs.
profiles.customGnomeConfig = pkgs.writeTextFile {
name = "${name}-dconf-profile";
text = ''
user-db:user
file-db:${customDconfDb}
'';
};
};
# I'm pretty sure this is already done but just to make sure.
services.gnome.chrome-gnome-shell.enable = true;

View File

@ -1,30 +1,30 @@
[org/gnome/desktop/interface]
enable-animations=true
enable-hot-corners=false
gtk-im-module='gtk-im-context-simple'
show-battery-percentage=true
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
show-banners = true
[org/gnome/desktop/privacy]
disable-microphone=false
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']
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
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)])>)>]
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
enabled = false

View File

@ -1,11 +1,26 @@
# This is used in tandem with Pop shell plugin.
[org/gnome/desktop/wm/keybindings]
begin-resize=['<Super>r']
close=['<Super>q']
close=['<Alt>F4', '<Super>q']
cycle-group=@as []
cycle-group-backward=@as []
cycle-windows=['<Super>grave']
cycle-windows-backward=['<Shift><Super>grave']
maximize=@as []
minimize=@as []
move-to-monitor-down=['<Alt><Super>j']
move-to-monitor-left=['<Alt><Super>h']
move-to-monitor-right=['<Alt><Super>l']
move-to-monitor-up=['<Alt><Super>k']
move-to-workspace-left=['<Shift><Super>h']
move-to-workspace-right=['<Shift><Super>l']
panel-main-menu=@as []
switch-group=@as []
switch-group-backward=@as []
switch-input-source=['<Super>i']
switch-input-source-backward=['<Shift><Super>i']
switch-to-workspace-left=['<Primary><Super>h']
switch-to-workspace-right=['<Primary><Super>l']
toggle-fullscreen=['<Super>f']
toggle-maximized=['<Shift><Super>f']
toggle-overview=['<Shift><Super>s']
@ -15,6 +30,7 @@ toggle-tiled-right=@as []
[org/gnome/shell/keybindings]
toggle-message-tray=['<Super>v']
# We don't want to restore them shortcuts.
[org/gnome/mutter/wayland/keybindings]
restore-shortcuts=@as []

View File

@ -19,7 +19,7 @@ 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.
# 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

View File

@ -3,17 +3,14 @@
let
cfg = config.modules.users;
invalidUsernames = [ "config" "modules" ];
userModules = lib.getUsers cfg.users;
homeManagerModules =
lib.filterAttrs (n: _: n == "modules") (lib.filesToAttr ../users);
homeManagerModules = lib.filesToAttr ../users/modules;
users = lib.attrNames userModules;
nonexistentUsers = lib.filter (name: !lib.elem name users) cfg.users;
mkUser = user: modulePath:
let
userModule = import modulePath;
defaultConfig = {
home.username = user;
home.homeDirectory = "/home/${user}";