Merge branch 'main' into fix/neovim-cherry-picks

This commit is contained in:
teutat3s 2022-08-13 17:35:16 +02:00
commit e11c91f86e
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
4 changed files with 59 additions and 16 deletions

View file

@ -0,0 +1,23 @@
{ lib, config, pkgs, ... }:
with lib;
let
psCfg = config.pub-solar;
cfg = config.pub-solar.devops;
in
{
options.pub-solar.arduino = {
enable = mkEnableOption "Life with home automation";
};
config = mkIf cfg.enable {
users.users = pkgs.lib.setAttrByPath [ psCfg.user.name ] {
extraGroups = [ "dialout" ];
};
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
home.packages = [
arduino
arduino-cli
];
};
};
}

View file

@ -79,6 +79,8 @@ lua <<EOF
-- vscode HTML lsp needs this https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html
capabilities.textDocument.completion.completionItem.snippetSupport = true
local use_denols_for_typescript = not(os.getenv('NVIM_USE_DENOLS') == nil)
for lsp_key, lsp_settings in pairs({
'bashls', ------------------------------- Bash
'ccls', --------------------------------- C / C++ / Objective-C
@ -131,7 +133,13 @@ lua <<EOF
['terraformls'] = { --------------------- Terraform
['filetypes'] = { 'terraform', 'hcl', 'tf' }
},
'tsserver', ----------------------------- Typescript / JavaScript
-- The TS/JS server is chosen depending on an environment variable,
-- since denols is nicer for Deno based projects
------------------------ Deno TS/JS
------------------------------------ Typescript / JavaScript
(use_denols_for_typescript and 'denols' or 'tsserver'),
'vuels', -------------------------------- Vue
'svelte', ------------------------------- Svelte
['yamlls'] = { -------------------------- YAML
@ -215,21 +223,26 @@ lua <<EOF
},
}
-- Configure diagnostics
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
})
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#denols
vim.g.markdown_fenced_languages = {
"ts=typescript"
}
-- Change diagnostic symbols in the sign column (gutter)
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
-- Configure diagnostics
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = false,
})
-- Change diagnostic symbols in the sign column (gutter)
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
EOF
" have a fixed column for the diagnostics to appear in

View file

@ -9,6 +9,11 @@ in
default = false;
description = "Feature flag for iso builds";
};
options.pub-solar.x-os.disk-encryption-active = mkOption {
type = types.bool;
default = true;
description = "Whether it should be assumed that there is a cryptroot device";
};
config = {
# Enable plymouth for better experience of booting
boot.plymouth.enable = true;
@ -16,7 +21,7 @@ in
# Mount / luks device in initrd
# Allow fstrim to work on it.
# The ! makes this enabled by default
boot.initrd = mkIf (!cfg.iso-options.enable) {
boot.initrd = mkIf (!cfg.iso-options.enable && cfg.disk-encryption-active) {
luks.devices."cryptroot" = {
allowDiscards = true;
};

View file

@ -15,6 +15,8 @@ channels: final: prev: {
deploy-rs
tdesktop
arduino
arduino-cli
;