mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
nixos/cosmic: add warning when a core package is excluded
Also add an option to toggle the visibility of warning to not cause alarm fatigue.
This commit is contained in:
parent
b3fab2e4b1
commit
0aae134f2f
1 changed files with 22 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
let
|
||||
cfg = config.services.desktopManager.cosmic;
|
||||
excludedCorePkgs = lib.lists.intersectLists corePkgs config.environment.cosmic.excludePackages;
|
||||
# **ONLY ADD PACKAGES WITHOUT WHICH COSMIC CRASHES, NOTHING ELSE**
|
||||
corePkgs =
|
||||
with pkgs;
|
||||
|
@ -47,6 +48,10 @@ in
|
|||
services.desktopManager.cosmic = {
|
||||
enable = lib.mkEnableOption "Enable the COSMIC desktop environment";
|
||||
|
||||
showExcludedPkgsWarning = lib.mkEnableOption "Disable the warning for excluding core packages." // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
xwayland.enable = lib.mkEnableOption "Xwayland support for the COSMIC compositor" // {
|
||||
default = true;
|
||||
};
|
||||
|
@ -152,5 +157,22 @@ in
|
|||
services.power-profiles-daemon.enable = lib.mkDefault (
|
||||
!config.hardware.system76.power-daemon.enable
|
||||
);
|
||||
|
||||
warnings = lib.optionals (cfg.showExcludedPkgsWarning && excludedCorePkgs != [ ]) [
|
||||
''
|
||||
The `environment.cosmic.excludePackages` option was used to exclude some
|
||||
packages from the environment which also includes some packages that the
|
||||
maintainers of the COSMIC DE deem necessary for the COSMIC DE to start
|
||||
and initialize. Excluding said packages creates a high probability that
|
||||
the COSMIC DE will fail to initialize properly, or completely. This is an
|
||||
unsupported use case. If this was not intentional, please assign an empty
|
||||
list to the `environment.cosmic.excludePackages` option. If you want to
|
||||
exclude non-essential packages, please look at the NixOS module for the
|
||||
COSMIC DE and look for the essential packages in the `corePkgs` list.
|
||||
|
||||
You can stop this warning from appearing by setting the option
|
||||
`services.desktopManager.cosmic.showExcludedPkgsWarning` to `false`.
|
||||
''
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue