Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support/test-iso: Init expressions to build a test ISO #142

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions support/test-iso/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Jovian NixOS Test ISO
=====================

> **NOTE**: This is not for installing. This is not for daily driving. This is a development aid to start from a fresh new environment for OOBE issues.
25 changes: 25 additions & 0 deletions support/test-iso/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ config, pkgs, modulesPath, ... }:

{
imports = [
(modulesPath + "/installer/cd-dvd/iso-image.nix")
(modulesPath + "/profiles/all-hardware.nix")
./jovian.nix
./tty.nix
./user.nix
];

config = {
isoImage.isoBaseName = "Jovian-NixOS-FOR-TESTING-ONLY";
isoImage.makeEfiBootable = true;
isoImage.makeUsbBootable = true;
isoImage.squashfsCompression = "zstd -Xcompression-level 15";
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";

hardware.enableRedistributableFirmware = true;
nixpkgs.config.allowUnfree = true;

# NOTE: this is an insecure system, but it's also FOR TESTING ONLY.
services.openssh.enable = true;
};
}
14 changes: 14 additions & 0 deletions support/test-iso/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ pkgs ? import <nixpkgs> {} }:

let
nixos = import "${pkgs.path}/nixos";
eval = nixos {
configuration = {
imports = [
./configuration.nix
];
};
};
in
with eval;
config.system.build.isoImage
17 changes: 17 additions & 0 deletions support/test-iso/jovian.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
imports = [
../../modules
];

jovian = {
devices.steamdeck = {
enable = true;
};
steam = {
enable = true;
autoStart = true;
user = "deck";
};
};
networking.networkmanager.enable = true;
}
5 changes: 5 additions & 0 deletions support/test-iso/tty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ config, lib, pkgs, ... }:

{
services.getty.autologinUser = config.jovian.steam.user;
}
21 changes: 21 additions & 0 deletions support/test-iso/user.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ config, pkgs, ... }:

{
users.users = {
"${config.jovian.steam.user}" = {
isNormalUser = true;
uid = 1000;
extraGroups = [
"audio"
"networkmanager"
"video"
"wheel"
];
initialHashedPassword = "TEST_PASSWORD_DO_NOT_USE";
};
root = {
initialHashedPassword = "TEST_PASSWORD_DO_NOT_USE";
};
};
security.sudo.wheelNeedsPassword = false;
}