From 59d57327fa7004789db94b5bfaefd6dc263bb510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 10:51:04 +0200 Subject: [PATCH 01/12] Pass only required fields to rescueSystem --- bootloader/rescue/default.nix | 6 +++--- default.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootloader/rescue/default.nix b/bootloader/rescue/default.nix index 4ecd113a..56c38dfb 100644 --- a/bootloader/rescue/default.nix +++ b/bootloader/rescue/default.nix @@ -1,5 +1,5 @@ { stdenv, lib -, application +, safeProductName, fullProductName , squashfsTools, closureInfo, makeInitrd, linkFarm , importFromNixos , writeScript, dialog @@ -23,7 +23,7 @@ let do ${dialog}/bin/dialog --clear --title "" \ - --backtitle "${application.fullProductName} - Rescue System" \ + --backtitle "${fullProductName} - Rescue System" \ --nocancel \ --menu "Please Select an action" 0 0 0 \ "wipe-user-data" "Delete all user data." \ @@ -94,7 +94,7 @@ in ''; }; networking = { - hostName = "${application.safeProductName}-rescue"; + hostName = "${safeProductName}-rescue"; # enable wpa_supplicant wireless = { enable = true; diff --git a/default.nix b/default.nix index 8004ce2a..baed5f59 100644 --- a/default.nix +++ b/default.nix @@ -87,7 +87,7 @@ let # Rescue system rescueSystem = callPackage ./bootloader/rescue { - application = application; + inherit safeProductName fullProductName; }; # Installer ISO image From d872d776276011f386a8ac3328b80afc3c6c71bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 11:15:58 +0200 Subject: [PATCH 02/12] Make skeleton parts be sub-packages of installer --- default.nix | 20 +++++--------------- installer/default.nix | 28 ++++++++++++++++++++++------ installer/install-playos/default.nix | 12 ++---------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/default.nix b/default.nix index baed5f59..c2b76276 100644 --- a/default.nix +++ b/default.nix @@ -80,24 +80,14 @@ let # USB live system live = callPackage ./live { application = application; }; - # Installation script - install-playos = callPackage ./installer/install-playos { - grubCfg = ./bootloader/grub.cfg; - }; - - # Rescue system - rescueSystem = callPackage ./bootloader/rescue { - inherit safeProductName fullProductName; - }; - - # Installer ISO image + # Installer script and ISO (PlayOS skeleton) installer = callPackage ./installer {}; # Script to deploy updates deploy-update = callPackage ./deployment/deploy-update { application = application; live = if buildLive then live else ""; - installer = if buildInstaller then installer else ""; + installer = if buildInstaller then installer.isoImage else ""; }; # RAUC bundle @@ -139,7 +129,7 @@ let }; releaseDisk = pkgs.callPackage ./testing/disk/release.nix { - inherit (releaseValidationComponents) install-playos; + install-playos = releaseValidationComponents.installer.install-playos; }; in @@ -149,7 +139,7 @@ with pkgs; stdenv.mkDerivation { buildInputs = [ rauc (python3.withPackages(ps: with ps; [pyparted])) - components.install-playos + components.installer.install-playos ]; buildCommand = '' @@ -176,7 +166,7 @@ with pkgs; stdenv.mkDerivation { '' # Installer ISO image + lib.optionalString buildInstaller '' - ln -s ${components.installer}/iso/${components.safeProductName}-installer-${components.version}.iso $out/${components.safeProductName}-installer-${components.version}.iso + ln -s ${components.installer.isoImage}/iso/${components.safeProductName}-installer-${components.version}.iso $out/${components.safeProductName}-installer-${components.version}.iso '' # RAUC bundle + lib.optionalString buildBundle '' diff --git a/installer/default.nix b/installer/default.nix index 5da8101f..c3b96775 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,18 +1,34 @@ # Build NixOS system { config, lib, pkgs -, version, safeProductName, fullProductName, greeting, install-playos +, systemImage +, version, safeProductName, fullProductName, greeting +, kioskUrl, updateUrl , squashfsCompressionOpts }: let nixos = pkgs.importFromNixos ""; + # Rescue system + rescueSystem = pkgs.callPackage ../bootloader/rescue { + inherit safeProductName fullProductName squashfsCompressionOpts; + }; + + # Installation script + install-playos = pkgs.callPackage ./install-playos { + grubCfg = ../bootloader/grub.cfg; + inherit kioskUrl updateUrl rescueSystem systemImage version; + }; + configuration = (import ./configuration.nix) { inherit config pkgs lib install-playos version safeProductName fullProductName greeting squashfsCompressionOpts; }; -in -(nixos { - inherit configuration; - system = "x86_64-linux"; -}).config.system.build.isoImage + isoImage = (nixos { + inherit configuration; + system = "x86_64-linux"; + }).config.system.build.isoImage; +in +{ + inherit install-playos isoImage; +} diff --git a/installer/install-playos/default.nix b/installer/install-playos/default.nix index 0a994338..532b685f 100644 --- a/installer/install-playos/default.nix +++ b/installer/install-playos/default.nix @@ -1,13 +1,4 @@ -{ stdenv -, substituteAll -, makeWrapper -, grub2_efi -, e2fsprogs -, dosfstools -, utillinux -, python3 -, pv -, closureInfo +{ pkgs , systemImage , rescueSystem @@ -16,6 +7,7 @@ , updateUrl , kioskUrl }: +with pkgs; let systemClosureInfo = closureInfo { rootPaths = [ systemImage ]; }; From 94c6bfe93b4edc6a26b71f10e411fc572704bfdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 11:44:28 +0200 Subject: [PATCH 03/12] Make installer and sub-components independant of system image nixpkgs Also semi-convert configuration into a module. --- bootloader/rescue/default.nix | 3 +-- installer/configuration.nix | 7 ++++--- installer/default.nix | 21 +++++++++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/bootloader/rescue/default.nix b/bootloader/rescue/default.nix index 56c38dfb..b3eae4ff 100644 --- a/bootloader/rescue/default.nix +++ b/bootloader/rescue/default.nix @@ -1,13 +1,12 @@ { stdenv, lib , safeProductName, fullProductName , squashfsTools, closureInfo, makeInitrd, linkFarm -, importFromNixos +, nixos , writeScript, dialog , vim, grub2_efi, rauc , squashfsCompressionOpts}: with lib; let - nixos = importFromNixos ""; squashfsCompressionParams = if (squashfsCompressionOpts == null) diff --git a/installer/configuration.nix b/installer/configuration.nix index 9c7b8ea1..b6281424 100644 --- a/installer/configuration.nix +++ b/installer/configuration.nix @@ -1,10 +1,11 @@ -{ config, pkgs, lib, install-playos, version, safeProductName, fullProductName, greeting, squashfsCompressionOpts, ... }: +{ install-playos, version, safeProductName, fullProductName, greeting, squashfsCompressionOpts, ... }: -with lib; +{ modulesPath, lib, ... }: +with lib; { imports = [ - (pkgs.importFromNixos "modules/installer/cd-dvd/iso-image.nix") + "${modulesPath}/installer/cd-dvd/iso-image.nix" ]; # Custom label when identifying OS diff --git a/installer/default.nix b/installer/default.nix index c3b96775..d8c87299 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,16 +1,23 @@ # Build NixOS system -{ config, lib, pkgs -, systemImage +{ systemImage , version, safeProductName, fullProductName, greeting , kioskUrl, updateUrl , squashfsCompressionOpts }: let - nixos = pkgs.importFromNixos ""; + nixpkgs = builtins.fetchTarball { + # release-24.11 2025-02-10 + url = "https://github.com/NixOS/nixpkgs/archive/edd84e9bffdf1c0ceba05c0d868356f28a1eb7de.tar.gz"; + sha256 = "1gb61gahkq74hqiw8kbr9j0qwf2wlwnsvhb7z68zhm8wa27grqr0"; + }; + + pkgs = import nixpkgs { }; + + nixos = import "${nixpkgs}/nixos"; # Rescue system rescueSystem = pkgs.callPackage ../bootloader/rescue { - inherit safeProductName fullProductName squashfsCompressionOpts; + inherit nixos safeProductName fullProductName squashfsCompressionOpts; }; # Installation script @@ -20,12 +27,14 @@ let }; configuration = (import ./configuration.nix) { - inherit config pkgs lib install-playos version safeProductName fullProductName greeting squashfsCompressionOpts; + inherit install-playos version safeProductName fullProductName greeting squashfsCompressionOpts; }; isoImage = (nixos { - inherit configuration; + configuration = { + imports = [ configuration ]; + }; system = "x86_64-linux"; }).config.system.build.isoImage; in From d2db7c6178ea8e4d79dd56269e76d156aa65aa24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 12:04:31 +0200 Subject: [PATCH 04/12] Move bootloader to a be sub-component of installer --- {bootloader => installer/bootloader}/grub.cfg | 0 {bootloader => installer/bootloader}/rescue/default.nix | 0 installer/default.nix | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename {bootloader => installer/bootloader}/grub.cfg (100%) rename {bootloader => installer/bootloader}/rescue/default.nix (100%) diff --git a/bootloader/grub.cfg b/installer/bootloader/grub.cfg similarity index 100% rename from bootloader/grub.cfg rename to installer/bootloader/grub.cfg diff --git a/bootloader/rescue/default.nix b/installer/bootloader/rescue/default.nix similarity index 100% rename from bootloader/rescue/default.nix rename to installer/bootloader/rescue/default.nix diff --git a/installer/default.nix b/installer/default.nix index d8c87299..3b4db786 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -16,13 +16,13 @@ let nixos = import "${nixpkgs}/nixos"; # Rescue system - rescueSystem = pkgs.callPackage ../bootloader/rescue { + rescueSystem = pkgs.callPackage ./bootloader/rescue { inherit nixos safeProductName fullProductName squashfsCompressionOpts; }; # Installation script install-playos = pkgs.callPackage ./install-playos { - grubCfg = ../bootloader/grub.cfg; + grubCfg = ./bootloader/grub.cfg; inherit kioskUrl updateUrl rescueSystem systemImage version; }; From b2660917f575f3dd60daa5dc15081d08c0b9796d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 12:20:12 +0200 Subject: [PATCH 05/12] Use the same RAUC package in installer and runtime system --- installer/default.nix | 7 ++++++- ...pt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch | 0 {pkgs => installer}/rauc/default.nix | 0 pkgs/default.nix | 5 ++++- 4 files changed, 10 insertions(+), 2 deletions(-) rename {pkgs => installer}/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch (100%) rename {pkgs => installer}/rauc/default.nix (100%) diff --git a/installer/default.nix b/installer/default.nix index 3b4db786..0c7aa1b3 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -11,7 +11,12 @@ let sha256 = "1gb61gahkq74hqiw8kbr9j0qwf2wlwnsvhb7z68zhm8wa27grqr0"; }; - pkgs = import nixpkgs { }; + overlay = + self: super: { + rauc = (import ./rauc) super; + }; + + pkgs = import nixpkgs { overlays = [ overlay ]; }; nixos = import "${nixpkgs}/nixos"; diff --git a/pkgs/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch b/installer/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch similarity index 100% rename from pkgs/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch rename to installer/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch diff --git a/pkgs/rauc/default.nix b/installer/rauc/default.nix similarity index 100% rename from pkgs/rauc/default.nix rename to installer/rauc/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 9f0ef639..cac1982c 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,7 +13,10 @@ let importFromNixos = path: import (nixpkgs + "/nixos/" + path); - rauc = (import ./rauc) super; + # TODO: replace with something along the lines of: + # rauc = (import ../installer/pkgs).rauc; + # to ensure 100% identical package and deps? + rauc = (import ../installer/rauc) super; ocamlPackages = super.ocamlPackages.overrideScope (self: super: { semver = self.callPackage ./ocaml-modules/semver {}; From 661a34ffce037202e3f5e2bbd53ea047199bbc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 12:38:46 +0200 Subject: [PATCH 06/12] Drop the need to share greeting formatter with installer --- installer/configuration.nix | 18 +++++++++++++++++- installer/default.nix | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/installer/configuration.nix b/installer/configuration.nix index b6281424..7114d73c 100644 --- a/installer/configuration.nix +++ b/installer/configuration.nix @@ -1,8 +1,24 @@ -{ install-playos, version, safeProductName, fullProductName, greeting, squashfsCompressionOpts, ... }: +{ install-playos, version, safeProductName, fullProductName, squashfsCompressionOpts, ... }: { modulesPath, lib, ... }: with lib; +let + # TODO: WIP ^_^ + greeting = label: '' + ░░░░ + ░▒▒▒▒▒▒▒ ░ ▒ + ▒▒▒▒▒ ░░▒▒░░░▒▒▒▒▒ ▒▒ + ▒▒ ░░░░░░░ ▒▒▒▒▒ + ▒▒▒ ▲ ▲ ▒▒ + ▒░░ ░ + ░░░ ░ + ░░░▒▒ ▒▒░░░ ▒▒▒ ░░ ${label} + ▒▒▒▒▒▒▒▒ ░░░▒▒▒░░░ + ''; + +in + { imports = [ "${modulesPath}/installer/cd-dvd/iso-image.nix" diff --git a/installer/default.nix b/installer/default.nix index 0c7aa1b3..dab9a585 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,6 +1,6 @@ # Build NixOS system { systemImage -, version, safeProductName, fullProductName, greeting +, version, safeProductName, fullProductName , kioskUrl, updateUrl , squashfsCompressionOpts }: @@ -32,7 +32,7 @@ let }; configuration = (import ./configuration.nix) { - inherit install-playos version safeProductName fullProductName greeting squashfsCompressionOpts; + inherit install-playos version safeProductName fullProductName squashfsCompressionOpts; }; From 9b4bd675f69ffc3bfd4f6dc3a506a0992b9bf5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 15:06:41 +0200 Subject: [PATCH 07/12] Combine system metadat into single attrset within installer --- installer/bootloader/rescue/default.nix | 6 +++--- installer/configuration.nix | 3 ++- installer/default.nix | 22 +++++++++++++++------- installer/install-playos/default.nix | 9 ++++----- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/installer/bootloader/rescue/default.nix b/installer/bootloader/rescue/default.nix index b3eae4ff..601c91e0 100644 --- a/installer/bootloader/rescue/default.nix +++ b/installer/bootloader/rescue/default.nix @@ -1,5 +1,5 @@ { stdenv, lib -, safeProductName, fullProductName +, systemMetadata , squashfsTools, closureInfo, makeInitrd, linkFarm , nixos , writeScript, dialog @@ -22,7 +22,7 @@ let do ${dialog}/bin/dialog --clear --title "" \ - --backtitle "${fullProductName} - Rescue System" \ + --backtitle "${systemMetadata.fullProductName} - Rescue System" \ --nocancel \ --menu "Please Select an action" 0 0 0 \ "wipe-user-data" "Delete all user data." \ @@ -93,7 +93,7 @@ in ''; }; networking = { - hostName = "${safeProductName}-rescue"; + hostName = "${systemMetadata.safeProductName}-rescue"; # enable wpa_supplicant wireless = { enable = true; diff --git a/installer/configuration.nix b/installer/configuration.nix index 7114d73c..29f025af 100644 --- a/installer/configuration.nix +++ b/installer/configuration.nix @@ -1,8 +1,9 @@ -{ install-playos, version, safeProductName, fullProductName, squashfsCompressionOpts, ... }: +{ install-playos, squashfsCompressionOpts, systemMetadata, ... }: { modulesPath, lib, ... }: with lib; +with systemMetadata; let # TODO: WIP ^_^ greeting = label: '' diff --git a/installer/default.nix b/installer/default.nix index dab9a585..ba884c22 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,8 +1,8 @@ # Build NixOS system -{ systemImage -, version, safeProductName, fullProductName -, kioskUrl, updateUrl -, squashfsCompressionOpts +{ squashfsCompressionOpts +, systemImage +# TODO: combine this into a single systemMetadata attrset that is defined in the top-level default.nix +, safeProductName, fullProductName, kioskUrl, updateUrl, version }: let nixpkgs = builtins.fetchTarball { @@ -20,19 +20,27 @@ let nixos = import "${nixpkgs}/nixos"; + systemMetadata = { + inherit safeProductName fullProductName kioskUrl updateUrl version; + }; + # Rescue system rescueSystem = pkgs.callPackage ./bootloader/rescue { - inherit nixos safeProductName fullProductName squashfsCompressionOpts; + inherit nixos squashfsCompressionOpts; + inherit systemMetadata; }; + # Installation script install-playos = pkgs.callPackage ./install-playos { grubCfg = ./bootloader/grub.cfg; - inherit kioskUrl updateUrl rescueSystem systemImage version; + inherit rescueSystem; + inherit systemImage systemMetadata; }; configuration = (import ./configuration.nix) { - inherit install-playos version safeProductName fullProductName squashfsCompressionOpts; + inherit install-playos squashfsCompressionOpts; + inherit systemMetadata; }; diff --git a/installer/install-playos/default.nix b/installer/install-playos/default.nix index 532b685f..8bddd18f 100644 --- a/installer/install-playos/default.nix +++ b/installer/install-playos/default.nix @@ -3,9 +3,7 @@ , systemImage , rescueSystem , grubCfg -, version -, updateUrl -, kioskUrl +, systemMetadata }: with pkgs; let @@ -14,11 +12,12 @@ let python = python3.withPackages(ps: with ps; [pyparted]); in stdenv.mkDerivation { - name = "install-playos-${version}"; + name = "install-playos-${systemMetadata.version}"; src = substituteAll { src = ./install-playos.py; - inherit grubCfg systemImage rescueSystem systemClosureInfo version updateUrl kioskUrl; + inherit grubCfg systemImage rescueSystem systemClosureInfo; + inherit (systemMetadata) version kioskUrl updateUrl; inherit python; }; From a4b26206a050d370cc83a4a41f4dab07c5a3d4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 15:13:31 +0200 Subject: [PATCH 08/12] Add TODOs on hard-coded paths that depend on skeleton --- base/self-update/default.nix | 2 ++ installer/pkgs/default.nix | 17 +++++++++++++++++ system-image/default.nix | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 installer/pkgs/default.nix diff --git a/base/self-update/default.nix b/base/self-update/default.nix index 759411c9..7c1d1afb 100644 --- a/base/self-update/default.nix +++ b/base/self-update/default.nix @@ -33,6 +33,8 @@ in }; environment.etc."rauc/system.conf" = { + # TODO: disk labels/paths and statusfile path should be supplied/defined + # by skeleton/installer text = '' [system] compatible=dividat-play-computer diff --git a/installer/pkgs/default.nix b/installer/pkgs/default.nix new file mode 100644 index 00000000..a8e867f0 --- /dev/null +++ b/installer/pkgs/default.nix @@ -0,0 +1,17 @@ +let + nixpkgs = builtins.fetchTarball { + # release-24.11 2025-02-10 + url = "https://github.com/NixOS/nixpkgs/archive/edd84e9bffdf1c0ceba05c0d868356f28a1eb7de.tar.gz"; + sha256 = "1gb61gahkq74hqiw8kbr9j0qwf2wlwnsvhb7z68zhm8wa27grqr0"; + }; + + overlay = + self: super: { + rauc = (import ./rauc) super; + + nixos = import "${nixpkgs}/nixos"; + }; +in +import nixpkgs { + overlays = [ overlay ]; +} diff --git a/system-image/default.nix b/system-image/default.nix index ca8d1302..27dab61a 100644 --- a/system-image/default.nix +++ b/system-image/default.nix @@ -16,6 +16,7 @@ let nixos = pkgs.importFromNixos ""; in ] ++ extraModules; # Storage + # TODO: should be defined by installer/skeleton config module fileSystems = { "/boot" = { device = "/dev/disk/by-label/ESP"; @@ -28,6 +29,7 @@ let nixos = pkgs.importFromNixos ""; in device = "/dev/root"; options = [ "ro" ]; }; + # TODO: should be defined by installer/skeleton config module persistentDataPartition.device = "/dev/disk/by-label/data"; }; From 0b878beaf8ab22af8a7a23de8b60f429acc3b59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 15:37:05 +0200 Subject: [PATCH 09/12] Add TODO with general plan regarding installer/ --- installer/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installer/default.nix b/installer/default.nix index ba884c22..eaf6de8b 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,4 +1,7 @@ -# Build NixOS system +# TODO: rename this to "skeleton" that exposes several components: +# - [ ] skeleton configuration params (partition labels, hard-coded paths like /boot/status.ini) +# - [x] the installer script (for e2e and release validation tests) +# - [x] the installer ISO { squashfsCompressionOpts , systemImage # TODO: combine this into a single systemMetadata attrset that is defined in the top-level default.nix From 91122057ae847fccb1e642fc6d0695e08ef440f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 16:23:08 +0200 Subject: [PATCH 10/12] Make installer pkgs re-usable and re-use RAUC with deps in system --- installer/default.nix | 20 ++++--------------- ...GRUB-primary-slot-to-allow-for-2-uns.patch | 0 installer/{ => pkgs}/rauc/default.nix | 0 pkgs/default.nix | 6 ++---- 4 files changed, 6 insertions(+), 20 deletions(-) rename installer/{ => pkgs}/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch (100%) rename installer/{ => pkgs}/rauc/default.nix (100%) diff --git a/installer/default.nix b/installer/default.nix index eaf6de8b..1e22e925 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -8,20 +8,7 @@ , safeProductName, fullProductName, kioskUrl, updateUrl, version }: let - nixpkgs = builtins.fetchTarball { - # release-24.11 2025-02-10 - url = "https://github.com/NixOS/nixpkgs/archive/edd84e9bffdf1c0ceba05c0d868356f28a1eb7de.tar.gz"; - sha256 = "1gb61gahkq74hqiw8kbr9j0qwf2wlwnsvhb7z68zhm8wa27grqr0"; - }; - - overlay = - self: super: { - rauc = (import ./rauc) super; - }; - - pkgs = import nixpkgs { overlays = [ overlay ]; }; - - nixos = import "${nixpkgs}/nixos"; + pkgs = import ./pkgs; systemMetadata = { inherit safeProductName fullProductName kioskUrl updateUrl version; @@ -29,7 +16,8 @@ let # Rescue system rescueSystem = pkgs.callPackage ./bootloader/rescue { - inherit nixos squashfsCompressionOpts; + inherit (pkgs) nixos; + inherit squashfsCompressionOpts; inherit systemMetadata; }; @@ -47,7 +35,7 @@ let }; - isoImage = (nixos { + isoImage = (pkgs.nixos { configuration = { imports = [ configuration ]; }; diff --git a/installer/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch b/installer/pkgs/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch similarity index 100% rename from installer/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch rename to installer/pkgs/rauc/0001-Adapt-notion-of-GRUB-primary-slot-to-allow-for-2-uns.patch diff --git a/installer/rauc/default.nix b/installer/pkgs/rauc/default.nix similarity index 100% rename from installer/rauc/default.nix rename to installer/pkgs/rauc/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index cac1982c..be2af8b5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,10 +13,8 @@ let importFromNixos = path: import (nixpkgs + "/nixos/" + path); - # TODO: replace with something along the lines of: - # rauc = (import ../installer/pkgs).rauc; - # to ensure 100% identical package and deps? - rauc = (import ../installer/rauc) super; + # use RAUC from installer/skeleton + rauc = (import ../installer/pkgs).rauc; ocamlPackages = super.ocamlPackages.overrideScope (self: super: { semver = self.callPackage ./ocaml-modules/semver {}; From dc92081eb0a81873503c5d51bca12b09376a48ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 16:34:29 +0200 Subject: [PATCH 11/12] TEST: downgrade installer nixpkgs to previous release Forcing divergence between system and installer / skeleton to check whether e2e tests pass and etc. --- installer/pkgs/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/pkgs/default.nix b/installer/pkgs/default.nix index a8e867f0..6aa30bb9 100644 --- a/installer/pkgs/default.nix +++ b/installer/pkgs/default.nix @@ -1,8 +1,8 @@ let nixpkgs = builtins.fetchTarball { - # release-24.11 2025-02-10 - url = "https://github.com/NixOS/nixpkgs/archive/edd84e9bffdf1c0ceba05c0d868356f28a1eb7de.tar.gz"; - sha256 = "1gb61gahkq74hqiw8kbr9j0qwf2wlwnsvhb7z68zhm8wa27grqr0"; + # nixos-24.05 2024-10-07 + url = "https://github.com/nixos/nixpkgs/archive/ecbc1ca8ffd6aea8372ad16be9ebbb39889e55b6.tar.gz"; + sha256 = "0yfaybsa30zx4bm900hgn3hz92javlf4d47ahdaxj9fai00ddc1x"; }; overlay = From 27d4d71b365e237da01c5988d45bdc8bbae59dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignas=20Vy=C5=A1niauskas?= Date: Thu, 5 Mar 2026 16:44:57 +0200 Subject: [PATCH 12/12] Fix: pass rescueSystem to disk A bit silly, since it is only needed for computing the size for /boot. Could (Should?) be hard-coded instead? --- default.nix | 6 +++++- installer/default.nix | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index c2b76276..b1e1a039 100644 --- a/default.nix +++ b/default.nix @@ -98,7 +98,11 @@ let testingToplevel = callPackage ./testing/system { application = application; }; # Disk image containing pre-installed system - disk = if diskBuildEnabled then callPackage ./testing/disk {} else null; + disk = + if diskBuildEnabled then + callPackage ./testing/disk { inherit (installer) install-playos rescueSystem; } + else + null; # Script for spinning up VMs run-in-vm = callPackage ./testing/run-in-vm {}; diff --git a/installer/default.nix b/installer/default.nix index 1e22e925..22740010 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,6 +1,7 @@ # TODO: rename this to "skeleton" that exposes several components: # - [ ] skeleton configuration params (partition labels, hard-coded paths like /boot/status.ini) # - [x] the installer script (for e2e and release validation tests) +# - [x] the rescueSystem (for e2e and release validation tests) # - [x] the installer ISO { squashfsCompressionOpts , systemImage @@ -43,5 +44,5 @@ let }).config.system.build.isoImage; in { - inherit install-playos isoImage; + inherit install-playos isoImage rescueSystem; }