Issue with dirname

I’m running into this error

$ guix home -L ~/dotfiles container ./machine_one.scm
ice-9/eval.scm:223:20: In procedure proc:
error: default-home-bash-service: unbound variable
hint: Did you forget `(use-modules (config home .services shells))' or `#:use-module (config home .services shells)'?

~/dotfiles/config/home/home-config.scm

(define-module (config home home-config)
  #:use-module (gnu home)
  #:use-module (gnu home services)
  #:use-module (gnu packages shells)
  #:use-module (guix gexp)
  #:use-module (config home .services shells))

(home-environment
  (services
  (append (list (service default-home-bash-service))))  
                  %base-home-services)

~/dotfiles/config/home/.services/shells.scm


(define-module (config home .services shell)
  #:use-module (gnu home)
  #:use-module (gnu home services shells)
  #:use-module (gnu services)
  #:use-module (guix gexp)
  #:export (bash-service)

(define my-aliases
  '(("sudo" . "sudo ") ("df" . "df -h")
    ("free" . "free -h")
    ("ls" . "ls -ahl")
    ("more" . "less")
    ("pb" . "pbincli send")
    ("to" . "sponge")
    ("vi" . "nvim")
    ("vim" . "nvim")
    ("vimdiff" . "nvim -d")
    ("youtube-dl" . "yt-dlp")
    (".." . "cd ../")))

(define my-bash-env-vars
  '(("PATH" . "/run/setuid-programs:$HOME/.local/bin:$HOME/.cargo/bin:$PATH")))

(define location-bashrc
  (string-append (dirname (current-filename)) "../.config/bash/bashrc"))
(define location-bash_profile
  (string-append (dirname (current-filename)) "../.config/bash/bash_profile"))

(define my-home-bash-service
  (service home-bash-service-type 
           (home-bash-configuration
            (guix-defaults? #f)
            (bash-profile (list (local-file location-bash_profile)))
            (bashrc (list (local-file location-bashrc)))
            (aliases my-aliases)
            (environment-variables my-bash-env-vars))))

Through trial and error I’ve been able to pinpoint the issue to this line:

(define location-bashrc
  (string-append (dirname (current-filename)) "../.config/bash/bashrc"))

Is there a way to figure this out without trial and error?

Could it be that your module isn’t defined properly? since you seem to be missing the dot in .services in your define-module block. Also kinda unrelated perhaps, but wouldn’t it be cleaner to just reference your local file directly in in your home-bash-configuration, instead of making them separate variables? Just curious is all.

No, it wasn’t missing in my actual code. And I have different bash service configs for different machines.

change %base-services to %base-home-services