Complete unstable configuration with home manager

This commit is contained in:
Filippo Berto 2022-04-15 17:16:06 +02:00
parent bbee9d7993
commit df1d6df54e
17 changed files with 412 additions and 312 deletions

View file

@ -1,4 +1,3 @@
{ pkgs, ...}:
{
programs.java.enable = pkgs.devEnvironment.enableJava ? false;
{ programs.java.enable = true;
}

View file

@ -18,33 +18,33 @@ let
# editorconfig-core-c
python3.pkgs.editorconfig
] ++ (
lib.optionals (pkgs.devEnvironment.enableCpp) [
[
clang-tools
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableData) [
[
yaml-language-server
nodePackages.vscode-langservers-extracted
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableHtml) [
[
nodePackages.vscode-langservers-extracted
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableJavascript) [
[
flow
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableLatex) [
[
texlab
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableNix) [
[
rnix-lsp
]
) ++ (
with python3.pkgs;
lib.optionals (pkgs.devEnvironment.enablePython) [
[
black
# pyls-black
pyls-flake8
@ -53,7 +53,7 @@ let
python-lsp-server
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableRust) [
[
cargo
cargo-watch
clippy
@ -62,11 +62,11 @@ let
rustfmt
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableShell) [
[
nodePackages.bash-language-server
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableSpelling) [
[
aspell
aspellDicts.en
aspellDicts.en-computers
@ -74,26 +74,15 @@ let
aspellDicts.it
]
);
plugins = with pkgs;
[
kakounePlugins.prelude-kak
kakounePlugins.kak-lsp
kakounePlugins.auto-pairs-kak
kakounePlugins.powerline-kak
kakounePlugins.connect-kak
];
in
{
home.sessionVariables = {
EDITOR = "kak";
VISUAL = "kak";
};
programs.bash.shellAliases = {
k = "kak";
};
programs.zsh.shellAliases = {
k = "kak";
};
programs.bash.shellAliases = { k = "kak"; };
programs.zsh.shellAliases = { k = "kak"; };
home.packages = packages;
programs.kakoune = {
enable = true;
@ -254,7 +243,7 @@ in
commands = builtins.concatStringsSep "\n" [ "powerline-enable" ];
}
] ++ (
lib.optionals (pkgs.devEnvironment.enableLatex) [
[
{
name = "BufSetOption";
option = "filetype=latex";
@ -262,7 +251,7 @@ in
}
]
) ++ (
lib.optionals (pkgs.devEnvironment.enablePython) [
[
{
name = "BufSetOption";
option = "filetype=python";
@ -270,7 +259,7 @@ in
}
]
) ++ (
lib.optionals (pkgs.devEnvironment.enableData) [
[
{
name = "BufSetOption";
option = "filetype=(markdown|html|json|yaml|css|scss|less)";
@ -301,173 +290,164 @@ in
"require-module connect-lf"
"require-module connect-rofi"
];
plugins = plugins;
plugins = with pkgs.kakounePlugins; [
prelude-kak
kak-lsp
auto-pairs-kak
powerline-kak
connect-kak
];
};
xdg.configFile."kak/colors/nord.kak".text = with strPalette;
''
set-face global value rgb:${normal.magenta},default
set-face global type rgb:${bright.white},default
set-face global identifier rgb:${normal.cyan},default
set-face global string rgb:${normal.green},default
set-face global error rgb:${normal.red},default
set-face global keyword rgb:${normal.blue},default
set-face global operator rgb:${normal.blue},default
set-face global attribute rgb:${bright.blue},default
set-face global comment rgb:${bright.blue},default
set-face global meta rgb:${normal.yellow},default
set-face global Default rgb:${normal.white},default
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
set-face global MenuBackground default,rgb:${normal.black}
set-face global MenuInfo default,rgb:${normal.black}
set-face global Information rgb:${dark.black},rgb:${normal.cyan}
set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
set-face global BufferPadding default,default
'';
xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs;
builtins.concatStringsSep "\n" (
[
''
snippet_support = false
verbosity = 2
[server]
timeout = 1800 # seconds = 30 minutes
''
]
++ (
lib.optional (pkgs.devEnvironment.enableCpp) ''
[language.c_cpp]
filetypes = ["c", "cpp"]
roots = ["compile_commands.json", ".clangd"]
command = "${clang-tools}/bin/clangd"
offset_encoding = "utf-8"
''
) ++ (
lib.optional (pkgs.devEnvironment.enableData) ''
[language.json]
filetypes = ["json"]
roots = ["package.json"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server"
args = ["--stdio"]
[language.yaml]
filetypes = ["yaml"]
roots = [".git"]
command = "${yaml-language-server}/bin/yaml-language-server"
args = ["--stdio"]
[language.yaml.settings]
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
yaml.format.enable = true
''
) ++ (
lib.optional (pkgs.devEnvironment.enableGo) ''
[language.go]
filetypes = ["go"]
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
command = "gopls"
offset_encoding = "utf-8"
settings_section = "gopls"
[language.go.settings.gopls]
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
# "build.buildFlags" = []
''
)
++ (
lib.optional (pkgs.devEnvironment.enableHtml) ''
[language.html]
filetypes = ["html"]
roots = ["package.json"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server"
args = ["--stdio"]
[language.css]
filetypes = ["css"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
[language.less]
filetypes = ["less"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
[language.scss]
filetypes = ["scss"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
''
) ++ (
lib.optional (pkgs.devEnvironment.enableJavascript) ''
[language.javascript]
filetypes = ["javascript"]
roots = [".flowconfig"]
command = "${flow}/bin/flow"
args = ["lsp"]
''
) ++ (
lib.optional (pkgs.devEnvironment.enableLatex) ''
[language.latex]
filetypes = ["latex"]
roots = [".git"]
command = "${texlab}/bin/texlab"
settings_section = "texlab"
[language.latex.settings.texlab]
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
# bibtexFormatter = "${texlab}/bin/texlab"
''
) ++ (
lib.optional (pkgs.devEnvironment.enableNix) ''
[language.nix]
filetypes = ["nix"]
roots = ["flake.nix", "shell.nix", ".git"]
command = "${rnix-lsp}/bin/rnix-lsp"
''
) ++ (
lib.optional (pkgs.devEnvironment.enablePython) ''
[language.python]
filetypes = ["python"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
command = "${python3.pkgs.python-lsp-server}/bin/pylsp"
offset_encoding = "utf-8"
[language.python.settings]
# See https://github.com/palantir/python-language-server#configuration
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
# "pyls.configurationSources" = ["flake8"]
''
) ++ (
lib.optional (pkgs.devEnvironment.enableRust) ''
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "${rust-analyzer}/bin/rust-analyzer"
settings_section = "rust-analyzer"
[language.rust.settings.rust-analyzer]
hoverActions.enable = false # kak-lsp doesn't support this at the moment
# cargo.features = []
# See https://rust-analyzer.github.io/manual.html#configuration
# If you get 'unresolved proc macro' warnings, you have two options
# 1. The safe choice is two disable the warning:
diagnostics.disabled = ["unresolved-proc-macro"]
# 2. Or you can opt-in for proc macro support
procMacro.enable = true
cargo.loadOutDirsFromCheck = true
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
''
) ++ (
lib.optional (pkgs.devEnvironment.enableShell) ''
[language.bash]
filetypes = ["sh"]
roots = [".git", ".hg"]
command = "${nodePackages.bash-language-server}/bin/bash-language-server"
args = ["start"]
''
)
);
xdg.configFile."kak/colors/nord.kak".text = with strPalette; ''
set-face global value rgb:${normal.magenta},default
set-face global type rgb:${bright.white},default
set-face global identifier rgb:${normal.cyan},default
set-face global string rgb:${normal.green},default
set-face global error rgb:${normal.red},default
set-face global keyword rgb:${normal.blue},default
set-face global operator rgb:${normal.blue},default
set-face global attribute rgb:${bright.blue},default
set-face global comment rgb:${bright.blue},default
set-face global meta rgb:${normal.yellow},default
set-face global Default rgb:${normal.white},default
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
set-face global MenuBackground default,rgb:${normal.black}
set-face global MenuInfo default,rgb:${normal.black}
set-face global Information rgb:${dark.black},rgb:${normal.cyan}
set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
set-face global BufferPadding default,default
'';
xdg.configFile."kak-lsp/kak-lsp.toml".text = with pkgs; builtins.concatStringsSep "\n"
[
''
snippet_support = false
verbosity = 2
[server]
timeout = 1800 # seconds = 30 minutes
''
''
[language.c_cpp]
filetypes = ["c", "cpp"]
roots = ["compile_commands.json", ".clangd"]
command = "${clang-tools}/bin/clangd"
offset_encoding = "utf-8"
''
''
[language.json]
filetypes = ["json"]
roots = ["package.json"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-json-language-server"
args = ["--stdio"]
[language.yaml]
filetypes = ["yaml"]
roots = [".git"]
command = "${yaml-language-server}/bin/yaml-language-server"
args = ["--stdio"]
[language.yaml.settings]
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
yaml.format.enable = true
''
''
[language.go]
filetypes = ["go"]
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
command = "gopls"
offset_encoding = "utf-8"
settings_section = "gopls"
[language.go.settings.gopls]
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
# "build.buildFlags" = []
''
''
[language.html]
filetypes = ["html"]
roots = ["package.json"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-html-language-server"
args = ["--stdio"]
[language.css]
filetypes = ["css"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
[language.less]
filetypes = ["less"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
[language.scss]
filetypes = ["scss"]
roots = ["package.json", ".git"]
command = "${nodePackages.vscode-langservers-extracted}/bin/vscode-css-language-server"
args = ["--stdio"]
''
''
[language.javascript]
filetypes = ["javascript"]
roots = [".flowconfig"]
command = "${flow}/bin/flow"
args = ["lsp"]
''
''
[language.latex]
filetypes = ["latex"]
roots = [".git"]
command = "${texlab}/bin/texlab"
settings_section = "texlab"
[language.latex.settings.texlab]
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
# bibtexFormatter = "${texlab}/bin/texlab"
''
''
[language.nix]
filetypes = ["nix"]
roots = ["flake.nix", "shell.nix", ".git"]
command = "${rnix-lsp}/bin/rnix-lsp"
''
''
[language.python]
filetypes = ["python"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
command = "${python3.pkgs.python-lsp-server}/bin/pylsp"
offset_encoding = "utf-8"
[language.python.settings]
# See https://github.com/palantir/python-language-server#configuration
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
# "pyls.configurationSources" = ["flake8"]
''
''
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "${rust-analyzer}/bin/rust-analyzer"
settings_section = "rust-analyzer"
[language.rust.settings.rust-analyzer]
hoverActions.enable = false # kak-lsp doesn't support this at the moment
# cargo.features = []
# See https://rust-analyzer.github.io/manual.html#configuration
# If you get 'unresolved proc macro' warnings, you have two options
# 1. The safe choice is two disable the warning:
diagnostics.disabled = ["unresolved-proc-macro"]
# 2. Or you can opt-in for proc macro support
procMacro.enable = true
cargo.loadOutDirsFromCheck = true
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
''
''
[language.bash]
filetypes = ["sh"]
roots = [".git", ".hg"]
command = "${nodePackages.bash-language-server}/bin/bash-language-server"
args = ["start"]
''
];
}

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ...}:
{
home.packages = lib.optionals pkgs.devEnvironment.enableLatex [
home.packages = [
pkgs.texlive.combined.scheme-full
];
}

View file

@ -1,6 +1,6 @@
{
programs.man = {
enable = true;
generateCaches = true;
# generateCaches = true;
};
}

View file

@ -1,12 +1,11 @@
{pkgs, lib,...}:
with pkgs;
{
home.packages = (lib.optionals pkgs.devEnvironment.enableOffice [
home.packages = [
# libreoffice-fresh
onlyoffice-bin
]) ++ (lib.optionals pkgs.devEnvironment.enableSpelling [
hunspellDicts.en_GB-large
hunspellDicts.en_US-large
hunspellDicts.it_IT
]);
];
}

View file

@ -15,6 +15,7 @@ in
rnnoise
ardour
# zrythm
mixxx
# Plugins
# artyFX

View file

@ -2,8 +2,7 @@
{
home.packages = with pkgs; [
jetbrains.pycharm-professional
python3
pypy3
# pypy3
];
}

View file

@ -3,16 +3,16 @@
let
cmd = link: "${pkgs.google-chrome}/bin/google-chrome-stable --app=${link}";
links = [
{ desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; icon = builtins.fetchurl "https://mail.protonmail.com/assets/coast-228x228.png"; }
{ desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Twitch"; link = "https://www.twitch.tv"; icon = builtins.fetchurl "https://static.twitchcdn.net/assets/favicon-32-e29e246c157142c94346.png"; categories = [ "AudioVideo" ]; }
{ desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; icon = builtins.fetchurl "https://assets.nflxext.com/us/ffe/siteui/common/icons/nficon2016.png"; }
{ desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; icon = builtins.fetchurl "https://m.media-amazon.com/images/G/01/digital/video/DVUI/favicons/apple-touch-icon-152x152._CB527404565_.png"; }
{ desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; icon = builtins.fetchurl "https://ssl.gstatic.com/keep/keep_2020q4v2.ico"; }
{ desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Calendar" "Office" ]; icon = builtins.fetchurl "https://calendar.google.com/googlecalendar/images/favicons_2020q4/calendar_31_256.ico"; }
{ desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; icon = builtins.fetchurl "https://www.notion.so/images/logo-ios.png"; }
{ desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Calendar" "Office" ]; }
{ desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; }
{ desktopName = "Monkeytype"; link = "https://monkeytype.com/"; }
{ desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; }
{ desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; }
{ desktopName = "Twitch"; link = "https://www.twitch.tv"; categories = [ "AudioVideo" ]; }
{ desktopName = "WhatsApp"; link = "https://web.whatsapp.com/"; }
{ desktopName = "Monkeytype"; link = "https://monkeytype.com/"; icon = builtins.fetchurl "https://monkeytype.com/images/favicon/apple-touch-icon.png"; }
{ desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; }
];
webAppBuilder =
{ desktopName