2022-11-01 08:35:06 -05:00
|
|
|
{
|
|
|
|
|
nixpkgs,
|
|
|
|
|
overlays,
|
|
|
|
|
home-manager,
|
2023-03-06 23:31:58 -06:00
|
|
|
flake-utils,
|
2022-11-01 08:35:06 -05:00
|
|
|
...
|
|
|
|
|
}:
|
2022-08-02 01:50:50 -05:00
|
|
|
|
|
|
|
|
let
|
2023-03-06 23:31:58 -06:00
|
|
|
# I'm "greg" everywhere except Darwin where I'm "gregory.hellings"
|
|
|
|
|
user = system:
|
|
|
|
|
( if ( nixpkgs.lib.hasSuffix "-darwin" system ) then "gregory.hellings" else "greg" );
|
|
|
|
|
home = system: username:
|
2022-09-09 11:54:18 -05:00
|
|
|
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
|
|
|
|
2022-12-24 00:36:36 -06:00
|
|
|
mkhome = {
|
|
|
|
|
system,
|
|
|
|
|
gui,
|
2023-03-06 23:31:58 -06:00
|
|
|
gnome,
|
|
|
|
|
username
|
2022-12-24 00:36:36 -06:00
|
|
|
}:
|
2022-09-09 11:54:18 -05:00
|
|
|
let
|
2023-03-06 23:31:58 -06:00
|
|
|
homeDirectory = home system username;
|
2022-09-09 11:54:18 -05:00
|
|
|
|
|
|
|
|
configDir = "${homeDirectory}/.config";
|
|
|
|
|
|
|
|
|
|
pkgs = import nixpkgs {
|
2023-03-06 23:31:58 -06:00
|
|
|
inherit overlays system;
|
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";
|
2022-12-24 00:36:36 -06:00
|
|
|
configuration = import ./home.nix {
|
|
|
|
|
inherit pkgs gui gnome;
|
2022-08-02 01:50:50 -05:00
|
|
|
inherit (pkgs) config lib stdenv;
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-12-24 00:36:36 -06:00
|
|
|
|
2023-03-06 23:31:58 -06:00
|
|
|
in flake-utils.lib.eachDefaultSystem (system: {
|
|
|
|
|
gui = mkhome {
|
|
|
|
|
inherit system;
|
|
|
|
|
gui = true;
|
|
|
|
|
gnome = false;
|
|
|
|
|
username = user system;
|
|
|
|
|
};
|
|
|
|
|
gdm = mkhome {
|
|
|
|
|
inherit system;
|
2022-12-24 00:36:36 -06:00
|
|
|
gui = true;
|
|
|
|
|
gnome = true;
|
2023-03-06 23:31:58 -06:00
|
|
|
username = user system;
|
2022-12-24 00:36:36 -06:00
|
|
|
};
|
2023-03-06 23:31:58 -06:00
|
|
|
cli = mkhome {
|
|
|
|
|
inherit system;
|
2022-12-24 00:36:36 -06:00
|
|
|
gui = false;
|
|
|
|
|
gnome = false;
|
2023-03-06 23:31:58 -06:00
|
|
|
username = user system;
|
2022-12-24 00:36:36 -06:00
|
|
|
};
|
2023-03-06 23:31:58 -06:00
|
|
|
})
|