From 0e320591edbe04e90907cefe27e8f370285cca8e Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Thu, 7 Mar 2024 14:43:53 -0500 Subject: [PATCH] templating --- nix/home-manager/modules/files.nix | 36 +++++++++++++++++-- nix/home-manager/modules/packages/default.nix | 1 + nix/home-manager/modules/packages/zsh.nix | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/nix/home-manager/modules/files.nix b/nix/home-manager/modules/files.nix index 874ae75..5db30bd 100644 --- a/nix/home-manager/modules/files.nix +++ b/nix/home-manager/modules/files.nix @@ -4,7 +4,17 @@ config, ... }: let + inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; repo_root = "../../.."; + nv_fonts_basic = ["Iosevka Custom"]; + nv_fonts_normal = + nv_fonts_basic + ++ ( + if isLinux + then ["Noto Color Emoji"] + else ["Apple Color Emoji"] + ); + nv_fonts_italic = ["Dank Mono"] ++ nv_fonts_basic; in { home.file = { "/.zsh.d/" = { @@ -15,9 +25,22 @@ in { recursive = true; }; "bin/git-sync".source = ./${repo_root}/git-sync; - ".cargo/config.toml".source = pkgs.substituteAll { - src = ./${repo_root}/cargo/config.toml.nixtemplate; - profileDir = config.home.profileDirectory; + ".cargo/config.toml".source = (pkgs.formats.toml {}).generate "cargo-config" { + net = { + git-fetch-with-cli = true; + }; + "profile.release" = { + lto = true; + opt-level = 3; + }; + # Could avoid setting this at all with another `isLinux` but whatever, doesn't truly matter + "target.x86_64-unknown-linux-gnu" = { + linker = "clang"; + rustflags = ["-C" "link-arg=-fuse-ld=${config.home.profileDirectory}/bin/mold"]; + }; + "registries.crates-io" = { + protocol = "sparse"; + }; }; ".ideavimrc".source = ./${repo_root}/ideavim/ideavimrc; }; @@ -37,6 +60,13 @@ in { "erdtree/.erdtreerc".source = ./${repo_root}/erdtree/erdtreerc; "kitty/kitty.conf".source = ./${repo_root}/kitty/kitty.conf; "lsd/config.yaml".source = ./${repo_root}/lsd/config.yaml; + "neovide/config.toml".source = (pkgs.formats.toml {}).generate "neovide-config" { + font = { + normal = nv_fonts_normal; + italic = nv_fonts_italic; + size = 14; + }; + }; "ov/config.yaml".source = ./${repo_root}/ov/ov-less.yaml; }; } diff --git a/nix/home-manager/modules/packages/default.nix b/nix/home-manager/modules/packages/default.nix index 7771121..ca7b4b1 100644 --- a/nix/home-manager/modules/packages/default.nix +++ b/nix/home-manager/modules/packages/default.nix @@ -51,6 +51,7 @@ in { litecli magic-wormhole-rs ncdu + neovide ov pandoc parallel diff --git a/nix/home-manager/modules/packages/zsh.nix b/nix/home-manager/modules/packages/zsh.nix index 405fa88..3869acd 100644 --- a/nix/home-manager/modules/packages/zsh.nix +++ b/nix/home-manager/modules/packages/zsh.nix @@ -88,6 +88,8 @@ in { } else { exa = "eza -l --git"; + ls = "exa"; + nv = "neovide"; }; }; }