diff --git a/modules/home-manager/base.nix b/modules/home-manager/base.nix new file mode 100644 index 0000000..bbd936b --- /dev/null +++ b/modules/home-manager/base.nix @@ -0,0 +1,14 @@ +{ config, ... }: + +{ + flake.modules.homeManager.base = args: { + home = { + homeDirectory = "/home/${config.flake.meta.owner.username}"; + username = config.flake.meta.owner.username; + }; + + programs.home-manager.enable = true; + + systemd.user.startServices = "sd-switch"; + }; +} diff --git a/modules/home-manager/nixos.nix b/modules/home-manager/nixos.nix new file mode 100644 index 0000000..cdbfd45 --- /dev/null +++ b/modules/home-manager/nixos.nix @@ -0,0 +1,28 @@ +{ config, inputs, ... }: + +{ + flake.modules.nixos.pc = { + imports = [ inputs.home-manager.nixosModules.home-manager ]; + + home-manager = { + useGlobalPkgs = true; + extraSpecialArgs.hasGlobalPkgs = true; + + # https://github.com/nix-community/home-manager/issues/6770 + # useUserPackages = true; + + users.${config.flake.meta.owner.username}.imports = [ + ( + { osConfig, ... }: + + { + home.stateVersion = osConfig.system.stateVersion; + } + ) + + config.flake.modules.homeManager.base + # config.flake.modules.homeManager.gui + ]; + }; + }; +}