mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: bash: Define the SYS_BASHRC macro.
This causes Bash to treat /etc/bashrc as a startup file, removing the need to source /etc/bashrc from ~/.bashrc. * gnu/packages/bash.scm (bash-fixed): New package, with added SYS_BASHRC define. (bash) [replacement]: Use it. * gnu/system/shadow.scm (%default-bashrc): Do not source /etc/bashrc, now done implicitly. Change-Id: I5b0afd7d81653ef19c482e5501efdf7e50ef37c0
This commit is contained in:
parent
279adf431b
commit
2345e87c35
2 changed files with 20 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
||||||
;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
|
;;; Copyright © 2024 Oleg Pykhalov <go.wigust@gmail.com>
|
||||||
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
|
;;; Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
|
||||||
;;; Copyright © 2024 chris <chris@bumblehead.com>
|
;;; Copyright © 2024 chris <chris@bumblehead.com>
|
||||||
|
;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -137,6 +138,7 @@ number/base32-hash tuples, directly usable in the 'patch-series' form."
|
||||||
(version "5.1"))
|
(version "5.1"))
|
||||||
(package
|
(package
|
||||||
(name "bash")
|
(name "bash")
|
||||||
|
(replacement bash-fixed)
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (string-append
|
(uri (string-append
|
||||||
|
@ -254,6 +256,24 @@ without modification.")
|
||||||
(license license:gpl3+)
|
(license license:gpl3+)
|
||||||
(home-page "https://www.gnu.org/software/bash/"))))
|
(home-page "https://www.gnu.org/software/bash/"))))
|
||||||
|
|
||||||
|
(define bash-fixed
|
||||||
|
(package
|
||||||
|
(inherit bash)
|
||||||
|
(arguments
|
||||||
|
(substitute-keyword-arguments (package-arguments bash)
|
||||||
|
((#:modules modules '%default-gnu-modules)
|
||||||
|
(append '((ice-9 receive)
|
||||||
|
(srfi srfi-1)
|
||||||
|
(srfi srfi-26))
|
||||||
|
modules))
|
||||||
|
((#:configure-flags flags)
|
||||||
|
#~(receive (cppflags flags)
|
||||||
|
(partition (cut string-prefix? "CPPFLAGS" <>)
|
||||||
|
#$flags)
|
||||||
|
(cons (string-append (first cppflags)
|
||||||
|
" -DSYS_BASHRC='\"/etc/bashrc\"'")
|
||||||
|
flags)))))))
|
||||||
|
|
||||||
(define-public bash-minimal
|
(define-public bash-minimal
|
||||||
;; A stripped-down Bash for non-interactive use.
|
;; A stripped-down Bash for non-interactive use.
|
||||||
(package/inherit bash
|
(package/inherit bash
|
||||||
|
|
|
@ -165,9 +165,6 @@ then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source the system-wide file.
|
|
||||||
[ -f /etc/bashrc ] && source /etc/bashrc
|
|
||||||
|
|
||||||
alias ls='ls -p --color=auto'
|
alias ls='ls -p --color=auto'
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
alias grep='grep --color=auto'
|
alias grep='grep --color=auto'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue