Files
nixos/home/default.nix
T

41 lines
970 B
Nix
Raw Normal View History

2022-11-01 08:35:06 -05:00
{
nixpkgs,
overlays,
home-manager,
username ? builtins.getEnv "USER",
...
}:
2022-08-02 01:50:50 -05:00
let
2022-09-09 11:54:18 -05:00
home = system:
if username == "root" then "/root" else
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "/Users/${username}" else "/home/${username}" );
2022-08-02 01:50:50 -05:00
mkhome = system: gui:
2022-09-09 11:54:18 -05:00
let
homeDirectory = home system;
configDir = "${homeDirectory}/.config";
pkgs = import nixpkgs {
2022-11-01 08:35:06 -05:00
inherit overlays;
2022-09-09 11:54:18 -05:00
config.allowUnfree = true;
config.xdg.configHome = configDir;
};
in home-manager.lib.homeManagerConfiguration rec {
2022-08-02 01:50:50 -05:00
inherit pkgs system username homeDirectory;
stateVersion = "22.05";
configuration = import ./home.nix username {
2022-11-01 08:35:06 -05:00
inherit pkgs gui;
2022-08-02 01:50:50 -05:00
inherit (pkgs) config lib stdenv;
};
};
in {
"aarch64-gui" = mkhome "aarch64-linux" true;
"aarch64-nogui" = mkhome "aarch64-linux" false;
"x86_64-gui" = mkhome "x86_64-linux" true;
"x86_64-nogui" = mkhome "x86_64-linux" false;
2022-09-09 11:54:18 -05:00
"x86_64-darwin" = mkhome "x86_64-darwin" true;
2022-08-02 01:50:50 -05:00
}