From f510e37ab14611dbe155661548d22e53766ccd70 Mon Sep 17 00:00:00 2001 From: Luna Simons Date: Mon, 6 May 2024 15:23:23 +0200 Subject: [PATCH] feat(modules): home-manager setup --- modules/home/default.nix | 1 + modules/module.nix | 1 + modules/shared/default.nix | 1 + modules/shared/home-manager/default.nix | 33 +++++++++++++++++++ modules/shared/home-manager/users/bddvlpr.nix | 3 ++ 5 files changed, 39 insertions(+) create mode 100644 modules/home/default.nix create mode 100644 modules/shared/home-manager/default.nix create mode 100644 modules/shared/home-manager/users/bddvlpr.nix diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1 @@ +{} diff --git a/modules/module.nix b/modules/module.nix index 0d1c1cd..97085fd 100644 --- a/modules/module.nix +++ b/modules/module.nix @@ -1,5 +1,6 @@ { flake = { + homeManagerModules = import ./home; nixosModules = import ./nixos; sharedModules = import ./shared; }; diff --git a/modules/shared/default.nix b/modules/shared/default.nix index ff7c8d4..396e4a9 100644 --- a/modules/shared/default.nix +++ b/modules/shared/default.nix @@ -1,5 +1,6 @@ { fish = import ./fish; + home-manager = import ./home-manager; nix = import ./nix; users-bddvlpr = import ./users/bddvlpr.nix; } diff --git a/modules/shared/home-manager/default.nix b/modules/shared/home-manager/default.nix new file mode 100644 index 0000000..0387a87 --- /dev/null +++ b/modules/shared/home-manager/default.nix @@ -0,0 +1,33 @@ +{ + inputs, + outputs, + lib, + config, + system, + ... +}: let + inherit (lib) mkIf mkOption types; + + cfg = config.sysc.home-manager; +in { + # TODO: Interchangable with darwinModules. + imports = [inputs.home-manager.nixosModules.home-manager]; + + options.sysc.home-manager = { + enable = mkOption { + type = types.bool; + default = true; + description = "Whether to enable home-manager."; + }; + }; + + config = mkIf cfg.enable { + home-manager = { + users.bddvlpr = import ./users/bddvlpr.nix; + extraSpecialArgs = { + inherit inputs outputs system; + nixosConfig = config; + }; + }; + }; +} diff --git a/modules/shared/home-manager/users/bddvlpr.nix b/modules/shared/home-manager/users/bddvlpr.nix new file mode 100644 index 0000000..13c6855 --- /dev/null +++ b/modules/shared/home-manager/users/bddvlpr.nix @@ -0,0 +1,3 @@ +{ + home.stateVersion = "24.05"; +}