fix home-manager modules

This commit is contained in:
Joshua Yuen 2026-01-21 15:02:07 -05:00
parent c889e17f6a
commit 34eab2b47f
Signed by: josh
GPG Key ID: 502720BC22ED411C
17 changed files with 57 additions and 61 deletions

View File

@ -33,7 +33,7 @@
let let
system = "x86_64-linux"; system = "x86_64-linux";
host = "vm"; host = "vm";
profile = "vm"; profile = "desktop";
username = "josh"; username = "josh";
in in
{ {
@ -43,7 +43,6 @@
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
inherit host; inherit host;
inherit profile;
inherit username; inherit username;
}; };
modules = [ modules = [
@ -56,7 +55,6 @@
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
inherit host; inherit host;
inherit profile;
inherit username; inherit username;
}; };
modules = [ modules = [
@ -65,19 +63,6 @@
./hosts/${host} ./hosts/${host}
]; ];
}; };
nixosvm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
};
}; };
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
@ -87,7 +72,8 @@
}; };
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
modules = [ modules = [
./modules/home ./profiles/${profile}
./homes/${username}
stylix.homeModules.stylix stylix.homeModules.stylix
]; ];
}; };

23
homes/josh/home.nix Normal file
View File

@ -0,0 +1,23 @@
{
...
}:
{
imports = [
../../modules/homes
../../modules/options
];
modules.zsh.enable = true;
modules.shell.defaultShell = "zsh";
home = {
username = "josh";
homeDirectory = "/home/josh";
stateVersion = "25.11";
};
# Let Home Manager install and manage itself
programs.home-manager.enable = true;
nix.settings.allowed-users = [ "josh" ];
}

View File

@ -1,10 +1,10 @@
{ {
profile,
... ...
}: }:
{ {
imports = [ imports = [
../../profiles/${profile} ../../profiles/desktop
../../profiles/vm
../../modules/core ../../modules/core
../../modules/options ../../modules/options

View File

@ -1,10 +1,8 @@
{ {
inputs, inputs,
lib,
pkgs, pkgs,
... ...
}: }:
with lib;
{ {
imports = [ inputs.stylix.nixosModules.stylix ]; imports = [ inputs.stylix.nixosModules.stylix ];

View File

@ -26,12 +26,7 @@ in
; ;
}; };
users.${username} = { users.${username} = {
imports = [ ./../home ]; imports = [ ../../homes/${username}/home.nix ];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "25.05";
};
}; };
}; };
@ -57,6 +52,4 @@ in
environment.pathsToLink = environment.pathsToLink =
[ ] [ ]
++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]); ++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]);
nix.settings.allowed-users = [ "${username}" ];
} }

View File

@ -5,7 +5,6 @@
imports = [ imports = [
./direnv.nix ./direnv.nix
./fzf.nix ./fzf.nix
./home.nix
./hyprland ./hyprland
./kitty.nix ./kitty.nix
./overlays.nix ./overlays.nix

View File

@ -1,11 +0,0 @@
{
username,
...
}:
{
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "25.11";
};
}

View File

@ -1,9 +1,9 @@
{ {
osConfig, config,
... ...
}: }:
let let
cfg = osConfig.modules.hyprland; cfg = config.modules.hyprland;
in in
{ {
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {

View File

@ -1,12 +1,12 @@
{ {
config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
let let
cfg = osConfig.modules.hyprland; cfg = config.modules.hyprland;
in in
{ {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {

View File

@ -1,13 +1,13 @@
{ {
config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
let let
hyprlandCfg = osConfig.modules.hyprland; hyprlandCfg = config.modules.hyprland;
zshCfg = osConfig.modules.zsh; zshCfg = config.modules.zsh;
in in
{ {
config = mkIf (hyprlandCfg.terminal == "kitty") { config = mkIf (hyprlandCfg.terminal == "kitty") {

View File

@ -1,19 +1,21 @@
{ {
osConfig, config,
lib,
pkgs, pkgs,
... ...
}: }:
with lib;
let let
hyprlandCfg = osConfig.modules.hyprland; hyprlandCfg = config.modules.hyprland;
pipewireCfg = osConfig.modules.pipewire; pipewireCfg = config.modules.pipewire;
plasmaCfg = osConfig.modules.plasma; plasmaCfg = config.modules.plasma;
in in
{ {
xdg = { xdg = {
enable = true; enable = true;
mime.enable = true; mime.enable = true;
mimeApps.enable = true; mimeApps.enable = true;
portal = { portal = mkIf (hyprlandCfg.enable or plasmaCfg.enable) {
enable = true; enable = true;
extraPortals = extraPortals =
[ ] [ ]

View File

@ -1,12 +1,11 @@
{ {
config, config,
lib, lib,
osConfig,
... ...
}: }:
with lib; with lib;
let let
cfg = osConfig.modules.zsh; cfg = config.modules.zsh;
xdgCfg = config.xdg; xdgCfg = config.xdg;
in in
{ {

View File

@ -1,13 +1,12 @@
{ {
config, config,
lib, lib,
osConfig,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
let let
cfg = osConfig.modules.zsh; cfg = config.modules.zsh;
xdgCfg = config.xdg; xdgCfg = config.xdg;
in in
{ {

View File

@ -1,12 +1,11 @@
{ {
config, config,
lib, lib,
osConfig,
... ...
}: }:
with lib; with lib;
let let
cfg = osConfig.modules.zsh; cfg = config.modules.zsh;
xdgCfg = config.xdg; xdgCfg = config.xdg;
in in
{ {

View File

@ -0,0 +1,10 @@
{
...
}:
{
imports = [ ../../modules/options ];
modules.hyprland = {
enable = true;
};
}

View File

@ -1,5 +1,4 @@
{ {
vm,
... ...
}: }:
{ {

View File

@ -4,7 +4,7 @@ echo "Removing old qcow2 disk ..."
rm -f ./vm.qcow2 rm -f ./vm.qcow2
echo "Building new VM ..." echo "Building new VM ..."
nix build .#nixosConfigurations.nixosvm.config.system.build.vm nix build .#nixosConfigurations.nixos.config.system.build.vm
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to build VM" echo "Failed to build VM"