Minimal dinit + Nix Linux system with per-user overlay stores. Renamed from DiNix, restructured flake architecture: - Distro flake = build tooling (lib.minixSystem, homeModules, disk images) - Machine flake = per-device config at /etc/minix/ (mutable, first-boot-only) - User HM config = independent, scaffolded via minix-home init Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77 lines
2.1 KiB
Nix
77 lines
2.1 KiB
Nix
{
|
|
description = "MiNix — minimal dinit + Nix Linux system";
|
|
|
|
inputs = {
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11";
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-25.11";
|
|
inputs.nixpkgs.follows = "nixpkgs-stable";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs-stable, nixpkgs-unstable, home-manager }:
|
|
let
|
|
system = "x86_64-linux";
|
|
|
|
# Clean pkgs without overlay — for build tools that don't go into the system
|
|
# (avoids cache misses from the systemd-stripping overlay on transitive deps)
|
|
hostPkgs = import nixpkgs-stable { system = "x86_64-linux"; };
|
|
|
|
minixSystem = import ./system/eval.nix { nixpkgs = nixpkgs-stable; };
|
|
|
|
# Evaluate the system configuration
|
|
systemConfig = minixSystem {
|
|
modules = [
|
|
./machines/qemu-vm/configuration.nix
|
|
# Install the machine flake to /etc/minix/ (mutable, first-boot-only).
|
|
# This is the flake that both root (minix-rebuild) and user (home-manager)
|
|
# evaluate on the end machine.
|
|
{ minix.machineFlake = ./machines/qemu-vm; }
|
|
];
|
|
};
|
|
|
|
pkgs = systemConfig.pkgs;
|
|
systemProfile = systemConfig.config.system.build.systemProfile;
|
|
diskImage = import ./image/disk.nix {
|
|
pkgs = hostPkgs;
|
|
inherit systemConfig systemProfile;
|
|
};
|
|
|
|
in {
|
|
# The minixSystem function — for external consumers
|
|
lib.minixSystem = minixSystem;
|
|
|
|
# Home Manager module for dinit user service integration.
|
|
# Machine flakes: modules = [ minix.homeModules.default ./home/user/home.nix ];
|
|
homeModules.default = ./system/modules/hm-dinit.nix;
|
|
|
|
packages.${system} = {
|
|
system = systemProfile;
|
|
vm = diskImage;
|
|
default = diskImage;
|
|
};
|
|
|
|
devShells.${system}.default = hostPkgs.mkShell {
|
|
packages = with hostPkgs; [
|
|
# VM
|
|
qemu_kvm
|
|
|
|
# Debugging initrd / disk images
|
|
cpio
|
|
gzip
|
|
file
|
|
binutils # readelf, objdump
|
|
strace
|
|
|
|
# General
|
|
coreutils
|
|
findutils
|
|
gnugrep
|
|
gawk
|
|
tree
|
|
jq
|
|
];
|
|
};
|
|
};
|
|
}
|