From 06293bfbb5082dc636358d49f3e6fea88c4f2a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 25 Oct 2022 16:45:13 +0200 Subject: Try to rework minimal system --- lib/default.nix | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'lib/default.nix') diff --git a/lib/default.nix b/lib/default.nix index 1136741..1211cf9 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -19,25 +19,32 @@ modules ? [], override ? {} }: nixpkgs.lib.nixosSystem ({ - system = boardSystem.${board}.system; modules = [ self.nixosModules.default - { turris.board = board; } + { + nixpkgs.system = boardSystem.${board}.system; + turris.board = board; + } ] ++ modules; } // override); # The minimalized system to decrease amount of ram needed for rebuild - # TODO this does not work right now as it requires just load of work to do + # TODO this does not work right now as it requires just load of work to do. + # The nix-daemon pulls in xserver and the result is that pretty much + # everything has to be included in such case. nixturrisMinSystem = { - nixpkgs, + board, + nixpkgs ? nixpkgsDefault, modules ? [], - ... - } @args: self.lib.nixturrisSystem (args // { - nixpkgs = nixpkgs; - modules = modules ++ [ ../nixos/nixos-modules-minfake.nix ]; - override = { - baseModules = import ../nixos/nixos-modules.nix nixpkgs; - }; - }); + override ? {} + }:nixpkgs.lib.nixos.evalModules ({ + modules = (map (v: nixpkgs.outPath + "/nixos/modules" + v) (import ./nixos-min-modules.nix)) ++ [ + self.nixosModules.default + { + nixpkgs.system = boardSystem.${board}.system; + turris.board = board; + } + ] ++ modules; + } // override); } -- cgit v1.2.3