fix: profile-image

This commit is contained in:
Daniel Langbein 2025-01-21 21:10:25 +01:00
parent 478fde84af
commit a0c460ff3a
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -1,6 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
dir = "/var/lib/AccountsService/icons"; iconsDir = "/var/lib/AccountsService/icons";
usersDir = "/var/lib/AccountsService/users";
user = "yoda"; user = "yoda";
in in
{ {
@ -13,17 +14,24 @@ in
# https://github.com/tolgaerok/nixos-kde/blob/3c4b55f2b0345facc5bc5157750dfaecef9d4d6c/user/user-home-settings/create-user-profile-pics.nix # https://github.com/tolgaerok/nixos-kde/blob/3c4b55f2b0345facc5bc5157750dfaecef9d4d6c/user/user-home-settings/create-user-profile-pics.nix
# After changing my profile image in KDE Plasma 6, this file was created: # After changing my profile image in KDE Plasma 6, this file was created:
# /var/lib/AccountsService/users # /var/lib/AccountsService/users/yoda
# With content: # With content:
# [User] # [User]
# Icon=/var/lib/AccountsService/icons/yoda # Icon=/var/lib/AccountsService/icons/yoda
# SystemAccount=false # SystemAccount=false
# Permissions: root:root 0600 # Permissions: root:root 0600
# This file is required, thus we create it manually in this nix config.
# `system.activationScripts`: # `system.activationScripts`:
# - Since these are executed every time you boot the system or run `nixos-rebuild`, its important that they are idempotent and fast. # - Since these are executed every time you boot the system or run `nixos-rebuild`, its important that they are idempotent and fast.
system.activationScripts.setGnomeProfilePicture = '' system.activationScripts.setGnomeProfilePicture = ''
mkdir -p ${dir} mkdir -p ${iconsDir}
cp ${(pkgs.callPackage ./profile-image.nix { })}/img.png ${dir}/${user} cp ${(pkgs.callPackage ./profile-image.nix { })}/img.png ${iconsDir}/${user}
mkdir -p ${usersDir}
rm -f ${usersDir}/${user}
echo "[User]" >> ${usersDir}/${user}
echo "Icon=${iconsDir}/${user}" >> ${usersDir}/${user}
echo "SystemAccount=false" >> ${usersDir}/${user}
''; '';
} }