Guix home - bash alias declarations order

  • Done
  • quality assurance status badge
Details
4 participants
  • Atte Torri
  • Christian Miller
  • Hilton Chain
  • Jason
Owner
unassigned
Submitted by
Atte Torri
Severity
normal
A
A
Atte Torri wrote on 5 Dec 2023 16:54
(address . bug-guix@gnu.org)
26318035.896827.1701791650006.JavaMail.zimbra@universite-paris-saclay.fr
Hello,

I have an issue with guix home alias declarations. The aliases I declare in my home configuration always end up on top of the .bashrc file, while the documentation for the home-bash-service-type says "The aliases will be defined after the contents of the bashrc field has been put in the .bashrc file.". The following is the bash configuration I use

(service home-bash-service-type
(home-bash-configuration
(bashrc (list (local-file ".bashrc" "bashrc")))
(bash-profile (list (local-file ".bash_profile" "bash_profile")))
(bash-logout (list (local-file ".bash_logout" "bash_logout")))
(aliases '(("egrep" . "egrep --color=auto")
("fgrep" . "fgrep --color=auto")
("grep" . "grep --color=auto")
("l" . "ls -CF")
("la" . "ls -A")
("ll" . "ls -alF")
("ls" . "ls --color=auto")))))


M. TORRI Atte
PhD Student (Computer Science) at Université Paris-Saclay
Doctorant (Informatique) à l'Université Paris-Saclay
Équipe ParSys - Laboratoire Interdisciplinaire des Sciences du Numérique (LISN)
Bureau 105 - Bâtiment 650
atte.torri@universite-paris-saclay.fr | 0169153106
Attachment: file
C
C
Christian Miller wrote on 6 Dec 2023 22:11
(address . 67652@debbugs.gnu.org)
87bkb3ox2a.fsf@dadoes.de
Hi,

I have the same issue since I started using Guix home. Therefore I
did this:

Toggle snippet (10 lines)
(service home-bash-service-type
(home-bash-configuration
(guix-defaults? #f)
;; Needs to be done since aliases are put on top and
;; would be overwritten by `guix-default`.
(bashrc (list (plain-file "default-bashrc" %default-bashrc)))
(aliases '(("ls" . "ls -lah --color")
("grep" . "grep --color")))))

Disabling "guix-defaults" and now you aliases should be at the bottom
and work.
--
Christian Miller
J
[PATCH] * home/services/shells.scm (add-bash-configuration): reorder aliases (Bug#67652)
(address . guix-patches@gnu.org)(name . Jason Darby)(address . jasonkdarby@gmail.com)
7f93dd2f4f61dde7e538891f32ea43fae9948181.1708575015.git.jasonkdarby@gmail.com
From: Jason Darby <jasonkdarby@gmail.com>

Change-Id: I288856bb6befe378ca60ef78578acc069cb18532
---
gnu/home/services/shells.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index db82a7cff3..8fd1668b59 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -429,8 +429,8 @@ (define (add-bash-configuration config)
,@(list (file-if-not-empty
'bashrc
(if (home-bash-configuration-guix-defaults? config)
- (list (serialize-field 'aliases)
- (plain-file-content %default-bashrc))
+ (list (plain-file-content %default-bashrc)
+ (serialize-field 'aliases))
(list (serialize-field 'aliases))))
(file-if-not-empty 'bash-logout)))))

base-commit: 8073a26022111c38808c1a803d59229288db0839
--
2.41.0
H
H
Hilton Chain wrote on 27 Mar 15:50 +0100
(name . Jason)(address . jasonkdarby@gmail.com)
87edbvn2z2.wl-hako@ultrarare.space
Hi everyone,

On Thu, 22 Feb 2024 12:10:15 +0800,
Jason wrote:
Toggle quote (8 lines)
>
> From: Jason Darby <jasonkdarby@gmail.com>
>
> Change-Id: I288856bb6befe378ca60ef78578acc069cb18532
> ---
> gnu/home/services/shells.scm | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

I have applied Jason's patch as 0b38c9401bebb6b87093555ef3768a8e1855c938, thank
you all!
Closed
?