use home-manager as nixos module

This commit is contained in:
Ivan Kirilov Dimitrov 2024-08-02 20:04:50 +02:00
parent 1b2bbc3a31
commit 09f0ab478d
No known key found for this signature in database
GPG Key ID: 0BDAD4B211C49294
2 changed files with 40 additions and 25 deletions

View File

@ -24,7 +24,7 @@ let
hardware.cpu.intel.updateMicrocode = lib.mkForce false; hardware.cpu.intel.updateMicrocode = lib.mkForce false;
}; };
}; };
essential = [ hardwareConfigurations.nova inputs.hosts.nixosModule ] ++ (with mods; [ grub base sound wayland security ivand wireless wireguard ]); essential = [ hardwareConfigurations.nova inputs.hosts.nixosModule inputs.home-manager.nixosModules.default ] ++ (with mods; [ grub base sound wayland security ivand wireless wireguard ]);
systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem { systemWithModules = modules: withSystem system (ctx@{ config, inputs', pkgs, ... }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs inputs' pkgs; inherit inputs inputs' pkgs;

View File

@ -118,33 +118,48 @@ top@{ moduleWithSystem, ... }: {
}; };
}; };
}; };
ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }:
fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ]; let homeMods = top.config.flake.homeManagerModules; in {
users = { home-manager = {
users = { useUserPackages = true;
ivand = { useGlobalPkgs = true;
isNormalUser = true; users.ivand = { ... }: {
createHome = true; imports = with homeMods; [
extraGroups = [ base
"adbusers" ivand
"adm" shell
"audio" util
"bluetooth" swayland
"dialout" web
"flatpak"
"kvm"
"mlocate"
"realtime"
"render"
"video"
"wheel"
]; ];
}; };
}; };
extraGroups = { mlocate = { }; }; fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ];
}; users = {
programs.dconf.enable = true; users = {
}); ivand = {
isNormalUser = true;
createHome = true;
extraGroups = [
"adbusers"
"adm"
"audio"
"bluetooth"
"dialout"
"flatpak"
"kvm"
"mlocate"
"realtime"
"render"
"video"
"wheel"
];
};
};
extraGroups = { mlocate = { }; };
};
programs.dconf.enable = true;
});
flatpak = { flatpak = {
xdg = { portal = { enable = true; wlr.enable = true; config.common.default = "*"; }; }; xdg = { portal = { enable = true; wlr.enable = true; config.common.default = "*"; }; };
services.flatpak.enable = true; services.flatpak.enable = true;