all application options will adapt to environment

when used either with nixos (no home-manager) or home-manager standalone, `features.applications.<name>.enable` options still perform some functionality, rather than assuming a full nixos + home-manager setup like before
This commit is contained in:
greyweather committed 2026-08-29 13:48:20 +01:00
1 parent 2ca8b405e8
commit 7f49c289d5
17 files changed
+265 -151

No files matched your search

+10 -9
View File
@@ -2,22 +2,23 @@
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
config = {
environment.systemPackages = [ pkgs.vscode ];
home-manager.sharedModules = lib.mkIf (config.features.applications.gui.vscode.enable) [
{
features.applications.gui.vscode.enable = lib.mkDefault true;
}
config = let
mkIfElse = with lib; p: yes: no: mkMerge [
(mkIf p yes)
(mkIf (!p) no)
];
};
in lib.mkIf (config.features.applications.gui.vscode.enable) (mkIfElse (config.features.nixos.home-manager.enable) {
home-manager.users.grey.features.applications.gui.vscode.enable = lib.mkDefault true;
} {
environment.systemPackages = [ pkgs.vscode ];
});
};
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
home.packages = lib.mkIf (config.info.isStandalone) [ pkgs.vscode ];
home.packages = [ pkgs.vscode ];
home.activation = {
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {