summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Parri <simonparri@ganzeria.com>2025-05-27 22:02:57 -0500
committerSimon Parri <simonparri@ganzeria.com>2025-05-29 17:00:04 -0500
commit66755e8a78211ed38c8d6b282d5221d97f0fe664 (patch)
treeff4b3bb83c8c2ef061050f82bed8fcb41d5cef51
parent6c1ee2e94f7e3fb2b13732208118f798805f45c4 (diff)
downloadnixos-config-66755e8a78211ed38c8d6b282d5221d97f0fe664.tar.gz
nixos-config-66755e8a78211ed38c8d6b282d5221d97f0fe664.zip
hosts/ades: Add initial version of live ISO with ades' configuration
-rw-r--r--flake.nix3
-rw-r--r--hosts/ades/common.nix3
-rw-r--r--hosts/ades/default.nix11
-rw-r--r--hosts/ades/iso.nix70
-rw-r--r--hosts/ades/thin-shim.nix41
5 files changed, 124 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index 135bce7..8f75eb6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -22,5 +22,8 @@
self.nixosConfigurations.
muspell.config.mobile.
outputs.u-boot.disk-image;
+ ades-live-iso =
+ self.nixosConfigurations.
+ ades-live.config.system.build.isoImage;
};
}
diff --git a/hosts/ades/common.nix b/hosts/ades/common.nix
index b88a6cb..d31f380 100644
--- a/hosts/ades/common.nix
+++ b/hosts/ades/common.nix
@@ -7,7 +7,6 @@ in
{
imports = [
./hardware.nix
- ./users.nix
];
this.pc.enable = true;
@@ -34,7 +33,7 @@ in
sil-q
ppsspp
wesnoth
- minetest
+ luanti
gzdoom
teeworlds
superTuxKart
diff --git a/hosts/ades/default.nix b/hosts/ades/default.nix
index 8f3f4e6..82496c1 100644
--- a/hosts/ades/default.nix
+++ b/hosts/ades/default.nix
@@ -7,7 +7,8 @@ let
in
mergeAttrsList
((map (h: mkHost "x86_64-linux" h
- [ ./common.nix ])
+ [ ./common.nix
+ ./users.nix ])
[
"acheron"
"asphodel"
@@ -20,7 +21,13 @@ mergeAttrsList
])
++
(map (h: mkHost "x86_64-linux" h
- [ ./common.nix ./${h}.nix ])
+ [ ./common.nix
+ ./users.nix
+ ./${h}.nix ])
[
"styx"
]))
+// mkHost "x86_64-linux" "ades-live" [
+ ./common.nix
+ ./iso.nix
+]
diff --git a/hosts/ades/iso.nix b/hosts/ades/iso.nix
new file mode 100644
index 0000000..63c48d9
--- /dev/null
+++ b/hosts/ades/iso.nix
@@ -0,0 +1,70 @@
+{ modulesPath, lib, config, pkgs, ... }:
+
+let
+ inherit (lib.attrsets)
+ mergeAttrsList;
+ inherit (builtins)
+ map;
+
+ shimmedPackages = [
+ "wesnoth"
+ "luanti"
+ "supertuxkart"
+ "mindustry"
+ "shattered-pixel-dungeon"
+ "bzflag"
+ "xonotic-glx"
+ "taisei"
+ "unvanquished"
+ ];
+
+ mkThinShim = import ./thin-shim.nix pkgs;
+in
+rec {
+ imports = [
+ (modulesPath + "/profiles/all-hardware.nix")
+ (modulesPath + "/installer/cd-dvd/iso-image.nix")
+ ];
+
+ isoImage = {
+ makeBiosBootable = true;
+ makeEfiBootable = true;
+ makeUsbBootable = true;
+
+ isoBaseName = lib.mkImageMediaOverride "nixos-styx";
+ };
+
+ swapDevices = lib.mkImageMediaOverride [];
+ fileSystems = lib.mkImageMediaOverride config.lib.isoFileSystems;
+
+ users.users.ades = {
+ description = "Ades";
+ isNormalUser = true;
+ homeMode = "755";
+ extraGroups = [
+ "disk" "cdrom"
+ "audio" "video"
+ "lp" "networkmanager"
+ ];
+ initialPassword = "persephone";
+ };
+ users.users.root.initialPassword = "olympus";
+
+ services.getty.autologinUser = "ades";
+ services.getty.helpLine = ''
+ As you can see, you are automatically logged in to the "ades" user.
+ Run `startx' to obtain a graphical session.
+
+ The password for the "ades" user is: ${users.users.ades.initialPassword}
+ The password for the "root" user is: ${users.users.root.initialPassword}
+ '';
+
+ nixpkgs.overlays = [
+ (final: prev:
+ mergeAttrsList
+ (map (pname: {
+ "${pname}" = (mkThinShim prev.${pname} "nixpkgs#${pname}");
+ })
+ shimmedPackages))
+ ];
+}
diff --git a/hosts/ades/thin-shim.nix b/hosts/ades/thin-shim.nix
new file mode 100644
index 0000000..a9f931b
--- /dev/null
+++ b/hosts/ades/thin-shim.nix
@@ -0,0 +1,41 @@
+pkgs:
+let
+ inherit (builtins)
+ map elem;
+
+ inherit (pkgs) stdenv;
+in
+pkg: inst:
+stdenv.mkDerivation {
+ pname = pkg.pname + "-shim";
+ version = pkg.version;
+ nativeBuildInputs = [pkg];
+ dontUnpack = true;
+ buildPhase = ''
+if [ -d ${pkg}/bin ]; then
+ mkdir -p "$out/bin"
+ for exe in $(ls "${pkg}/bin/"); do
+ cat >"$out/bin/$exe" <<EOF
+#!/bin/sh
+
+term=urxvt
+which \$term >/dev/null 2>&1 || term=xterm
+
+if [ "\$DISPLAY" ]; then
+ \$term -e nix shell '${inst}' --command '$exe' \$*
+else
+ nix shell '${inst}' --command '$exe' \$*
+fi
+EOF
+ chmod +x "$out/bin/$exe"
+ done
+fi
+
+for dir in "share/applications" "share/icons"; do
+ if [ -d "${pkg}/$dir" ]; then
+ mkdir -p "$out/$dir"
+ cp -a "${pkg}/$dir/"* "$out/$dir"
+ fi
+done
+'';
+}