init
This commit is contained in:
commit
aae151cee6
33 changed files with 1351 additions and 0 deletions
4
modules/home-manager/default.nix
Executable file
4
modules/home-manager/default.nix
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
editors = import ./editors;
|
||||
shells = import ./shells;
|
||||
}
|
||||
29
modules/home-manager/editors/default.nix
Executable file
29
modules/home-manager/editors/default.nix
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.editors;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./helix.nix
|
||||
];
|
||||
|
||||
options.custom.editors = {
|
||||
defaultEditor = lib.mkOption {
|
||||
type = lib.types.enum [ "helix" ];
|
||||
default = null;
|
||||
description = "Which editor to use as the default one. If set to null the default editor won't be set explicitly.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.defaultEditor != null) {
|
||||
assertions = [
|
||||
{ assertion = (config.custom.editors.${cfg.defaultEditor}.enable);
|
||||
message = "Can't set an editor as the default if it is disabled.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
97
modules/home-manager/editors/helix.nix
Executable file
97
modules/home-manager/editors/helix.nix
Executable file
|
|
@ -0,0 +1,97 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.editors.helix;
|
||||
in
|
||||
{
|
||||
options.custom.editors.helix = {
|
||||
enable = lib.mkEnableOption "Whether to enable the Helix editor.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
defaultEditor = (config.custom.editors.defaultEditor == "helix");
|
||||
|
||||
settings = {
|
||||
theme = "term16_dark";
|
||||
|
||||
editor = {
|
||||
line-number = "relative";
|
||||
};
|
||||
};
|
||||
|
||||
languages = {
|
||||
language-server = {
|
||||
nixd = {
|
||||
command = "nixd";
|
||||
args = [ "--semantic-tokens=true" ];
|
||||
config.nixd = let
|
||||
host = "evergarden";
|
||||
flake = "(builtins.getFlake (toString ${inputs.self.outPath}))";
|
||||
nixosOptions = "${flake}.nixosConfigurations.${host}.options";
|
||||
homeManagerOptions = "${nixosOptions}.home-manager.users.type.getSubOptions []";
|
||||
in {
|
||||
nixpkgs.expr = "import ${flake}.inputs.nixpkgs { }";
|
||||
options = {
|
||||
nixos.expr = nixosOptions;
|
||||
home-manager.expr = homeManagerOptions;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rust = {
|
||||
command = "rust-analyzer";
|
||||
};
|
||||
|
||||
qml = {
|
||||
command = "qmlls";
|
||||
args = [ ];
|
||||
};
|
||||
|
||||
dockerfile = {
|
||||
command = "docker-language-server";
|
||||
};
|
||||
};
|
||||
|
||||
language = [
|
||||
{
|
||||
name = "css";
|
||||
auto-format = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
nixd
|
||||
|
||||
kdePackages.qtdeclarative
|
||||
|
||||
just-lsp
|
||||
yaml-language-server
|
||||
tombi
|
||||
docker-compose-language-service
|
||||
docker-language-server
|
||||
|
||||
rust-analyzer
|
||||
clang-tools
|
||||
ruff
|
||||
|
||||
intelephense
|
||||
vscode-langservers-extracted
|
||||
typescript-language-server
|
||||
|
||||
kotlin-language-server
|
||||
jdt-language-server
|
||||
|
||||
marksman
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
10
modules/home-manager/shells/default.nix
Executable file
10
modules/home-manager/shells/default.nix
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
{ ...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./direnv.nix
|
||||
./fish.nix
|
||||
./zellij.nix
|
||||
];
|
||||
}
|
||||
24
modules/home-manager/shells/direnv.nix
Executable file
24
modules/home-manager/shells/direnv.nix
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.shells.direnv;
|
||||
in
|
||||
{
|
||||
options.custom.shells.direnv = {
|
||||
enable = lib.mkEnableOption "Whether to enable the direnv shell environment tool.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
|
||||
enableBashIntegration = config.programs.bash.enable;
|
||||
enableFishIntegration = config.programs.fish.enable;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
93
modules/home-manager/shells/fish.nix
Executable file
93
modules/home-manager/shells/fish.nix
Executable file
|
|
@ -0,0 +1,93 @@
|
|||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.shells.fish;
|
||||
in
|
||||
{
|
||||
options.custom.shells.fish = {
|
||||
enable = lib.mkEnableOption "Whether to enable the Fish shell";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs = {
|
||||
fish = {
|
||||
enable = true;
|
||||
|
||||
# Disable annoying welcome message.
|
||||
shellInit = ''
|
||||
set fish_greeting
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
e = "$EDITOR";
|
||||
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
"...." = "cd ../../..";
|
||||
"....." = "cd ../../../..";
|
||||
"......" = "cd ../../../../..";
|
||||
|
||||
tree = "${pkgs.eza}/bin/eza --color=always --tree";
|
||||
ls = "${pkgs.eza}/bin/eza --color=always --group-directories-first --icons";
|
||||
ll = "${pkgs.eza}/bin/eza -la --icons --octal-permissions --group-directories-first";
|
||||
l = "${pkgs.eza}/bin/eza --long --all --group --group-directories-first --icons";
|
||||
lx = "${pkgs.eza}/bin/eza -lbhHigUmuSa@ --time-style=long-iso --git --color-scale --color=always --group-directories-first --icons";
|
||||
|
||||
cat = "${pkgs.bat}/bin/bat -Pp";
|
||||
};
|
||||
};
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
character = {
|
||||
success_symbol = "[[](mauve) ❯](maroon)";
|
||||
error_symbol = "[❯](red)";
|
||||
vimcmd_symbol = "[❮](green)";
|
||||
};
|
||||
|
||||
directory = {
|
||||
truncation_length = 4;
|
||||
style = "bold pink";
|
||||
};
|
||||
|
||||
palette = "catppuccin_mocha";
|
||||
|
||||
palettes.catppuccin_mocha = {
|
||||
rosewater = "#f5e0dc";
|
||||
flamingo = "#f2cdcd";
|
||||
pink = "#f5c2e7";
|
||||
mauve = "#cba6f7";
|
||||
red = "#f38ba8";
|
||||
maroon = "#eba0ac";
|
||||
peach = "#fab387";
|
||||
yellow = "#f9e2af";
|
||||
green = "#a6e3a1";
|
||||
teal = "#94e2d5";
|
||||
sky = "#89dceb";
|
||||
sapphire = "#74c7ec";
|
||||
blue = "#89b4fa";
|
||||
lavender = "#b4befe";
|
||||
text = "#cdd6f4";
|
||||
subtext1 = "#bac2de";
|
||||
subtext0 = "#a6adc8";
|
||||
overlay2 = "#9399b2";
|
||||
overlay1 = "#7f849c";
|
||||
overlay0 = "#6c7086";
|
||||
surface2 = "#585b70";
|
||||
surface1 = "#45475a";
|
||||
surface0 = "#313244";
|
||||
base = "#1e1e2e";
|
||||
mantle = "#181825";
|
||||
crust = "#11111b";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/home-manager/shells/zellij.nix
Executable file
21
modules/home-manager/shells/zellij.nix
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.custom.shells.zellij;
|
||||
in
|
||||
{
|
||||
options.custom.shells.zellij = {
|
||||
enable = lib.mkEnableOption "Enable the Zellij multiplexer.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue