Skip to content

Commit

Permalink
tweak guix-daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Jul 23, 2024
1 parent cf3de29 commit 6ef6fb6
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 35 deletions.
45 changes: 26 additions & 19 deletions modules/nixos/guix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
enable = true;
dates = "weekly";
};
extraArgs =
let
substituters = [
"https://ci.guix.gnu.org"
# "https://bordeaux.guix.gnu.org"
# "https://guix.bordeaux.inria.fr"
];
in
[
"--substitute-urls=${lib.concatStringsSep " " substituters}"
"-c"
"10"
extraArgs = let
substituters = [
"https://ci.guix.gnu.org"
# "https://bordeaux.guix.gnu.org"
# "https://guix.bordeaux.inria.fr"
];
in [
"--substitute-urls=${lib.concatStringsSep " " substituters}"
"-c"
"10"
];
};

environment.extraInit = ''
export GUILE_LOAD_PATH="$GUILE_LOAD_PATH:$HOME/.config/guix/current/share/guile/site/3.0"
environment.extraInit =
# bash
''
export GUILE_LOAD_PATH="$GUILE_LOAD_PATH:$HOME/.config/guix/current/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/lib/guile/3.0/site-ccache"
'';
export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="$GUILE_LOAD_COMPILED_PATH:$HOME/.config/guix/current/lib/guile/3.0/site-ccache"
'';

# guix apps can't find these
environment.sessionVariables = {
Expand All @@ -40,12 +40,19 @@
};

systemd.services."guix-substituters" = rec {
path = [ config.services.guix.package ];
path = [config.services.guix.package];
script = ''
set -x
guix archive --authorize < ${./guix.bordeaux.inria.fr.pub}
'';
wantedBy = [ "guix-daemon.service" ];
wantedBy = ["guix-daemon.service"];
after = wantedBy;
};

systemd.services."guix-daemon" = {
environment = {
# GUIX_LOCPATH = lib.mkForce "/run/current-system/sw/lib/locale";
# GUIX_LOCPATH = lib.mkForce "/gnu/store/03v1svhv6wj9pd6awpdi5zn4wd31b23f-glibc-locales-2.35/lib/locale";
};
};
}
37 changes: 21 additions & 16 deletions packages/guix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,34 @@
guix,
symlinkJoin,
writeShellScriptBin,

# passed by nixos module
storeDir ? null,
stateDir ? null,
}:

let
profile = "/var/guix/profiles/per-user/ayats/current-guix";
}: let
profiles = "/var/guix/profiles/per-user/ayats";
current-guix = "${profiles}/current-guix";
guix-home = "${profiles}/guix-home/profile";
mkDispatch = bin:
writeShellScriptBin bin ''
if [[ -f "${profile}/bin/${bin}" ]]; then
exec -a "$0" "${profile}/bin/${bin}" "$@"
if [[ -d "${guix-home}/lib/locale" ]]; then
>&2 echo "Found locales in user's guix home"
export GUIX_LOCPATH="${guix-home}/lib/locale:$GUIX_LOCPATH"
else
>&2 echo "Didn't find locales in user's guix home"
fi
if [[ -f "${current-guix}/bin/${bin}" ]]; then
exec -a "$0" "${current-guix}/bin/${bin}" "$@"
else
exec -a "$0" ${guix}/bin/${bin} "$@"
fi
'';
in
symlinkJoin {
inherit (guix) name pname version meta;
paths = [
(mkDispatch "guix")
(mkDispatch "guix-daemon")
guix
];
}

symlinkJoin {
inherit (guix) name pname version meta;
paths = [
(mkDispatch "guix")
(mkDispatch "guix-daemon")
guix
];
}

0 comments on commit 6ef6fb6

Please sign in to comment.