dotfiles/home/lib.nix

36 lines
866 B
Nix
Raw Normal View History

2023-06-15 01:40:55 +02:00
{
inputs,
pkgs,
username,
isNixOS ? true,
}: rec {
extraSpecialArgs = {
flakePath =
if pkgs.stdenv.isDarwin
then "/Users/${username}/.config/nixpkgs"
else "/home/${username}/.config/nixpkgs";
};
hmStandaloneConfig = let
inherit (pkgs.stdenv) isLinux isDarwin;
in {
2023-06-15 01:40:55 +02:00
home.homeDirectory =
if isLinux
2023-06-15 01:40:55 +02:00
then "/home/${username}"
else if isDarwin
2023-06-15 01:40:55 +02:00
then "/Users/${username}"
else throw "Unsupported system";
home.username = username;
targets.genericLinux.enable = isLinux;
xdg.mime.enable = isLinux;
2023-06-15 01:40:55 +02:00
};
modules = with inputs;
[
nix-index-database.hmModules.nix-index
sops.homeManagerModules.sops
caarlos0-nur.homeManagerModules.default
nekowinston-nur.homeManagerModules.default
2023-06-15 14:30:19 +02:00
./.
2023-06-15 01:40:55 +02:00
]
++ pkgs.lib.optionals (!isNixOS) [hmStandaloneConfig];
}