From d4453d1a593669ee78989c3fb5d9ed1976279fa9 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 19 May 2025 14:51:05 +0800 Subject: [PATCH] feat(modules/home/cli): add nvf --- flake.lock | 178 ++++++++++++++++++++++++++- flake.nix | 3 + homes/x86_64-linux/rafiq/cli.nix | 1 - homes/x86_64-linux/rafiq/default.nix | 2 +- modules/home/cli/default.nix | 1 + modules/home/cli/editor/nvf.nix | 18 +++ 6 files changed, 197 insertions(+), 6 deletions(-) create mode 100644 modules/home/cli/editor/nvf.nix diff --git a/flake.lock b/flake.lock index 1196979..9f010b0 100644 --- a/flake.lock +++ b/flake.lock @@ -36,16 +36,34 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -56,7 +74,7 @@ }, "flake-utils-plus": { "inputs": { - "flake-utils": "flake-utils" + "flake-utils": "flake-utils_2" }, "locked": { "lastModified": 1715533576, @@ -73,6 +91,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -108,6 +144,47 @@ "type": "github" } }, + "mnw": { + "locked": { + "lastModified": 1747499976, + "narHash": "sha256-YTiSI4WLbk0CleXeBheYmKZV6iqKyBpyoh1e+vcQzu4=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "72433a144c4ac16931e9148f78db4a0e4c147441", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "nil": { + "inputs": { + "flake-utils": [ + "nvf", + "flake-utils" + ], + "nixpkgs": [ + "nvf", + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1741118843, + "narHash": "sha256-ggXU3RHv6NgWw+vc+HO4/9n0GPufhTIUjVuLci8Za8c=", + "owner": "oxalica", + "repo": "nil", + "rev": "577d160da311cc7f5042038456a0713e9863d09e", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -144,6 +221,46 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-parts": "flake-parts", + "flake-utils": "flake-utils", + "mnw": "mnw", + "nil": "nil", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1747525582, + "narHash": "sha256-oEZ6DV4bPcNZIuwW5Kcd+/zT3PMkXse2kX/3jHoomGk=", + "owner": "notashelf", + "repo": "nvf", + "rev": "d3a0e7029ac57eef1120225973247851c5b967b5", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", @@ -151,10 +268,33 @@ "impermanence": "impermanence", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", + "nvf": "nvf", "snowfall-lib": "snowfall-lib", "sops-nix": "sops-nix" } }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nvf", + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741055476, + "narHash": "sha256-52vwEV0oS2lCnx3c/alOFGglujZTLmObit7K8VblnS8=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "aefb7017d710f150970299685e8d8b549d653649", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "snowfall-lib": { "inputs": { "flake-compat": "flake-compat", @@ -211,6 +351,36 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 74e0d56..117c306 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,8 @@ nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.url = "github:Mic92/sops-nix"; sops-nix.inputs.nixpkgs.follows = "nixpkgs"; + nvf.url = "github:notashelf/nvf"; + nvf.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs: @@ -27,6 +29,7 @@ homes.modules = with inputs; [ impermanence.homeManagerModules.impermanence nix-index-database.hmModules.nix-index +nvf.homeManagerModules.default ]; }; } diff --git a/homes/x86_64-linux/rafiq/cli.nix b/homes/x86_64-linux/rafiq/cli.nix index 65a098a..9b89514 100644 --- a/homes/x86_64-linux/rafiq/cli.nix +++ b/homes/x86_64-linux/rafiq/cli.nix @@ -19,7 +19,6 @@ programs.nix-index-database.comma.enable = true; home.packages = with pkgs; [ - neovim ripgrep fzf pantheon.rebuild diff --git a/homes/x86_64-linux/rafiq/default.nix b/homes/x86_64-linux/rafiq/default.nix index 8965b90..e529ac1 100644 --- a/homes/x86_64-linux/rafiq/default.nix +++ b/homes/x86_64-linux/rafiq/default.nix @@ -6,7 +6,7 @@ ./desktop.nix ]; - cli.editor = "nvim"; + cli.editor = "nvf"; cli.file-browser = "yazi"; home.persistence."/persist/home/rafiq" = { diff --git a/modules/home/cli/default.nix b/modules/home/cli/default.nix index f7dbe9f..0ef6e07 100644 --- a/modules/home/cli/default.nix +++ b/modules/home/cli/default.nix @@ -2,6 +2,7 @@ { imports = [ ./file-browser/yazi.nix + ./editor/nvf.nix ]; options.cli = { diff --git a/modules/home/cli/editor/nvf.nix b/modules/home/cli/editor/nvf.nix new file mode 100644 index 0000000..3790b8f --- /dev/null +++ b/modules/home/cli/editor/nvf.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: +{ + config = lib.mkIf (config.cli.editor == "nvf") { + programs.nvf = { + enable = true; + settings.vim = { + utility.yazi-nvim = { + enable = true; + mappings = { + openYazi = "t"; + openYaziDir = "T"; + }; + setupOpts.open_for_directories = true; + }; + }; + }; + }; +}