From f1787032594f7ca1a6521f5665a48bb70605d222 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 10 Sep 2026 03:00:17 +0530 Subject: feat(flake): exposing the configuration as a flake module Now this configuration can be used in an external configuration as a flake as now we are exporting modules as a home-manager module. --- flake.nix | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 2316fee..980718d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,8 @@ -# Home Manager configuration for Arpit's NixOS system +# Home Manager configuration for Arpit's NixOS system. +# The module set is also exposed as `homeManagerModules.default` so other +# configurations can import this repo as a flake input. { - description = "Home Manager configuration of arpit."; + description = "Home Manager configuration of arpit, exposing a reusable homeManagerModules.default."; inputs = { # Use nixpkgs from the local registry to save disk space on duplicate derivations nixpkgs.url = "nixpkgs"; @@ -31,6 +33,7 @@ outputs = { + self, nixpkgs, home-manager, base16, @@ -45,8 +48,28 @@ inherit pkgs; lib = pkgs.lib; }; + # The module set, bundled with the prerequisites it relies on: the + # base16 module (provides `config.scheme`) and the nixvim module + # (provides `programs.nixvim`). A default `scheme` is set so it works + # out of the box; consumers can override it with their own path. + homeManagerModule = + { + lib, + ... + }: + { + imports = [ + base16.homeManagerModule + nixvim.homeModules.nixvim + ./modules + ]; + scheme = lib.mkDefault ./assets/onedark-dark.yml; + }; in { + homeManagerModules = { + default = homeManagerModule; + }; apps.${system}.updates = { type = "app"; program = "${updates}/bin/updates"; @@ -107,12 +130,7 @@ inherit pkgs; modules = [ ./users/arpit - ./modules - base16.homeManagerModule - { - scheme = ./assets/onedark-dark.yml; - } - nixvim.homeModules.nixvim + self.homeManagerModules.default ]; }; }; -- cgit v1.2.3