diff mbox series

[bug#40309,v2] system: Move nanorc to XDG_CONFIG_HOME.

Message ID 20200331181836.19521-1-efraim@flashner.co.il
State Accepted
Headers show
Series [bug#40309,v2] system: Move nanorc to XDG_CONFIG_HOME. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Efraim Flashner March 31, 2020, 6:18 p.m. UTC
* gnu/system/shadow.scm (skeleton-directory): Move .nanorc to
.config/nano/nanorc.
---

This time I've tested the patch by running './pre-inst-env guix system
build --no-grafts gnu/system/examples/bare-bones.tmpl' as-is and with
(gnu system shadow) edited to remove .nanorc completely from
default-skeletons.

---
 gnu/system/shadow.scm | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Leo Famulari March 31, 2020, 7 p.m. UTC | #1
On Tue, Mar 31, 2020 at 09:18:36PM +0300, Efraim Flashner wrote:
> * gnu/system/shadow.scm (skeleton-directory): Move .nanorc to
> .config/nano/nanorc.

Works for me, thanks!
Efraim Flashner April 1, 2020, 4:51 a.m. UTC | #2
On Tue, Mar 31, 2020 at 03:00:31PM -0400, Leo Famulari wrote:
> On Tue, Mar 31, 2020 at 09:18:36PM +0300, Efraim Flashner wrote:
> > * gnu/system/shadow.scm (skeleton-directory): Move .nanorc to
> > .config/nano/nanorc.
> 
> Works for me, thanks!

Patch pushed
diff mbox series

Patch

diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 46efdfddab..42480e823c 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -2,6 +2,7 @@ 
 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -215,6 +216,10 @@  for a colorful Guile experience.\\n\\n\"))))\n"))
                                    ((target source)
                                     (copy-recursively source target)))
                                  '#$skeletons)
+                       ;; Make nanorc respect XDG_CONFIG_HOME.
+                       (when (file-exists? ".nanorc")
+                         (mkdir-p ".config/nano")
+                         (rename-file ".nanorc" ".config/nano/nanorc"))
                        #t))))
 
 (define (assert-valid-users/groups users groups)