Sketch for extension services
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
This commit is contained in:
parent
07039d2ae2
commit
a84b34a441
6 changed files with 73 additions and 11 deletions
9
base.nix
9
base.nix
|
@ -1,12 +1,13 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./modules/system_overrides.nix
|
||||
./modules/minimize.nix
|
||||
./modules/generic.nix
|
||||
./modules/filesystems.nix
|
||||
./modules/partitions.nix
|
||||
./modules/generic.nix
|
||||
./modules/minimize.nix
|
||||
./modules/network.nix
|
||||
./modules/patagia-agent.nix
|
||||
./modules/partitions.nix
|
||||
./modules/system_overrides.nix
|
||||
./modules/sysupdate.nix
|
||||
./modules/utils.nix
|
||||
];
|
||||
|
|
|
@ -7,11 +7,31 @@
|
|||
{
|
||||
|
||||
boot = {
|
||||
uki.name = "patos";
|
||||
kernelParams = [ "console=ttyS0" ];
|
||||
enableContainers = false;
|
||||
initrd.systemd.enable = true;
|
||||
kernelParams = [
|
||||
"console=ttyS0"
|
||||
# "quiet"
|
||||
];
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.grub.enable = false;
|
||||
loader.systemd-boot.enable = true;
|
||||
uki.name = "patos";
|
||||
};
|
||||
|
||||
# Temporary files
|
||||
boot.tmp.useTmpfs = true;
|
||||
systemd.services.nix-daemon = {
|
||||
environment.TMPDIR = "/var/tmp";
|
||||
};
|
||||
|
||||
system.switch = {
|
||||
enable = false;
|
||||
enableNg = true;
|
||||
};
|
||||
|
||||
services.fstrim.enable = true;
|
||||
|
||||
system.nixos = {
|
||||
codeName = "Finn";
|
||||
distroId = "patos";
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
"${modulesPath}/profiles/minimal.nix"
|
||||
];
|
||||
|
||||
boot.enableContainers = false;
|
||||
boot.loader.grub.enable = false;
|
||||
|
||||
system.switch.enable = false;
|
||||
nix.enable = false;
|
||||
|
||||
system.etc.overlay.enable = true;
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
# systemd-boot configuration
|
||||
"/loader/loader.conf".source = (
|
||||
pkgs.writeText "$out" ''
|
||||
timeout 3
|
||||
timeout 0
|
||||
''
|
||||
# FIXME: should not be 0 in prod
|
||||
);
|
||||
};
|
||||
repartConfig = {
|
||||
|
|
39
modules/patagia-agent.nix
Normal file
39
modules/patagia-agent.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
pkgs,
|
||||
utils,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
system.activationScripts.patagia-agent = ''
|
||||
mkdir -p /var/lib/extensions
|
||||
mkdir -p /etc/systemd/extensions
|
||||
'';
|
||||
|
||||
environment.etc."sysupdate.patagia-agent.d".source =
|
||||
let
|
||||
format = pkgs.formats.ini { listToValue = toString; };
|
||||
in
|
||||
utils.systemdUtils.lib.definitions "sysupdate.patagia-agent.d" format {
|
||||
"10-image.conf" = {
|
||||
Source = {
|
||||
MatchPattern = "patagia-agent_@v.raw";
|
||||
Path = "https://images.dl.patagia.dev/patagia-agent/";
|
||||
Type = "url-file";
|
||||
};
|
||||
|
||||
Target = {
|
||||
InstancesMax = 2;
|
||||
Path = "/var/lib/extensions";
|
||||
CurrentSymlink = "/etc/systemd/extensions/patagia-agent.raw";
|
||||
Type = "regular-file";
|
||||
MatchPattern = "patagia-agent_@v.raw";
|
||||
};
|
||||
|
||||
Transfer = {
|
||||
Verify = "no"; # FIXME: verify
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -54,6 +54,7 @@ in
|
|||
};
|
||||
Transfer = {
|
||||
ProtectVersion = "%A";
|
||||
Verify = "no";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -79,7 +80,11 @@ in
|
|||
Type = "partition";
|
||||
ReadOnly = "yes";
|
||||
};
|
||||
Transfer = {
|
||||
Verify = "no";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue