# How do I organize my home bash service the modular way?

**URL:** https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095
**Category:** Guix
**Created:** [August 11, 2026, 1:20pm UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095 "2026-08-11T13:20:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Folaht](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/folaht/32/1145_2.png) [@Folaht](https://forum.systemcrafters.net/u/Folaht)
#### Post date: [August 11, 2026, 1:20pm UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095/1 "2026-08-11T13:20:17Z")

</div>

I’m trying to follow [this guide](https://systemcrafters.net/craft-your-system-with-guix/how-to-organize-your-config/) with the services that I use and `bash-home-service-type` is one I use.

This is the error I’m getting when I try:

```shell
$ guix repl -L ~/dotfiles/
...
scheme@(guix-user)> ,use(config home home-config)
;;; note: source file /home/folaht/dotfiles/config/home/home-config.scm
;;; newer than compiled /home/folaht/.cache/guile/ccache/3.0-LE-8-4.7/home/folaht/dotfiles/config/home/home-config.scm.go
While executing meta-command:
Wrong type to apply: #<service-type home-bash 7f8458337440>

```

_~/dotfiles/config/home/home-config.scm_

```scheme
(define-module (config home home-config)
  #:use-module (gnu)
  #:use-module (gnu home)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages version-control)
  #:use-module (config home services shells))

(home-environment
  (packages (list git))
  (services
   (list (service my-home-bash-service-type))))

```

_~/dotfiles/config/home/services/shells.scm_

```auto
(define-module (config home services shells)
  #:use-module (gnu home)
  #:use-module (gnu home services)
  #:use-module (gnu home services shells)
  #:export (my-home-bash-service-type))

(define my-home-bash-service-type 
  (home-bash-service-type
    (home-bash-configuration
      (guix-defaults? #f))))

```

[edit]

I’ve tried an alternative:

```shell
scheme@(guix-user)> ,use(config home home-config)
Wrong type to apply: #<<service> type: #<service-type home-bash 7f14d5bb44c0> 
value: #<<home-bash-configuration> 
package: #<package bash@5.2.37 gnu/packages/bash.scm:162 7f14d583c160> 
guix-defaults?: #f environment-variables: () variables: () 
aliases: (("ls" . "ls -p --color=auto") ("ll" . "ls -l") ("grep" . "grep --color=auto") ("ip" . "ip -color=auto")) 
bash-profile: () bashrc: () bash-logout: () %location: #<<location> 
file: "/home/folaht/dotfiles/config/home/services/shells.scm" line: 10 column: 10>>>

```

_~/dotfiles/config/home/home-config.scm_

```scheme
...
(home-environment
  (packages (list git))
  (services
   (append (list (my-home-bash-service)) %base-home-services)))

```

_~/dotfiles/config/home/services/shells.scm_

```scheme
...
(define my-home-bash-service
  (service home-bash-service-type 
	(home-bash-configuration 
      (guix-defaults? #f))))

```

---

<div class="post-metadata">

### Author: ![juipeltje](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juipeltje/32/1178_2.png) [@juipeltje](https://forum.systemcrafters.net/u/juipeltje)
#### Post date: [August 11, 2026, 2:41pm UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095/2 "2026-08-11T14:41:14Z")

</div>

I think it would work if you just use

```auto
(home-environment
  (services
   (list my-home-bash-service-type)))

```

I think `service` is used only to call service definitions that you’ve created or are in Guix already, whereas here you’re just calling your own variable that contains `home-bash-service-type` configuration. Feel free for anyone to correct me if i got something wrong here cause i’m not too knowledgeable on the inner workings.

---

<div class="post-metadata">

### Author: ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)
#### Post date: [August 12, 2026, 1:02am UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095/3 "2026-08-12T01:02:02Z")

</div>

It works like this:

```auto
(home-environment
 (packages (specifications->packages (list "...package-name...")))
 (services
  (append (list (service home-bash-service-type
                         (home-bash-configuration
                          (aliases
                           '(("grep" . "grep --color=auto")
                             ("ip" . "ip -color=auto")
                             ("ls" . "ls -p --color=auto")
                             ("ll" . "ls -l")
                             ("la" . "ls -la")))
                          ;; Bash configuration
                          (bashrc (list (local-file "dot-bashrc.sh" "bashrc")))
                          (bash-profile (list (local-file "dot-bash_profile.sh" "bash_profile"))))))
                %base-home-services)))

```

---

<div class="post-metadata">

### Author: ![Folaht](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/folaht/32/1145_2.png) [@Folaht](https://forum.systemcrafters.net/u/Folaht)
#### Post date: [August 12, 2026, 8:42am UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095/4 "2026-08-12T08:42:29Z")

</div>

That’s the non-modular way.

How do I write it modular, where `home-bash-service-type` is a variable in a module?

---

<div class="post-metadata">

### Author: ![Folaht](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/folaht/32/1145_2.png) [@Folaht](https://forum.systemcrafters.net/u/Folaht)
#### Post date: [August 12, 2026, 11:19am UTC](https://forum.systemcrafters.net/t/how-do-i-organize-my-home-bash-service-the-modular-way/2095/5 "2026-08-12T11:19:54Z")

</div>

Got it!

`list (my-home-bash-service)` should be `list my-home-bash-service` in the home-config.scm file, since I no longer am calling a function there.
