Skip to content

Commit

Permalink
Retire cache.vedenemo.dev
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Onatsu <joonas.onatsu@unikie.com>
  • Loading branch information
JoonasOnatsu committed Oct 24, 2024
1 parent 590575e commit 07069ad
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
26 changes: 13 additions & 13 deletions .github/actions/build-action/install_nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set -euo pipefail

# Check if Nix is already installed
if nix_path="$(type -p nix || command -v nix)"; then
echo "Aborting: Nix is already installed at ${nix_path}"
exit
echo "Aborting: Nix is already installed at ${nix_path}"
exit
fi

echo "Installing Nix version ${NIX_VERSION}"
Expand Down Expand Up @@ -41,9 +41,9 @@ add_config "extra-nix-path = nixpkgs=flake:nixpkgs"
add_config "trusted-users = root ${USER-}"

# Add default NixOS binary cache
add_config "substituters = https://cache.nixos.org/ https://cache.vedenemo.dev"
add_config "substituters = https://cache.nixos.org/"
add_config "trusted-substituters = https://cache.nixos.org/"
add_config "trusted-public-keys = cache.vedenemo.dev:8NhplARANhClUSWJyLVk4WMyy1Wb4rhmWW2u8AejH9E= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
add_config "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
add_config "substitute = true"

# Optimize store disk usage
Expand Down Expand Up @@ -79,9 +79,9 @@ unset -f add_config

# Nix installer flags
installer_options=(
--nix-extra-conf-file "${workdir}/nix.conf"
--daemon
--yes
--nix-extra-conf-file "${workdir}/nix.conf"
--daemon
--yes
)

echo "Nix installer options:"
Expand All @@ -90,12 +90,12 @@ echo "${installer_options[*]}"
# There is --retry-on-errors, but only newer curl versions support that
curl_retries=5
while ! curl -sS -o "${workdir}/install" -v --fail -L "https://releases.nixos.org/nix/nix-${NIX_VERSION}/install"; do
sleep 1
((curl_retries--))
if [[ ${curl_retries} -le 0 ]]; then
echo "curl retries failed" >&2
exit 1
fi
sleep 1
((curl_retries--))
if [[ ${curl_retries} -le 0 ]]; then
echo "curl retries failed" >&2
exit 1
fi
done

sh "${workdir}/install" "${installer_options[@]}"
36 changes: 20 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

nixConfig = {
extra-trusted-substituters = [
"https://cache.vedenemo.dev"
"https://cache.ssrcdevops.tii.ae"
];
extra-trusted-public-keys = [
"cache.vedenemo.dev:RGHheQnb6rXGK5v9gexJZ8iWTPX6OcSeS56YeXYzOcg="
"cache.ssrcdevops.tii.ae:oOrzj9iCppf+me5/3sN/BxEkp5SaFkHfKTPPZ97xXQk="
];
};
Expand All @@ -18,7 +16,11 @@
ghafOS.url = "github:tiiuae/ghaf";
};

outputs = inputs @ {ghafOS, self, ...}: let
outputs = inputs @ {
ghafOS,
self,
...
}: let
# Retrieve inputs from Ghaf
nixpkgs = ghafOS.inputs.nixpkgs;
flake-utils = ghafOS.inputs.flake-utils;
Expand All @@ -37,7 +39,6 @@
generateHwConfig = import ./config-processor-hardware.nix {inherit ghafOS self lib;};
generateInstConfig = import ./config-processor-installers.nix {inherit ghafOS self lib;};
in

flake-parts.lib.mkFlake
{
inherit inputs;
Expand All @@ -50,18 +51,21 @@
"x86_64-linux"
];

imports = [
./hydrajobs/flake-module.nix
./modules/flake-module.nix
] ++ map generateHwConfig [
(import ./hardware/fmo-os-rugged-laptop-7330.nix)
(import ./hardware/fmo-os-rugged-laptop-7330-public.nix)
(import ./hardware/fmo-os-rugged-tablet-7230.nix)
(import ./hardware/fmo-os-rugged-tablet-7230-public.nix)
] ++ map generateInstConfig [
(import ./installers/fmo-os-installer.nix)
(import ./installers/fmo-os-installer-public.nix)
];
imports =
[
./hydrajobs/flake-module.nix
./modules/flake-module.nix
]
++ map generateHwConfig [
(import ./hardware/fmo-os-rugged-laptop-7330.nix)
(import ./hardware/fmo-os-rugged-laptop-7330-public.nix)
(import ./hardware/fmo-os-rugged-tablet-7230.nix)
(import ./hardware/fmo-os-rugged-tablet-7230-public.nix)
]
++ map generateInstConfig [
(import ./installers/fmo-os-installer.nix)
(import ./installers/fmo-os-installer-public.nix)
];

flake.lib = lib;
};
Expand Down

0 comments on commit 07069ad

Please sign in to comment.