refactor: group build-machine-related config into one "role" file

This commit is contained in:
Colin 2023-03-05 01:03:59 +00:00
parent 79b6c119ee
commit d725dfb7f1
5 changed files with 23 additions and 6 deletions

View File

@ -4,11 +4,11 @@
./fs.nix
];
sane.roles.build-machine = 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;
sane.services.duplicity.enable = true;
sane.services.nixserve.enable = true;
sane.services.nixserve.sopsFile = ../../../secrets/desko.yaml;
sane.persist.enable = true;

View File

@ -15,6 +15,7 @@
signaldctl.enableFor.user.colin = true;
};
sane.roles.build-machine = true;
sane.persist.enable = true;
sane.services.dyn-dns.enable = true;
sane.services.wg-home.enable = true;

View File

@ -9,11 +9,6 @@
# efi_pstore evivars
];
# enable cross compilation
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# nixpkgs.config.allowUnsupportedSystem = true;
# nixpkgs.crossSystem.system = "aarch64-linux";
powerManagement.cpuFreqGovernor = "powersave";
hardware.cpu.amd.updateMicrocode = true; # desktop
hardware.cpu.intel.updateMicrocode = true; # laptop

View File

@ -0,0 +1,20 @@
{ config, lib, ... }:
let
inherit (lib) mkIf mkOption types;
in
{
options.sane.roles.build-machine = mkOption {
type = types.bool;
default = false;
};
config = mkIf config.sane.roles.build-machine {
# serve packages to other machines that ask for them
sane.services.nixserve.enable = true;
# enable cross compilation
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# nixpkgs.config.allowUnsupportedSystem = true;
};
}

View File

@ -1,6 +1,7 @@
{ ... }:
{
imports = [
./build-machine.nix
./client
];
}