Hello!
I have home-manager installed as standalone on two users (user0, user1).
user0 has a flake.nix file that sets up the home-manager config for user0:
/home/user0/.dotfiles/flake.nix
{
description = "home flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {self, nixpkgs, nixpkgs-unstable, home-manager, ...}@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in {
homeConfigurations.user0 = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-unstable;
};
modules = [
./home.nix
];
};
};
}
and in home.nix i have:
{ config, pkgs, pkgs-unstable, ... }:
{
imports = [
.hypr/hypr.nix
];
...
I want to also import this module hypr.nix inside user1’s flake.nix.
How to share this module between users? Or maybe how to setup home-manager differently such that it is possible to share a module, but it still allows each user to set their own module options and add their own modules.
Obviously i want to avoid just copy-pasting the hypr.nix module to user1, because i will have to copy it every time and there might be more modules i would want to share.
Thanks in advance!