1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-26 01:13:37 +03:00

Adds an installer output...

This commit is contained in:
Samuel Dionne-Riel 2019-09-21 22:45:41 -04:00
parent 683ce12eb7
commit a9f4c851cc
2 changed files with 36 additions and 0 deletions

View File

@ -26,6 +26,11 @@ let
# Eval with `local.nix` if available.
# This eval is the "WIP" eval. What's usually built with `nix-build`.
eval = evalWith (optional (builtins.pathExists ./local.nix) (import (./local.nix )));
# This is used by the `-A installer` shortcut.
installer-eval = evalWith [
./profiles/installer.nix
];
in
{
# The build artifacts from the modules system.
@ -45,6 +50,10 @@ in
# Any time `nix-build nixos` is used upstream, it can be used here.
nixos = import <nixpkgs/nixos>;
# `mobile-installer` will, when possible, contain the installer build for the
# given system. It usually is an alias for a disk-image type build.
installer = installer-eval.config.system.build.mobile-installer;
# Evaluating this whole set is counter-productive.
# It'll put a *bunch* of build products from the misc. inherits we added.
@ -58,6 +67,9 @@ in
Building this whole set is counter-productive, and not likely to be what
is desired.
You can try to build the `installer` attribute (-A installer) if your system
provides an installer.
Please refer to your platform's documentation for usage.
'';
}

24
profiles/installer.nix Normal file
View File

@ -0,0 +1,24 @@
{ config, lib, pkgs, ... }:
let
ifSystem = type: lib.mkIf (config.mobile.system.type == type);
in
{
imports = [
<nixpkgs/nixos/modules/profiles/installation-device.nix>
];
config = lib.mkMerge [
{
# This seems counter-intuitive to me, but networkmanager requires that
# this is set to false.
networking.wireless.enable = false;
networking.networkmanager.enable = true;
}
(ifSystem "depthcharge" {
environment.systemPackages = with pkgs; [
vboot_reference
];
})
];
}