add new external flake to provide helper functions
This commit is contained in:
18 files changed
+73
-163
No files matched your search
@@ -2,12 +2,7 @@
|
||||
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) {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.grey.features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
} {
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
@@ -21,14 +16,14 @@
|
||||
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";
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.home.homeDirectory}/.config/Code/User/settings.json";
|
||||
source = "${config.info.rootPath}/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";
|
||||
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.home.homeDirectory}/.config/Code/User/keybindings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/global/vscode/keybindings.json";
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user