Using NixOS for Exam Computers
I used NixOS to define two exam computers for a programming exam.
- One in a presentation room with an examiner and a censor, connected to a projector.
- Another one in an adjacent preparation room, just connected to the internet.
Both had identical GNOME-based UIs, the same development environments, and the same set of system users. The presentation computer needed screen mirroring to the projector and some method of syncing the files from the preparation computer. The passwords were simplistically derived from usernames to avoid another thing I need to distribute. Both computers needed various exam task descriptions.
The Scene: Live-coding exams with preparation
If you’re just looking for Nix code, you can skip this section.
I have used NixOS as my primary Linux distro for three years.
I have also been teaching Computer Science for almost two years.
Most recently I inherited two elective courses with some rather peculiar exam structures. One of them was a course called “Low Level C” and was originally a course focusing on low-levelness in several ways, including C on embedded MCUs.
The teacher who had defined them, Peter Lind, was quite experimental, and taking over his courses I learned a lot from his evaluations of the course and exam structures. For example, with only 3.5 hours of classroom activity per week and low out-of-class activity, soldering was not a good learning goal. So it’s better to focus on low-levelness in the sense of bitwise manipulation, memory management, assembly programming, pointer arithmetic, and so on.
I’ll focus on the exam here, though: 20 minutes of individual oral examination (live-coding, conversation) with 20 minutes of preparation, “all aids are permitted”. One programming task and one theoretical subject for discussion. I’ll explain why those two conditions are problematic separate and in combination:
-
20 minutes of preparation makes execution difficult: You need to book two rooms next to each other, and you need to cycle between the rooms in lockstep, having one student in prep while another is presenting.
Without preparation you can catch up for lost time by shortening the voting time between students, but with prep and presentation working in lockstep you can almost only lose time. Some students are granted extra time during exam because of handicaps or other special conditions.
Moving students computers between rooms steals several minutes every time, connecting and disconnecting chargers when batteries are sub-optimal, and constantly struggling with HDMI cables.
-
All aids being permitted speaks, of course, of the elephant in the room: AI. AI in programming comes in two shapes for students in 2024-2026: Copy-pasting from ChatGPT, and using IntelliJ auto-completion, which will let you just hit Enter to complete what’s probably the program you want.
Computer Science students at business academy level in Denmark still don’t use agentic coding (Claude Code, GitHub Copilot, Codex CLI, Cursor, etc.) Presumably because many of them cost money or they’re just not explorative.
Aids also means notes which today are always on the student’s own computer. So they’re technically allowed to bring their own computer, since all aids are permitted.
-
Preparation + allowing AI means students can essentially code up a finished solution to any problem you give them. Allowing them to prepare doesn’t really matter that much, it gives them a chance to “warm up”, but however far they get, they’ll just continue to live-code from there.
So really, starting from scratch is probably easier, since they’ll show more scaffolding (creation of files and filling out basic structure) than advanced refactoring. Preparing helps to overcome some uninteresting scaffolding.
Asking students to live-code during their presentation reveals their actual skills. There really is no problem in assessing a student’s programming ability as long as you watch them do it. But you need to ask them to disable certain amounts of auto-completion, and those might have hindered their learning during the entire semester without you knowing it.
The Idea: Control the Environment
Every Computer Science exam at EK is more or less the same: Student comes in, draws a subject at random from a known set of subjects, and live-demonstrates capability and knowledge within that subject, examiners vote and give the student a grade. Some variation occurs, but that’s the most common template.
When my censors heard of my format, their immediate thought is: We must limit their access to AI.
And this setup does allow that, since you can restrict the computer in a way that you cannot restrict internet access in modern environment: Preventing hot spots from appearing, and monitoring if students are connected, and if so, what they are connected to, is Sisyphean.
But since all aids are allowed, that’s not the actual purpose: The purpose is to minimize waiting when switching between students. In practice I did save some time. Students did bring their computer to the preparation for notes and AI access. They could have used AI on the exam computer, but authenticating steals precious minutes.
The Execution: Preconfigured NixOS Machines
Let’s get schwifty!
I borrowed 2 Lenovo ThinkPads from the school’s IT department and proceded to install NixOS on them using the graphical NixOS installer flashed to a USB stick. I really wanted to experiment with custom USB installers, enabling flakes by default, and syncing the shared components remotely.
But I had one day to execute, and I only needed to do this twice. So I opted for another bootstrap process, since it was the fastest for me and gave credibility to this blog post: How do you actually do this from scratch without having already done it?
I picked GNOME as the Desktop Environment and simply wiped the disk. My only interaction with Microsoft Windows is deleting its partition table once in a while, but it still brings me pleasure every time.
Here are some quick design goals:
- TODO: Summarize these.
Here are some snippets:
- TODO: Collect these.
The Evaluation: Would I do it again?
- TODO: Yeah! But when would it make sense?