Compare commits

..

No commits in common. "5d2f71e9345500acac270bc376edc30623cc9a63" and "ca2ecf33001d0d02d6076936f8d7815d0c71b703" have entirely different histories.

49 changed files with 32 additions and 79 deletions

View File

@ -4,32 +4,28 @@
, myHome
, ...
}:
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
pkgs.gccStdenv
pkgs.gcc
pkgs.tree-sitter
pkgs.ripgrep
pkgs.fzf
# pkgs.sumneko-lua-language-server
pkgs.ripgrep
pkgs.zk
pkgs.fd
pkgs.stdenv.cc.cc.lib
# Python3 as alternative to bash scripts :^)
# (pkgs.python310Full.withPackages (pypkgs: [
# # python-lsp-server's dependencies is absolutely astronomous
# # pypkgs.python-lsp-server # python-lsp. Now we'll have to tell mason to look for this
# pypkgs.pynvim # nvim provider
# # pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
# ]))
];
proj_root = builtins.toString ./../..;
in
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
pkgs.gccStdenv
pkgs.gcc
pkgs.tree-sitter
pkgs.ripgrep
pkgs.fzf
# pkgs.sumneko-lua-language-server
pkgs.ripgrep
pkgs.zk
pkgs.fd
pkgs.stdenv.cc.cc.lib
# Python3 as alternative to bash scripts :^)
# (pkgs.python310Full.withPackages (pypkgs: [
# # python-lsp-server's dependencies is absolutely astronomous
# # pypkgs.python-lsp-server # python-lsp. Now we'll have to tell mason to look for this
# pypkgs.pynvim # nvim provider
# # pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
# ]))
]; in
{
home = {
username = myHome.username;
@ -63,8 +59,8 @@ in
] ++ (myHome.packages or [ ]) ++ nvim_pkgs);
## Configs ##
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";
xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua;
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
## Programs ##
programs.jq = {
@ -72,7 +68,7 @@ in
};
programs.alacritty = myHome.programs.alacritty or {
enable = true;
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/alacritty/alacritty.yml");
# settings = myLib.fromYaml (builtins.readFile ../alacritty/alacritty.yml);
};
# nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc
@ -88,7 +84,7 @@ in
};
programs.tmux = {
enable = true;
extraConfig = builtins.readFile "${proj_root}/tmux/tmux.conf";
extraConfig = builtins.readFile ../tmux/tmux.conf;
};
programs.exa = {
enable = true;
@ -114,7 +110,7 @@ in
# 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 "${proj_root}/neovim/init.lua";
# extraConfig = builtins.readFile ../neovim/init.lua;
};
programs.bash = {
enable = true;
@ -176,6 +172,6 @@ in
programs.ssh = {
enable = true;
forwardAgent = true;
extraConfig = builtins.readFile "${proj_root}/ssh/config";
extraConfig = builtins.readFile ../ssh/config;
};
}

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", "denols"
"jsonls",
}
require("mason").setup({
ui = {
@ -550,12 +550,7 @@ require("mason").setup({
package_uninstalled = ""
},
check_outdated_packages_on_open = true,
},
-- The default settings is "prepend" https://github.com/williamboman/mason.nvim#default-configuration
-- Which means Mason's installed path is prioritized against our local install
-- see: https://git.pegasust.com/pegasust/aoc/commit/b45dc32c74d84c9f787ebce7a174c9aa1d411fc2
-- This introduces some pitfalls, so we'll take the approach of trusting user's local installation
PATH = "append";
}
})
require('mason-lspconfig').setup({
ensure_installed = servers,
@ -613,25 +608,15 @@ 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('package.json'),
root_dir = require('lspconfig.util').root_pattern('.git'),
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

@ -1,5 +0,0 @@
# 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

@ -1,4 +0,0 @@
{ 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}/../nix-conf/system"
SYSNIX_DIR="${SCRIPT_DIR}/../system-nix"
# Copy hardware-configuration of existing machine onto our version control
SYSNIX_PROF="${SYSNIX_DIR}/profiles/${HOSTNAME}"

View File

@ -1,19 +0,0 @@
#!/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

View File