Compare commits

...

2 Commits

Author SHA1 Message Date
pegasust 37363d4581 add deno 2022-12-03 06:43:44 +00:00
pegasust 660a2f24f3 massive change in nix* directory 2022-12-03 00:01:48 +00:00
49 changed files with 73 additions and 31 deletions

View File

@ -540,7 +540,7 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
local servers = {
'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals',
'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls', "pylsp",
"jsonls",
"jsonls", "denols"
}
require("mason").setup({
ui = {
@ -608,15 +608,25 @@ require('mason-lspconfig').setup_handlers({
require('lspconfig').tsserver.setup {
on_attach = on_attach,
capabilities = capabilities,
-- TODO: Have to figure out an alternative config for monorepo to prevent
-- Deno from injecting TS projects.
-- Monorepo support: spawn one instance of lsp within the git
-- repos.
root_dir = require('lspconfig.util').root_pattern('.git'),
-- root_dir = require('lspconfig.util').root_pattern('.git'),
root_dir = require('lspconfig.util').root_pattern('package.json'),
settings = {
javascript = inlay_hint_tsjs,
typescript = inlay_hint_tsjs,
}
}
end,
["denols"] = function()
require('lspconfig').denols.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = require('lspconfig.util').root_pattern("deno.json", "deno.jsonc"),
}
end,
-- ["rust_analyzer"] = function()
-- require('lspconfig').rust_analyzer.setup {
-- on_attach = on_attach,

View File

@ -4,7 +4,8 @@
, myHome
, ...
}:
let nvim_pkgs = [
let
nvim_pkgs = [
# Yes, I desperately want neovim to work out-of-the-box without flake.nix for now
# I want at least python LSP to work everywhere because it's basically
# an alternative to bash script when I move to OpenColo
@ -25,7 +26,10 @@ let nvim_pkgs = [
# pypkgs.pynvim # nvim provider
# # pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
# ]))
]; in
];
proj_root = builtins.toString ./../..;
in
{
home = {
username = myHome.username;
@ -59,8 +63,8 @@ let nvim_pkgs = [
] ++ (myHome.packages or [ ]) ++ nvim_pkgs);
## Configs ##
xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua;
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
xdg.configFile."nvim/init.lua".text = builtins.readFile "${proj_root}//neovim/init.lua";
xdg.configFile."starship.toml".text = builtins.readFile "${proj_root}//starship/starship.toml";
## Programs ##
programs.jq = {
@ -68,7 +72,7 @@ let nvim_pkgs = [
};
programs.alacritty = myHome.programs.alacritty or {
enable = true;
# settings = myLib.fromYaml (builtins.readFile ../alacritty/alacritty.yml);
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/alacritty/alacritty.yml");
};
# nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc
@ -84,7 +88,7 @@ let nvim_pkgs = [
};
programs.tmux = {
enable = true;
extraConfig = builtins.readFile ../tmux/tmux.conf;
extraConfig = builtins.readFile "${proj_root}/tmux/tmux.conf";
};
programs.exa = {
enable = true;
@ -110,7 +114,7 @@ let nvim_pkgs = [
# I use vim-plug, so I probably don't require packaging
# extraConfig actually writes to init-home-manager.vim (not lua)
# https://github.com/nix-community/home-manager/pull/3287
# extraConfig = builtins.readFile ../neovim/init.lua;
# extraConfig = builtins.readFile "${proj_root}/neovim/init.lua";
};
programs.bash = {
enable = true;
@ -172,6 +176,6 @@ let nvim_pkgs = [
programs.ssh = {
enable = true;
forwardAgent = true;
extraConfig = builtins.readFile ../ssh/config;
extraConfig = builtins.readFile "${proj_root}/ssh/config";
};
}

View File

@ -0,0 +1,5 @@
# This module aims to be merge (not inject/override) with top-level pkgs to provide
# personalized/custom packages
{ pkgs, lib, ... }@pkgs_input: {
dot-hwtr = import "./dot-hwtr" pkgs_input;
}

View File

@ -0,0 +1,4 @@
{ pkgs, lib, ... }@pkgs_input: pkgs.stdenv.mkDerivation {
name = "dot-hwtr";
native
}

View File

@ -12,7 +12,7 @@ fi
SCRIPT_DIR=$(realpath $(dirname $0))
echo "SCRIPT_DIR: ${SCRIPT_DIR}"
SYSNIX_DIR="${SCRIPT_DIR}/../system-nix"
SYSNIX_DIR="${SCRIPT_DIR}/../nix-conf/system"
# Copy hardware-configuration of existing machine onto our version control
SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}"

19
scripts/hm-switch.sh Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env sh
# NOTE: Untested on case of no home-manager
set -xv
# Where this script located
SCRIPT_DIR=$(realpath $(dirname $0))
echo "SCRIPT_DIR: ${SCRIPT_DIR}"
HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
# test if we have home-manager, if not, attempt to use nix to put home-manager to
# our environment
if [ $(home-manager &>/dev/null) ]; then
nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR"
else
home-manager switch --flake "$HOME_MANAGER_DIR"
fi

0
scripts/sys-switch.sh Executable file
View File