From 8a7fcff10d8f76f74da530928a7985a28cda7c60 Mon Sep 17 00:00:00 2001 From: Lyes Saadi Date: Mon, 4 Aug 2025 18:02:25 +0100 Subject: [PATCH] Nixifying helix config --- flake.lock | 18 +++---- users/lyes/home/default.nix | 1 + users/lyes/home/editors/default.nix | 1 + users/lyes/home/editors/helix.nix | 73 +++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 users/lyes/home/editors/helix.nix diff --git a/flake.lock b/flake.lock index 563a7b1..7db607a 100644 --- a/flake.lock +++ b/flake.lock @@ -93,11 +93,11 @@ ] }, "locked": { - "lastModified": 1754225444, - "narHash": "sha256-mv01SQtqlhBMavc1dgNjgqJw4WfZxy+w3xBgwJU3YmU=", + "lastModified": 1754263839, + "narHash": "sha256-ck7lILfCNuunsLvExPI4Pw9OOCJksxXwozum24W8b+8=", "owner": "nix-community", "repo": "home-manager", - "rev": "0de18bd5c6681280d7ae017fa34ffd91bdcf0557", + "rev": "1d7abbd5454db97e0af51416f4960b3fb64a4773", "type": "github" }, "original": { @@ -162,11 +162,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753939845, - "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "94def634a20494ee057c76998843c015909d6311", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", "type": "github" }, "original": { @@ -194,11 +194,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1753939845, - "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "94def634a20494ee057c76998843c015909d6311", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", "type": "github" }, "original": { diff --git a/users/lyes/home/default.nix b/users/lyes/home/default.nix index b47433d..ad8e228 100644 --- a/users/lyes/home/default.nix +++ b/users/lyes/home/default.nix @@ -8,6 +8,7 @@ home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true; + home-manager.backupFileExtension = "backup"; home-manager.users.lyes = { ... }: { imports = [ diff --git a/users/lyes/home/editors/default.nix b/users/lyes/home/editors/default.nix index d57b69e..2c54d45 100644 --- a/users/lyes/home/editors/default.nix +++ b/users/lyes/home/editors/default.nix @@ -4,5 +4,6 @@ imports = [ ./emacs.nix + ./helix.nix ]; } diff --git a/users/lyes/home/editors/helix.nix b/users/lyes/home/editors/helix.nix new file mode 100644 index 0000000..25e7d0e --- /dev/null +++ b/users/lyes/home/editors/helix.nix @@ -0,0 +1,73 @@ +{ ... }: + +{ + programs.helix = { + enable = true; + defaultEditor = true; + + settings = { + theme = "gruvbox_dark_hard"; + + editor = { + rulers = [ 80 ]; + + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + }; + }; + + languages = { + language = [ + { + name = "rpm-spec"; + scope = "source.bash"; + file-types = [ "spec" ]; + comment-token = "#"; + indent = { tab-width = 4; unit = " "; }; + grammar = "bash"; + injection-regex = "%changelog"; + roots = []; + } + + # { + # name = "bash"; + # file-types = [ + # "sh" "bash" "zsh" + # ".bash_login" ".bash_logout" ".bash_profile" + # ".bashrc" ".profile" ".zshenv" "zshenv" ".zlogin" + # "zlogin" ".zlogout" "zlogout" ".zprofile" "zprofile" + # ".zshrc" "zshrc" ".zimrc" + # "APKBUILD" "PKGBUILD" "eclass" "ebuild" "bazelrc" + # ".bash_aliases" "Renviron" ".Renviron" + # "spec" + # ]; + # indent = { tab-width = 4; unit = " "; }; + # } + + { + name = "c"; + indent = { tab-width = 4; unit = " "; }; + } + + { + name = "latex"; + soft-wrap.enable = true; + indent = { tab-width = 4; unit = " "; }; + } + + { + name = "lalrpop"; + scope = "source.rs"; + file-types = [ "lalrpop" ]; + comment-token = "//"; + indent = { tab-width = 4; unit = " "; }; + grammar = "rust"; + roots = []; + } + ]; + }; + }; +}