Skip to content

Commit

Permalink
Merge pull request #2 from UTCSheffield/Sean/Upgrade-tool
Browse files Browse the repository at this point in the history
Very Barebones upgrade server setup
  • Loading branch information
devramsean0 authored Nov 27, 2024
2 parents b16056d + ef17581 commit c76cea5
Show file tree
Hide file tree
Showing 35 changed files with 1,237 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Javascript/Typescript
yarn-error.log
node_modules
dist
.yarn/install-state.gz
.yarn/build-state.yml

# Rust
target
4 changes: 1 addition & 3 deletions machines/iso.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ with lib;
{
environment.etc."setup.sh".source = ../setup.sh;
environment.etc."setup.sh".mode = "0755";

services.getty.autologinUser = lib.mkForce "root";
environment.systemPackages = [
pkgs.git
];

services.getty.autologinUser = lib.mkForce "root";
}
30 changes: 30 additions & 0 deletions programs/update-client.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:

let updateClient = pkgs.callPackage ../update-tool/client.nix {};
in
{
environment.systemPackages = with pkgs; [
updateClient
];
systemd.services.updateClient = {
description = "Update tool Client";
path = [
pkgs.git
];
serviceConfig = {
ExecStart = "${updateClient}/bin/update-client --wss-path=ws://127.0.0.1:8080";
User = "root";
Restart = "on-failure";
RestartSec = 10;
StartLimitIntervalSec = 30;
StartLimitBurst = 3;
StandardOutput = "journal";
StandardError = "journal";
ProtectSystem = "false";
ReadWritePaths = [ "/etc/nixos" ];
};
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
requires = [ "network.target" ];
};
}
1 change: 0 additions & 1 deletion setuppt2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ read -p "Target Config (ex: makerlab-3040) " config
echo "Setup Nixos"
mkdir -p /mnt/etc
mkdir -p /mnt/etc/nixos

git clone https://github.com/UTCSheffield/olp-nixos-config /mnt/etc/nixos

nixos-install --flake /mnt/etc/nixos#$config
Expand Down
3 changes: 3 additions & 0 deletions shared/makerlab-core.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ config, lib, pkgs, ... }:

{
imports = [
../programs/update-client.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "Europe/London";
Expand Down
17 changes: 17 additions & 0 deletions update-tool/client.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ rustPlatform, lib }:

rustPlatform.buildRustPackage rec {
pname = "update-tool-client";
version = "1.0.0";

src = ./client; # Use current directory as source

cargoHash = "sha256-g6M3SZXk5ReUNi1MHfLHE3CtDy9P41ZofTmhAekI0LQ=";

meta = {
description = "Update Client";
homepage = "https://github.com/UTCSheffield/olp-nixos-config";
license = lib.licenses.unlicense;
maintainers = [ ];
};
}
Loading

0 comments on commit c76cea5

Please sign in to comment.