all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: help-guix@gnu.org
Subject: Newbie: How to define a package that install files to ~/.config?
Date: Sat, 18 Mar 2023 00:02:27 -0500	[thread overview]
Message-ID: <CAGxMbPZ50gkRKByXgMx-asnySXGPLgTppcsjMC+VUdkKfLPgXQ@mail.gmail.com> (raw)

Table of Contents
_________________

1. What I'm trying to do
2. What I've tried
3. The problem
4. The question


Newbie: How to define a package that creates files in ~/.config?


1 What I'm trying to do
=======================

  I want to define a package that downloads a file from a git repository
  and puts the file under a directory in `~/.config/' (specifically,
  `~/.config/ibus/rime/')


2 What I've tried
=================

  I've defined a module containing the definition of a package that
  tries to accomplish that goal. It uses `install-file' to copy the
  downloaded files to the desired location (please see code block below)

  ,----
  | cat ~/my/packages/rime.scm
  `----

  ,----
  | (define-module (rime)
  |   #:use-module (guix licenses)
  |   #:use-module (guix packages)
  |   #:use-module (guix gexp)
  |   #:use-module (guix build-system trivial)
  |   #:use-module (guix git-download))
  |
  | (define-public rime-wubi
  |   (package
  |    (name "rime-wubi")
  |    (version "1.0")
  |    (source (origin
  |             (method git-fetch)
  |             (uri (git-reference
  |                   (url "https://github.com/rime/rime-wubi")
  |                   (commit "f1876f08f1d4a9696395be0070c0e8e4353c44cb")))
  |             (file-name (git-file-name name version))
  |             (sha256
  |              (base32
  |               "1d9y9rqssacria9d0hla96czsqv2wkfm6z926m1x269ryv96zxvk"))))
  |    (build-system trivial-build-system)
  |    (arguments
  |     (list
  |      #:modules `((guix build utils))
  |      #:builder
  |      #~(begin
  |          (use-modules (guix build utils))
  |          (chdir (assoc-ref %build-inputs "source"))
  |          (install-file "wubi86.dict.yaml" (string-append #$output
"/.config/ibus/rime"))
  |          (install-file "wubi86.schema.yaml" (string-append #$output
"/.config/ibus/rime")))))
  |    (synopsis "Wubi86 schema and dictionary for RIME")
  |    (description "This package contains a dictionary and a schema
definition for the 86
  | version of Wubi, a shape-based input method for Chinese characters.")
  |    (home-page "https://github.com/rime/rime-wubi")
  |    (license lgpl3)))
  `----

  The package is installed without no problems.

  ,----
  | export GUIX_PACKAGE_PATH="$HOME/my/packages"
  | guix package -i rime-wubi
  `----

  ,----
  | The following package will be installed:
  |    rime-wubi 1.0
  |
  `----

  ,----
  | echo $?
  `----

  ,----
  | 0
  `----


3 The problem
=============

  However, the files `wubi86.dict.yaml' and `wubi86.schema.yaml' are
  installed in `~/.guix-profile/.config/ibus/rime' (see code block
  below)

  ,----
  | find -L /home/rdrg/.guix-profile/.config
  `----

  ,----
  | /home/rdrg/.guix-profile/.config
  | /home/rdrg/.guix-profile/.config/ibus
  | /home/rdrg/.guix-profile/.config/ibus/rime
  | /home/rdrg/.guix-profile/.config/ibus/rime/wubi86.dict.yaml
  | /home/rdrg/.guix-profile/.config/ibus/rime/wubi86.schema.yaml
  `----

  Those files don't appear in `~/.config/ibus/rime' (the location I want
  them to exist in)

  ,----
  | find ~/.config/ibus/rime
  `----

  ,----
  | /home/rdrg/.config/ibus/rime
  | /home/rdrg/.config/ibus/rime/default.custom.yaml
  `----


4 The question
==============

  How to define a package that install files to any directory under
  `~/.config/'?

             reply	other threads:[~2023-03-18  5:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18  5:02 Rodrigo Morales [this message]
2023-03-18  9:31 ` Newbie: How to define a package that install files to ~/.config? Martin Castillo
2023-03-20  7:48 ` Martin Castillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGxMbPZ50gkRKByXgMx-asnySXGPLgTppcsjMC+VUdkKfLPgXQ@mail.gmail.com \
    --to=moralesrodrigo1100@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.