refactor: Module to ugaif and readme update
This commit is contained in:
committed by
Hunter Halloran
parent
c46b0aa685
commit
205f03337a
@@ -8,7 +8,7 @@
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.modules.sw.remoteBuild = lib.mkOption {
|
||||
options.ugaif.sw.remoteBuild = lib.mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
hosts = mkOption {
|
||||
@@ -29,7 +29,7 @@ with lib;
|
||||
};
|
||||
|
||||
config = {
|
||||
modules.sw.remoteBuild.enable = lib.mkDefault (config.modules.sw.type == "tablet-kiosk");
|
||||
ugaif.sw.remoteBuild.enable = lib.mkDefault (config.ugaif.sw.type == "tablet-kiosk");
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "update-system" ''
|
||||
@@ -62,18 +62,15 @@ with lib;
|
||||
description = "System daemon to one-shot run the Nix updater from fleet flake as root";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart =
|
||||
ExecStart =
|
||||
let
|
||||
hosts = config.modules.sw.remoteBuild.hosts;
|
||||
hosts = config.ugaif.sw.remoteBuild.hosts;
|
||||
builders = lib.strings.concatMapStringsSep ";" (x: x) hosts;
|
||||
rebuildCmd = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --refresh";
|
||||
source = "--flake github:UGA-Innovation-Factory/nixos-systems";
|
||||
remoteBuildFlags = if config.modules.sw.remoteBuild.enable
|
||||
then
|
||||
''--builders "${builders}"''
|
||||
else "";
|
||||
remoteBuildFlags = if config.ugaif.sw.remoteBuild.enable then ''--builders "${builders}"'' else "";
|
||||
in
|
||||
"${rebuildCmd} ${remoteBuildFlags} --print-build-logs ${source}#${config.networking.hostName}";
|
||||
"${rebuildCmd} ${remoteBuildFlags} --print-build-logs ${source}#${config.networking.hostName}";
|
||||
User = "root";
|
||||
Group = "root";
|
||||
TimeoutStartSec = "0";
|
||||
|
||||
Reference in New Issue
Block a user