make it so servo doesn't do binfmt emulation, nor fetch cache from desko

This commit is contained in:
Colin 2023-03-11 13:45:45 +00:00
parent 39eb1e3d07
commit 8fc57c4249
4 changed files with 17 additions and 8 deletions

View File

@ -4,7 +4,7 @@
./fs.nix
];
sane.roles.build-machine = true;
sane.roles.build-machine.enable = true;
sane.roles.client = true;
sane.services.wg-home.enable = true;
sane.services.wg-home.ip = config.sane.hosts.by-name."desko".wg-home.ip;

View File

@ -15,7 +15,8 @@
signaldctl.enableFor.user.colin = true;
};
sane.roles.build-machine = true;
sane.roles.build-machine.enable = true;
sane.roles.build-machine.emulation = false;
sane.zsh.showDeadlines = false; # ~/knowledge doesn't always exist
sane.services.dyn-dns.enable = true;
sane.services.wg-home.enable = true;

View File

@ -28,8 +28,9 @@ in
sane.nixcache.substituters = mkOption {
type = types.listOf types.string;
default =
# TODO: make these blacklisted entries injectable
(lib.optional (hostName != "servo") "https://nixcache.uninsane.org")
++ (lib.optional (hostName != "desko") "http://desko:5000")
++ (lib.optional (hostName != "servo" && hostName != "desko") "http://desko:5000")
++ [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"

View File

@ -3,11 +3,18 @@
let
inherit (lib) mkIf mkMerge mkOption types;
inherit (config.programs.ccache) cacheDir;
cfg = config.sane.roles.build-machine;
in
{
options.sane.roles.build-machine = mkOption {
type = types.bool;
default = false;
options.sane.roles.build-machine = {
enable = mkOption {
type = types.bool;
default = false;
};
emulation = mkOption {
type = types.bool;
default = true;
};
};
config = mkMerge [
@ -30,13 +37,13 @@ in
# })
# ];
}
(mkIf config.sane.roles.build-machine {
(mkIf cfg.enable {
# serve packages to other machines that ask for them
sane.services.nixserve.enable = true;
# enable cross compilation
# TODO: do this via stdenv injection, linking into /run/binfmt the stuff in <nixpkgs:nixos/modules/system/boot/binfmt.nix>
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
boot.binfmt.emulatedSystems = lib.optional cfg.emulation [ "aarch64-linux" ];
# corresponds to env var: NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
# nixpkgs.config.allowUnsupportedSystem = true;