create shared niri config, refactor generic feature modules
This commit is contained in:
23 files changed
+353
-410
No files matched your search
@@ -1,31 +1,29 @@
|
||||
{ inputs, self, ... }: {
|
||||
imports = [ (inputs.helpers.mkMirroredModulesFlakeModule "graphicsOptions" ({ lib, ... }: {
|
||||
options.features.applications.gui.vscode.enable = lib.mkEnableOption "VS Code";
|
||||
})) ];
|
||||
{ inputs, self, ... }: let
|
||||
optionName = "features.applications.gui.vscode.enable";
|
||||
in {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.flakeModule "graphics" optionName "VS Code") ];
|
||||
|
||||
flake.nixosModules.graphics = { config, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) (inputs.helpers.mkIfElse (config.features.nixos.home-manager.enable) {
|
||||
home-manager.users.${config.info.userName}.features.applications.gui.vscode.enable = lib.mkDefault true;
|
||||
} {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.nixosModule { inherit config optionName; } {
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
});
|
||||
}) ];
|
||||
};
|
||||
|
||||
flake.homeModules.graphics = { config, pkgs, lib, ... }: {
|
||||
config = lib.mkIf (config.features.applications.gui.vscode.enable) {
|
||||
imports = [ (inputs.helpers.mkStandardFeature.homeModule { inherit config optionName; } {
|
||||
home.packages = [ pkgs.vscode ];
|
||||
|
||||
home.activation = {
|
||||
linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/Code/User/settings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/global/vscode/settings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/shared/vscode/settings.json";
|
||||
});
|
||||
|
||||
linkVsCodeConfigKeybindings = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript {
|
||||
target = "${config.xdg.configHome}/Code/User/keybindings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/global/vscode/keybindings.json";
|
||||
source = "${config.info.rootPath}/dotfiles/shared/vscode/keybindings.json";
|
||||
});
|
||||
};
|
||||
};
|
||||
}) ];
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user