mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-22 18:29:39 +01:00
gnome-shell: add module
This commit is contained in:
parent
2b87a11125
commit
6ebe7be2e6
6 changed files with 224 additions and 0 deletions
|
|
@ -1595,6 +1595,18 @@ in {
|
|||
when idle or active. See https://github.com/hyprwm/hypridle for more.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2024-05-06T07:36:13+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'programs.gnome-shell'.
|
||||
|
||||
GNOME Shell is the graphical shell of the GNOME desktop environment.
|
||||
It provides basic functions like launching applications and switching
|
||||
between windows, and is also a widget engine.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ let
|
|||
./programs/git-credential-oauth.nix
|
||||
./programs/git.nix
|
||||
./programs/gitui.nix
|
||||
./programs/gnome-shell.nix
|
||||
./programs/gnome-terminal.nix
|
||||
./programs/go.nix
|
||||
./programs/gpg.nix
|
||||
|
|
|
|||
115
modules/programs/gnome-shell.nix
Normal file
115
modules/programs/gnome-shell.nix
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.gnome-shell;
|
||||
|
||||
extensionOpts = { config, ... }: {
|
||||
options = {
|
||||
id = mkOption {
|
||||
type = types.str;
|
||||
example = "user-theme@gnome-shell-extensions.gcampax.github.com";
|
||||
description = ''
|
||||
ID of the GNOME Shell extension. If not provided, it
|
||||
will be obtained from `package.extensionUuid`.
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
example = "pkgs.gnome.gnome-shell-extensions";
|
||||
description = ''
|
||||
Package providing a GNOME Shell extension in
|
||||
`$out/share/gnome-shell/extensions/''${id}`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (hasAttr "extensionUuid" config.package) {
|
||||
id = mkDefault config.package.extensionUuid;
|
||||
};
|
||||
};
|
||||
|
||||
themeOpts = {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "Plata-Noir";
|
||||
description = ''
|
||||
Name of the GNOME Shell theme.
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
example = literalExpression "pkgs.plata-theme";
|
||||
description = ''
|
||||
Package providing a GNOME Shell theme in
|
||||
`$out/share/themes/''${name}/gnome-shell`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.terlar ];
|
||||
|
||||
options.programs.gnome-shell = {
|
||||
enable = mkEnableOption "GNOME Shell customization";
|
||||
|
||||
extensions = mkOption {
|
||||
type = types.listOf (types.submodule extensionOpts);
|
||||
default = [ ];
|
||||
example = literalExpression ''
|
||||
[
|
||||
{ package = pkgs.gnomeExtensions.dash-to-panel; }
|
||||
{
|
||||
id = "user-theme@gnome-shell-extensions.gcampax.github.com";
|
||||
package = pkgs.gnome.gnome-shell-extensions;
|
||||
}
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
List of GNOME Shell extensions.
|
||||
'';
|
||||
};
|
||||
|
||||
theme = mkOption {
|
||||
type = types.nullOr (types.submodule themeOpts);
|
||||
default = null;
|
||||
example = literalExpression ''
|
||||
{
|
||||
name = "Plata-Noir";
|
||||
package = pkgs.plata-theme;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Theme to use for GNOME Shell.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf (cfg.extensions != [ ]) {
|
||||
dconf.settings."org/gnome/shell" = {
|
||||
disable-user-extensions = false;
|
||||
enabled-extensions = catAttrs "id" cfg.extensions;
|
||||
};
|
||||
|
||||
home.packages = catAttrs "package" cfg.extensions;
|
||||
})
|
||||
|
||||
(mkIf (cfg.theme != null) {
|
||||
dconf.settings."org/gnome/shell/extensions/user-theme".name =
|
||||
cfg.theme.name;
|
||||
|
||||
programs.gnome-shell.extensions = [{
|
||||
id = "user-theme@gnome-shell-extensions.gcampax.github.com";
|
||||
package = pkgs.gnome.gnome-shell-extensions;
|
||||
}];
|
||||
|
||||
home.packages = [ cfg.theme.package ];
|
||||
})
|
||||
]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue