Try configuring builders-configurator
This commit is contained in:
parent
becdb29c58
commit
3ab4a41285
|
@ -41,10 +41,10 @@ function title {
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
autoload -U colors && colors # Enable colors in prompt
|
autoload -U colors && colors # Enable colors in prompt
|
||||||
|
|
||||||
alias nom-build-remote="nom build --builders '@/etc/nix/machines'"
|
alias nom-build-remote="nom build --builders $(builders-configurators)"
|
||||||
alias nix-build-remote="nix build --builders '@/etc/nix/machines'"
|
alias nix-build-remote="nix build --builders $(builders-configurators)"
|
||||||
alias nixpkgs-review-pr-remote='nixpkgs-review pr --build-args "--builders @/etc/nix/machines"'
|
alias nixpkgs-review-pr-remote='nixpkgs-review pr --build-args "--builders $(builders-configurators)'
|
||||||
alias nixpkgs-review-rev-remote='nixpkgs-review rev --build-args "--builders @/etc/nix/machines"'
|
alias nixpkgs-review-rev-remote='nixpkgs-review rev --build-args "--builders $(builders-configurators)'
|
||||||
alias accounting='f() { if [[ "$1" == "" ]]; then year="buchhaltung" else year="$1" fi; hledger -f ~/git/buchhaltung/$year.journal ui -- --watch --theme=terminal -X€ -t -E}; f'
|
alias accounting='f() { if [[ "$1" == "" ]]; then year="buchhaltung" else year="$1" fi; hledger -f ~/git/buchhaltung/$year.journal ui -- --watch --theme=terminal -X€ -t -E}; f'
|
||||||
alias o=xdg-open
|
alias o=xdg-open
|
||||||
alias sudo='sudo -A'
|
alias sudo='sudo -A'
|
||||||
|
|
|
@ -24,6 +24,8 @@ in {
|
||||||
|
|
||||||
age.identityPaths = ["/disk/persist/etc/ssh/ssh_host_ed25519_key"];
|
age.identityPaths = ["/disk/persist/etc/ssh/ssh_host_ed25519_key"];
|
||||||
|
|
||||||
|
nix.distributedBuilds = false;
|
||||||
|
|
||||||
fileSystems = let
|
fileSystems = let
|
||||||
btrfsOptions = {options = ["compress=zstd" "autodefrag" "noatime"];};
|
btrfsOptions = {options = ["compress=zstd" "autodefrag" "noatime"];};
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -105,6 +105,7 @@
|
||||||
nix-output-monitor
|
nix-output-monitor
|
||||||
jq
|
jq
|
||||||
home-manager
|
home-manager
|
||||||
|
builders-configurator
|
||||||
;
|
;
|
||||||
inherit (pkgs.python3Packages) qrcode;
|
inherit (pkgs.python3Packages) qrcode;
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
export PATH=${lib.makeBinPath path}:$PATH
|
export PATH=${lib.makeBinPath path}:$PATH
|
||||||
git clone git@localhost:${name} .
|
git clone git@localhost:${name} .
|
||||||
git show -q --oneline
|
git show -q --oneline
|
||||||
export FLAGS="--builders @/etc/nix/machines -o /var/cache/gc-links/$JOB"
|
export FLAGS="--builders @$(${pkgs.builders-configurator}/bin/builders-configurators) -o /var/cache/gc-links/$JOB"
|
||||||
if [[ -e "flake.nix" ]]; then
|
if [[ -e "flake.nix" ]]; then
|
||||||
echo "Flake detected."
|
echo "Flake detected."
|
||||||
echo "Running 'flake check'"
|
echo "Running 'flake check'"
|
||||||
${pkgs.nix}/bin/nix flake check --builders @/etc/nix/machines
|
${pkgs.nix}/bin/nix flake check $FLAGS
|
||||||
echo "Running 'nix build'"
|
echo "Running 'nix build'"
|
||||||
${pkgs.nix}/bin/nix build $FLAGS
|
${pkgs.nix}/bin/nix build $FLAGS
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
boot = {
|
boot = {
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
'');
|
'');
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
distributedBuilds = true;
|
distributedBuilds = lib.mkDefault true;
|
||||||
gc = {
|
gc = {
|
||||||
automatic = false;
|
automatic = false;
|
||||||
options = "-d";
|
options = "-d";
|
||||||
|
|
|
@ -65,8 +65,8 @@ builderConfigs =
|
||||||
Map.fromList
|
Map.fromList
|
||||||
[ ("hera", [FirstOf ["zeus-builder"], Use "fluffy-builder", Use "remote-builder", Use "nixbuild.net"])
|
[ ("hera", [FirstOf ["zeus-builder"], Use "fluffy-builder", Use "remote-builder", Use "nixbuild.net"])
|
||||||
, ("apollo", [FirstOf ["zeus-builder-local", "zeus-builder"], FirstOfFinally ["fluffy-builder-local"] "fluffy-builder", Use "remote-builder", Use "nixbuild.net"])
|
, ("apollo", [FirstOf ["zeus-builder-local", "zeus-builder"], FirstOfFinally ["fluffy-builder-local"] "fluffy-builder", Use "remote-builder", Use "nixbuild.net"])
|
||||||
, ("fluffy", [FirstOf ["zeus-builder-local"], Use "fluffy-builder-local", Use "remote-builder", Use "nixbuild.net"])
|
, ("fluffy", [FirstOf ["zeus-builder-local"], Use "remote-builder", Use "nixbuild.net"])
|
||||||
, ("zeus", [Use "zeus-builder-local", Use "fluffy-builder-local", Use "remote-builder", Use "nixbuild.net"])
|
, ("zeus", [Use "fluffy-builder-local", Use "remote-builder", Use "nixbuild.net"])
|
||||||
]
|
]
|
||||||
|
|
||||||
commaList :: [Text] -> Text
|
commaList :: [Text] -> Text
|
||||||
|
@ -93,15 +93,15 @@ printBuilders = Text.unlines . fmap builderLine . Foldable.foldr' folder []
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
host : args <- getArgs
|
args <- getArgs
|
||||||
let withoutConnection =
|
env_host <- fromMaybe (error "accessed $HOST which is not set.") <$> lookupEnv "HOST"
|
||||||
args & \case
|
let (host, withoutConnection) = case args of
|
||||||
[] -> False
|
[] -> (env_host, False)
|
||||||
["--without-connection"] -> True
|
[host'] -> (host', False)
|
||||||
_ -> error [i|Unknown arguments: #{args}|]
|
[host', "--without-connection"] -> (host', True)
|
||||||
let
|
_ -> error [i|Unknown arguments: #{args}|]
|
||||||
builder_tries :: Ping :> es => Eff es [Text]
|
builder_tries :: Ping :> es => Eff es [Text]
|
||||||
builder_tries = testBuilders $ fromMaybe (error [i|#{host} not found in builderConfigs.|]) $ Map.lookup (into host) builderConfigs
|
builder_tries = testBuilders $ fromMaybe (error [i|#{host} not found in builderConfigs.|]) $ Map.lookup (into host) builderConfigs
|
||||||
builders <-
|
builders <-
|
||||||
if withoutConnection
|
if withoutConnection
|
||||||
then pure $ Eff.runPureEff $ runWithoutConnectivity builder_tries
|
then pure $ Eff.runPureEff $ runWithoutConnectivity builder_tries
|
||||||
|
|
Loading…
Reference in a new issue