Regenerated
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
{ config, pkgs, lib, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.users.users.defaultUser or "henrov";
|
||||
homeDir = "/home/${username}";
|
||||
assetPath = "${flakeRoot}/assets/copy_2_home";
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [ pkgs.rsync ];
|
||||
|
||||
systemd.services.copyAssets = {
|
||||
description = "Copy assets to ${username}'s home directory";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
# oneshot service runs once at boot
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
# Always use /bin/sh -c for multi-line commands
|
||||
serviceConfig.ExecStart = ''
|
||||
/bin/sh -c '
|
||||
echo "Copying assets from ${assetPath} to ${homeDir} ..."
|
||||
|
||||
if [ ! -d "${assetPath}" ]; then
|
||||
echo "ERROR: ${assetPath} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${homeDir}"
|
||||
chown ${username}:${username} "${homeDir}"
|
||||
|
||||
${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${homeDir}/"
|
||||
|
||||
# Fix .config permissions
|
||||
mkdir -p "${homeDir}/.config"
|
||||
chown -R ${username}:${username} "${homeDir}/.config"
|
||||
chmod u+rwx "${homeDir}/.config"
|
||||
|
||||
echo "Done copying assets."
|
||||
'
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
username = "henrov";
|
||||
in
|
||||
{
|
||||
#################################
|
||||
# Ensure system user has a valid shell
|
||||
#################################
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
hashedPassword = "$6$S7iShgBxB.77CwmP$i0njK.2r3OL5UEvgZbmwZ0rnpZ4QyJcv8p9uCmJ4AiVPSMXkQkIwMLzyAOnJ0q8.tPLIp/7EquEIZeK8qbmgw/"; # keep your existing hash
|
||||
shell = pkgs.bash; # ensures login shell exists in this generation
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
];
|
||||
};
|
||||
|
||||
#################################
|
||||
# NixOS system user
|
||||
#################################
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
hashedPassword = "$6$S7iShgBxB.77CwmP$i0njK.2r3OL5UEvgZbmwZ0rnpZ4QyJcv8p9uCmJ4AiVPSMXkQkIwMLzyAOnJ0q8.tPLIp/7EquEIZeK8qbmgw/";
|
||||
shell = pkgs.bash;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
|
||||
#################################
|
||||
# Home Manager user definition
|
||||
#################################
|
||||
_module.args.hmUsers = {
|
||||
${username} = {
|
||||
# Minimal required
|
||||
home.username = username;
|
||||
home.homeDirectory = "/home/${username}";
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
# Add user-specific packages here
|
||||
home.packages = [
|
||||
];
|
||||
|
||||
# Add user dotfiles, session variables, etc. here if needed
|
||||
home.file = {
|
||||
# Example:
|
||||
# ".bashrc" = { source = /path/to/bashrc; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user