Replacing a package system-wide

2022-03-14 Thread Dominic Martinez
One of the things I love about Guix is how easy it is to modify 
dependencies, a feature I use fairly often on individual packages 
or manifests. However, I'm struggling to get a similar effect 
system-wide.


Grafts do exactly what I want, but since they are defined in the 
upstream package definition I can't set them for my personal 
system. Package rewriting lets me do this on a plain list of 
packages, but it's really difficult to do the same for services 
and not possible for guix shell/other command line usage.

#+begin_src scheme
(operating-system
;; Package rewriting makes this fairly straight-forward
(packages (fix-pkg %my-packages))

;; But for packages deep in the dependency tree, you have to
;; track down every service that has this package as a transient
;; dependency and fix it.
(services
 (service some-pkg-service-type
  (some-pkg-service-configuration
   (some-pkg-service (fix-pkg pkg

 ;; Repeat ad-nauseum
 ))
#+end_src

If you're attempting to customize, say, Xorg, this results in a 
very-not-fun-time.


My ideal solution is something like the following:
#+begin_src scheme
;; When installed in a profile, replaces pkg for everything in the
;; profile
(fixed-pkg
(replaces pkg)
...)
#+end_src

Or if that's infeasible, at least something like this:
#+begin_src scheme
(list (channel
   (name 'guix)
   (url "https://git.savannah.gnu.org/git/guix.git;)
   (replacements `((,pkg . ,fixed-pkg)))
   ...))
#+end_src

I'm thinking this falls into one of the following:
1. I'm dumb and there's an obvious solution
2. I should be using a local checkout for this type of work and 
not the upstream Guix channel
3. There's no good mechanism for this, and a patch would be 
welcomed


I'd appreciate any advice here, as this feels so much like 
something Guix should do surely others have stumbled on this 
before. Thank you!


signature.asc
Description: PGP signature


Re: Does guix not include samba service?

2022-03-14 Thread Simon Streit
jbra...@dismail.de writes:
> I would say just post it to guix-patc...@gnu.org.  That way the code is
> not lost.  If someone wants to complete it, then they can.

You're right.  I better prepare a patch series for the services written.

Though I can't promise to have it done until this weekend.



Re: Does guix not include samba service?

2022-03-14 Thread jbranso
March 14, 2022 6:37 AM, "Simon Streit"  wrote:

> Hello,
> 
> Tobias Geerinckx-Rice  writes:
> 
>> Nope, there is no samba service in Guix (yet :-).
> 
> I've actually been working on one, which happens to be my final thesis
> for my school course. I completed it, and handed it in. But stopped
> shy from posting it to the Guix community. But I've been too quiet on
> this subject lately.
> 
> I got a basic service running, have written some documentation for the
> manual. But stopped short of submitting patches. I am not convinced
> that it is good enough to be included into Guix though.
> 
> It definetly needs better improving. Yesterday I finally started to
> refactor it and have prepared it to implement a config serialiser.
> Samba's configuration framework overwhelmed me for a bit.
> 
> Anyone willing to see its basic shape? I should prepare a local Guix
> branch somewhere for anyone who's interested to see it.

I would say just post it to guix-patc...@gnu.org.  That way the code is
not lost.  If someone wants to complete it, then they can.

> 
> Kind regards
> Simon



Re: Does guix not include samba service?

2022-03-14 Thread Simon Streit
Hello,

Tobias Geerinckx-Rice  writes:
> Nope, there is no samba service in Guix (yet :-).

I've actually been working on one, which happens to be my final thesis
for my school course.  I completed it, and handed it in.  But stopped
shy from posting it to the Guix community.  But I've been too quiet on
this subject lately.

I got a basic service running, have written some documentation for the
manual.  But stopped short of submitting patches.  I am not convinced
that it is good enough to be included into Guix though.

It definetly needs better improving.  Yesterday I finally started to
refactor it and have prepared it to implement a config serialiser.
Samba's configuration framework overwhelmed me for a bit.

Anyone willing to see its basic shape?  I should prepare a local Guix
branch somewhere for anyone who's interested to see it.


Kind regards
Simon