-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
127 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,19 @@ | ||
# --- parts/modules/home-manager/programs/editors/neovim.nix | ||
# | ||
# Author: czichy <[email protected]> | ||
# URL: https://github.com/czichy/tensorfiles.hm | ||
# License: MIT | ||
# | ||
# 888 .d888 d8b 888 | ||
# 888 d88P" Y8P 888 | ||
# 888 888 888 | ||
# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b | ||
# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K | ||
# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. | ||
# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 | ||
# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' | ||
{ localFlake, inputs }: | ||
{ | ||
localFlake, | ||
inputs, | ||
}: { | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
with builtins; | ||
with lib; | ||
let | ||
with lib; let | ||
inherit (localFlake.lib) mkOverrideAtHmModuleLevel mkPywalEnableOption; | ||
|
||
cfg = config.tensorfiles.hm.programs.editors.helix; | ||
_ = mkOverrideAtHmModuleLevel; | ||
in | ||
{ | ||
in { | ||
# TODO modularize config, cant be bothered to do it now | ||
options.tensorfiles.hm.programs.editors.helix = with types; { | ||
enable = mkEnableOption '' | ||
|
@@ -66,15 +52,15 @@ in | |
# ]) | ||
# ]; | ||
#}); | ||
settings.theme = "dracula"; | ||
settings.theme = "onedark"; | ||
settings.editor = import ./editor.nix; | ||
settings.keys = import ./keys.nix; | ||
languages = import ./languages.nix { inherit config lib pkgs; }; | ||
languages = import ./languages.nix {inherit config lib pkgs;}; | ||
#themes = import ./theme.nix {inherit colorscheme;}; | ||
}; | ||
} | ||
# |----------------------------------------------------------------------| # | ||
]); | ||
|
||
meta.maintainers = with localFlake.lib.maintainers; [ czichy ]; | ||
meta.maintainers = with localFlake.lib.maintainers; [czichy]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
localFlake, | ||
inputs, | ||
}: { | ||
config, | ||
lib, | ||
pkgs, | ||
system, | ||
... | ||
}: | ||
with builtins; | ||
with lib; let | ||
inherit | ||
(localFlake.lib) | ||
mkOverrideAtHmModuleLevel | ||
isModuleLoadedAndEnabled | ||
mkPywalEnableOption | ||
mkDummyDerivation | ||
; | ||
|
||
cfg = config.tensorfiles.hm.programs.editors.zed; | ||
_ = mkOverrideAtHmModuleLevel; | ||
|
||
pywalCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.pywal") && cfg.pywal.enable; | ||
in { | ||
# TODO modularize config, cant be bothered to do it now | ||
options.tensorfiles.hm.programs.editors.zed = with types; { | ||
enable = mkEnableOption '' | ||
Enables NixOS module that configures/handles the Zed Editor program. | ||
''; | ||
|
||
pywal = { | ||
enable = mkPywalEnableOption; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable (mkMerge [ | ||
# |----------------------------------------------------------------------| # | ||
{ | ||
home.shellAliases = { | ||
"zed" = _ "zed-editor"; | ||
}; | ||
programs.zed-editor = let | ||
bins = with pkgs; [ | ||
nixd | ||
nixfmt-rfc-style | ||
prettierd | ||
nodejs | ||
nodePackages.prettier | ||
vscode-langservers-extracted | ||
]; | ||
libraries = with pkgs; [ | ||
stdenv.cc.cc | ||
zlib | ||
openssl | ||
]; | ||
in { | ||
enable = true; | ||
extensions = [ | ||
"nix" | ||
"xy-zed" # a gorgeous dark theme | ||
]; | ||
# package = with pkgs; writeShellScriptBin "zed" '' | ||
# export PATH=${lib.makeBinPath bins}:$PATH | ||
# export LD_LIBRARY_PATH=${lib.makeLibraryPath libraries} | ||
# export NIX_LD_LIBRARY_PATH=${lib.makeLibraryPath libraries} | ||
# export NIX_LD=${stdenv.cc.bintools.dynamicLinker} | ||
# exec ${zed-editor}/bin/zed "$@" | ||
# ''; | ||
userSettings = { | ||
features = { | ||
copilot = true; | ||
inline_completion_provider = "copilot"; | ||
}; | ||
assistant = { | ||
version = "2"; | ||
default_model = { | ||
provider = "anthropic"; | ||
model = "claude-3-5-sonnet-latest"; | ||
}; | ||
}; | ||
lsp = { | ||
rust-analyzer = { | ||
binary = {path_lookup = true;}; | ||
}; | ||
}; | ||
telemetry = { | ||
metrics = false; | ||
}; | ||
vim_mode = true; | ||
ui_font_size = 16; | ||
buffer_font_size = 16; | ||
theme = { | ||
mode = "system"; | ||
light = "Andromeda"; | ||
dark = "One Dark"; | ||
}; | ||
ssh_connections = [ | ||
{ | ||
# host = "trex.satanic.link"; | ||
} | ||
]; | ||
}; | ||
userKeymaps = [ | ||
{bindings = {up = "menu::SelectPrev";};} | ||
{ | ||
context = "Editor"; | ||
bindings = {escape = "editor::Cancel";}; | ||
} | ||
]; | ||
}; | ||
} | ||
# |----------------------------------------------------------------------| # | ||
]); | ||
|
||
meta.maintainers = with localFlake.lib.maintainers; [czichy]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters