srid / nixos-config

KISS NixOS configuration based on Flakes & flake-parts (supports macOS too)
433 stars 17 forks source link

Question regarding home-manager. #13

Closed blmhemu closed 2 years ago

blmhemu commented 2 years ago

In the main flake.nix, is it possible to extract the below snippet into another file and use the file here ?

home-manager.nixosModules.home-manager
{
    home-manager.useGlobalPkgs = true;
    home-manager.useUserPackages = true;
    home-manager.users.srid = import ./home.nix
      {
        inherit inputs system pkgs;
      };
}
srid commented 2 years ago

Similar to ./home.nix?

blmhemu commented 2 years ago

Something like this ?

{ config, lib, nixpkgs, home-manager, ... }:
{
    imports = [ home-manager.darwinModule ];
    home-manager = {
        useGlobalPkgs = true;
        useUserPackages = true;
    };
}
srid commented 2 years ago

Something like:

{ pkgs, lib, system, inputs, ... }:
{
        inputs.home-manager.nixosModules.home-manager
        {
          home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true;
          home-manager.users.srid = import ./home.nix
            {
              inherit inputs system pkgs;
            };
        }
}
srid commented 2 years ago

@blmhemu If you have any more questions, I suggest posting to https://discourse.nixos.org/