From 5605c829b64d036059c9bf083924e86b1c49fa86 Mon Sep 17 00:00:00 2001 From: Julia Lange Date: Sun, 1 Dec 2024 00:18:43 -0800 Subject: [PATCH] hmAuto, set username based on filedir --- hmModules/automatic/default.nix | 18 ++++++++++++------ hosts/jibril/users/pan/user.nix | 6 ------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hmModules/automatic/default.nix b/hmModules/automatic/default.nix index 4c41659..f974b21 100644 --- a/hmModules/automatic/default.nix +++ b/hmModules/automatic/default.nix @@ -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; }; } diff --git a/hosts/jibril/users/pan/user.nix b/hosts/jibril/users/pan/user.nix index f27a420..ea6c1de 100644 --- a/hosts/jibril/users/pan/user.nix +++ b/hosts/jibril/users/pan/user.nix @@ -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; }