aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-10 03:00:17 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-10 03:00:17 +0530
commitf1787032594f7ca1a6521f5665a48bb70605d222 (patch)
treecdf25331487f0fab5a02a981282beb8e3fbb581d /flake.nix
parentf4019185a1d940e7c98ba1fadab232736967c9f5 (diff)
downloadhome-manager-config-f1787032594f7ca1a6521f5665a48bb70605d222.tar.gz
home-manager-config-f1787032594f7ca1a6521f5665a48bb70605d222.zip
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.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix34
1 files 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
];
};
};