Skip to content

Commit

Permalink
✨ (gnome): Added GNOME
Browse files Browse the repository at this point in the history
Disabled stylix for KDE Plasma 6, see danth/stylix#547
Updated the documentation
  • Loading branch information
theobori committed Nov 1, 2024
1 parent dfcafe4 commit 51d9e01
Show file tree
Hide file tree
Showing 14 changed files with 313 additions and 22 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Before diving in, ensure that you have Nix installed on your system. If not, you
can download and install it from the official
[Nix website](https://nixos.org/download.html) or from the
[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer).
If running on macOS, you need to have Nix-Darwin installed, as well. You can follow the
installation instruction on [GitHub](https://github.com/LnL7/nix-darwin?tab=readme-ov-file#flakes).

### Clone this repository to your local machine

Expand All @@ -31,9 +29,6 @@ cd nixos-configuration
# linux
sudo nixos-rebuild switch --flake .

# macos
darwin-rebuild switch --flake .

# with direnv
flake switch
```
Expand Down Expand Up @@ -73,9 +68,6 @@ Here's an overview of what my Nix configuration offers:
- Access the Nix User Repository (NUR) for additional packages and
enhancements.

- **macOS Support**: Seamlessly configure and manage Nix on macOS using the
power of [Nix-darwin](https://github.com/LnL7/nix-darwin), also leveraging homebrew for GUI applications.

- **Home Manager**: Manage your dotfiles, home environment, and user-specific
configurations with [Home Manager](https://github.com/nix-community/home-manager).

Expand Down
3 changes: 0 additions & 3 deletions docs/docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Here's an overview of what my Nix configuration offers:
- Access the Nix User Repository (NUR) for additional packages and
enhancements.

- **macOS Support**: Seamlessly configure and manage Nix on macOS using the
power of [Nix-darwin](https://github.com/LnL7/nix-darwin), also leveraging homebrew for GUI applications.

- **Home Manager**: Manage your dotfiles, home environment, and user-specific
configurations with [Home Manager](https://github.com/nix-community/home-manager).

Expand Down
5 changes: 0 additions & 5 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Before diving in, ensure that you have Nix installed on your system. If not, you
can download and install it from the official
[Nix website](https://nixos.org/download.html) or from the
[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer).
If running on macOS, you need to have Nix-Darwin installed, as well. You can follow the
installation instruction on [GitHub](https://github.com/LnL7/nix-darwin?tab=readme-ov-file#flakes).

### Clone this repository to your local machine

Expand All @@ -16,9 +14,6 @@ cd nixos-configuration
# linux
sudo nixos-rebuild switch --flake .

# macos
darwin-rebuild switch --flake .

# with direnv
flake switch
```
Expand Down
24 changes: 24 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
mkdocs-flake.url = "github:applicative-systems/mkdocs-flake";

nixcord.url = "github:kaylorben/nixcord";

plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};

outputs =
Expand Down Expand Up @@ -86,6 +92,7 @@
stylix.homeManagerModules.stylix
sops-nix.homeManagerModules.sops
nixcord.homeManagerModules.nixcord
plasma-manager.homeManagerModules.plasma-manager
];

systems = {
Expand Down
3 changes: 3 additions & 0 deletions homes/x86_64-linux/theobori@vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ in
defaultSopsFile = lib.snowfall.fs.get-file "secrets/vm/theobori/secrets.yaml";
};
};

#desktops.addons.gnome = enabled;
desktops.addons.plasma6 = enabled;
};

home.stateVersion = "24.11";
Expand Down
8 changes: 4 additions & 4 deletions modules/home/cli/programs/gpg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
inherit (lib.${namespace}) mkBoolOpt enabled;
inherit (config.${namespace}) user;

cfg = config.${namespace}.cli.programs.gpg;
Expand All @@ -23,11 +23,11 @@ in
home.packages = with pkgs; [ kleopatra ];

programs = {
gpg = {
enable = true;
};
gpg = enabled;
};

services.gpg-agent = enabled;

sops.secrets = mkIf (config."${namespace}".services.sops.enable && cfg.useSops) {
pgp_key = {
sopsFile = lib.snowfall.fs.get-file "secrets/${host}/${user.name}/secrets.yaml";
Expand Down
132 changes: 132 additions & 0 deletions modules/home/desktops/addons/gnome/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib) mkIf types;
inherit (lib.${namespace}) mkBoolOpt mkOpt;

cfg = config.${namespace}.desktops.addons.gnome;
in
{
options.${namespace}.desktops.addons.gnome = with types; {
enable = mkBoolOpt false "Whether or not to enable GNOME addons.";
settings = mkOpt attrs {
"org/gnome/desktop/wm/preferences" = {
num-workspaces = 4;
};

"org/gnome/desktop/wm/keybindings" = {
switch-to-workspace-1 = [ "<Super>1" ];
switch-to-workspace-2 = [ "<Super>2" ];
switch-to-workspace-3 = [ "<Super>3" ];
switch-to-workspace-4 = [ "<Super>4" ];

move-to-workspace-1 = [ "<Shift><Super>1" ];
move-to-workspace-2 = [ "<Shift><Super>2" ];
move-to-workspace-3 = [ "<Shift><Super>3" ];
move-to-workspace-4 = [ "<Shift><Super>4" ];
};

"org/gnome/shell/keybindings" = {
# Remove the default hotkeys for opening favorited applications.
switch-to-application-1 = [ ];
switch-to-application-2 = [ ];
switch-to-application-3 = [ ];
switch-to-application-4 = [ ];
switch-to-application-5 = [ ];
switch-to-application-6 = [ ];
switch-to-application-7 = [ ];
switch-to-application-8 = [ ];
switch-to-application-9 = [ ];
switch-to-application-10 = [ ];
};

"org/gnome/shell/extensions/dash-to-dock" = {
autohide = true;
dock-fixed = false;
dock-position = "BOTTOM";
pressure-threshold = 200.0;
require-pressure-to-show = true;
show-favorites = true;
hot-keys = false;
};

"org/gnome/shell/extensions/just-perfection" = {
panel-size = 48;
activities-button = false;
};

"org/gnome/shell/extensions/Logo-menu" = {
hide-softwarecentre = true;

# Use right click to open Activities.
menu-button-icon-click-type = 3;

# Use the NixOS logo.
menu-button-icon-image = 23;
};

"org/gnome/shell/extensions/aylurs-widgets" = {
background-clock = false;
battery-bar = false;
dash-board = false;
date-menu-date-format = "%H:%M %B %m";
date-menu-hide-clocks = true;
date-menu-hide-system-levels = true;
date-menu-hide-user = true;

# Hide the indincator
date-menu-indicator-position = 2;

media-player = false;
media-player-prefer = "firefox";
notification-indicator = false;
power-menu = false;
quick-toggles = false;
workspace-indicator = false;
};

"org/gnome/shell/extensions/top-bar-organizer" = {
left-box-order = [
"menuButton"
"activities"
"dateMenu"
"appMenu"
];

center-box-order = [ "Space Bar" ];

right-box-order = [
"keyboard"
"EmojisMenu"
"wireless-hid"
"drive-menu"
"vitalsMenu"
"screenRecording"
"screenSharing"
"dwellClick"
"a11y"
"quickSettings"
];
};

"org/gnome/shell/extensions/space-bar/shortcuts" = {
enable-activate-workspace-shortcuts = false;
};

"org/gnome/shell/extensions/space-bar/behavior" = {
show-empty-workspaces = false;
};
} "Manage the dconf settings.";
};

config = mkIf cfg.enable {
dconf = {
enable = true;
inherit (cfg) settings;
};
};
}
42 changes: 42 additions & 0 deletions modules/home/desktops/addons/plasma6/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
config,
lib,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf types;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.desktops.addons.plasma6;
in
{
options.${namespace}.desktops.addons.plasma6 = with types; {
enable = mkBoolOpt false "Whether or not to enable GNOME addons.";
};

config = mkIf cfg.enable {
home.packages = [ pkgs.${namespace}.my-dracula-theme ];

stylix = {
# Generate impure (not managed by nix) gtk files
targets.gtk.enable = false;
# Trying to apply the wallpaper too early and then it doest not load the home-manager environment
targets.kde.enable = false;
};

programs.plasma = {
enable = true;

workspace = {
colorScheme = "Dracula";
theme = "Dracula";

wallpaper = pkgs.${namespace}.wallpapers.nix-simple;

enableMiddleClickPaste = true;
};
};
};
}
2 changes: 0 additions & 2 deletions modules/home/styles/stylix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ in
# autoenable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/dracula.yaml";

targets.gtk.enable = false;

image = pkgs.${namespace}.wallpapers.nix-simple;

fonts = {
Expand Down
Loading

0 comments on commit 51d9e01

Please sign in to comment.