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
36 lines
1.4 KiB
Nix
36 lines
1.4 KiB
Nix
{ inputs, self, ... }: {
|
|
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
|
options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode";
|
|
|
|
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 = [ pkgs.vscode ];
|
|
|
|
home.activation = {
|
|
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
|
target = ".config/Code/User/settings.json";
|
|
source = "dotfiles/global/vscode/settings.json";
|
|
});
|
|
|
|
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript {
|
|
target = ".config/Code/User/keybindings.json";
|
|
source = "dotfiles/global/vscode/keybindings.json";
|
|
});
|
|
};
|
|
};
|
|
};
|
|
} |