make sure desktops apps only install on desktops

This commit is contained in:
Sean Buckley 2024-10-18 00:10:30 -04:00
parent c2fa267fac
commit 63aefa9edf
2 changed files with 42 additions and 38 deletions

View file

@ -1,7 +1,7 @@
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
config = (pkgs.formats.toml { }).generate "alacritty.toml"
aconfig = (pkgs.formats.toml { }).generate "alacritty.toml"
{
env.TERM = "xterm-256color";
font.size = 12;
@ -32,9 +32,11 @@ let
in
{
environment.etc."xdg/alacritty.toml".source = config;
environment.systemPackages = [
(lib.hiPrio notify-fix)
pkgs.alacritty
];
config = lib.mkIf (config.sconfig.desktop.enable) {
environment.etc."xdg/alacritty.toml".source = aconfig;
environment.systemPackages = [
(lib.hiPrio notify-fix)
pkgs.alacritty
];
};
}

View file

@ -1,35 +1,37 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
(vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions; [
esbenp.prettier-vscode
jnoortheen.nix-ide
ms-azuretools.vscode-docker
ms-python.python
redhat.vscode-yaml
shardulm94.trailing-spaces
];
})
];
config = lib.mkIf (config.sconfig.desktop.enable) {
environment.systemPackages = with pkgs; [
(vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions; [
esbenp.prettier-vscode
jnoortheen.nix-ide
ms-azuretools.vscode-docker
ms-python.python
redhat.vscode-yaml
shardulm94.trailing-spaces
];
})
];
environment.etc."bck-settings.sh".text = ''
mkdir -p ~/.config/Code/User
ln -sf /etc/vscode-settings.json ~/.config/Code/User/settings.json
ln -sf /etc/vscode-keybindings.json ~/.config/Code/User/keybindings.json
'';
environment.etc."bck-settings.sh".text = ''
mkdir -p ~/.config/Code/User
ln -sf /etc/vscode-settings.json ~/.config/Code/User/settings.json
ln -sf /etc/vscode-keybindings.json ~/.config/Code/User/keybindings.json
'';
environment.etc."vscode-keybindings.json".source = ./vscode-keybindings.json;
environment.etc."vscode-settings.json".text = builtins.toJSON (
(
builtins.fromJSON (builtins.readFile ./vscode-settings.json)
) // {
# NixOS-specific vscode settings:
"extensions.autoCheckUpdates" = false;
"extensions.autoUpdate" = false;
"terminal.external.linuxExec" = "x-terminal-emulator";
"terminal.integrated.fontFamily" = "DejaVuSansM Nerd Font";
"update.mode" = "none";
}
);
environment.etc."vscode-keybindings.json".source = ./vscode-keybindings.json;
environment.etc."vscode-settings.json".text = builtins.toJSON (
(
builtins.fromJSON (builtins.readFile ./vscode-settings.json)
) // {
# NixOS-specific vscode settings:
"extensions.autoCheckUpdates" = false;
"extensions.autoUpdate" = false;
"terminal.external.linuxExec" = "x-terminal-emulator";
"terminal.integrated.fontFamily" = "DejaVuSansM Nerd Font";
"update.mode" = "none";
}
);
};
}