hmAuto, set username based on filedir

This commit is contained in:
Julia Lange 2024-12-01 00:18:43 -08:00
parent 7cc650aea6
commit 5605c829b6
Signed by: Julia
SSH key fingerprint: SHA256:KI8YxpkPRbnDRkXPgCuQCVz181++Vy7NAvmQj8alOhM
2 changed files with 12 additions and 12 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, usernameAtHostname, ... }:
{
options = {
@ -9,10 +9,19 @@
browser = lib.mkOption { default = ""; };
};
};
config = {
config = let
st = lib.strings;
in {
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
home.stateVersion = "23.05";
home = {
username = builtins.elemAt (st.splitString "@" usernameAtHostname) 0;
homeDirectory = "/home/" + config.home.username;
packages = config.extraPkgs;
};
home.sessionVariables = {
GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle";
@ -36,8 +45,5 @@
download = "${home}/dwn";
};
};
home.homeDirectory = "/home/" + config.home.username;
home.packages = config.extraPkgs;
};
}

View file

@ -1,10 +1,6 @@
{ config, ... }:
{
home.username = "pan";
nixpkgs.config.allowUnfree = true;
home.stateVersion = "23.05";
hypr.enable = true;
hypr.monitor = {
details = [
@ -103,8 +99,6 @@
];
zoxide.enable = true;
gimp.enable = true;
beeper.enable = true;
discord.enable = true;
}