From 09f0ab478d74328e9649ad09ee5ebeb107c92589 Mon Sep 17 00:00:00 2001 From: Ivan Kirilov Dimitrov Date: Fri, 2 Aug 2024 20:04:50 +0200 Subject: [PATCH] use home-manager as nixos module --- nixos/configs/default.nix | 2 +- nixos/modules/default.nix | 63 ++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/nixos/configs/default.nix b/nixos/configs/default.nix index b271e6a..eaffff2 100644 --- a/nixos/configs/default.nix +++ b/nixos/configs/default.nix @@ -24,7 +24,7 @@ let 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 { specialArgs = { inherit inputs inputs' pkgs; diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index e064c93..3da7af7 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -118,33 +118,48 @@ top@{ moduleWithSystem, ... }: { }; }; }; - ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: { - fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ]; - users = { - users = { - ivand = { - isNormalUser = true; - createHome = true; - extraGroups = [ - "adbusers" - "adm" - "audio" - "bluetooth" - "dialout" - "flatpak" - "kvm" - "mlocate" - "realtime" - "render" - "video" - "wheel" + ivand = moduleWithSystem (toplevel@{ ... }: perSystem@{ pkgs, ... }: + let homeMods = top.config.flake.homeManagerModules; in { + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + users.ivand = { ... }: { + imports = with homeMods; [ + base + ivand + shell + util + swayland + web ]; }; }; - extraGroups = { mlocate = { }; }; - }; - programs.dconf.enable = true; - }); + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts noto-fonts-emoji noto-fonts-lgc-plus ]; + users = { + 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 = { xdg = { portal = { enable = true; wlr.enable = true; config.common.default = "*"; }; }; services.flatpak.enable = true;