Compare commits

..

1 commit

7 changed files with 25 additions and 61 deletions

View file

@ -1,5 +1,4 @@
{ ... }:
{
{ ... }: {
imports = [
./modules/system_overrides.nix
./modules/minimize.nix
@ -8,6 +7,5 @@
./modules/partitions.nix
./modules/network.nix
./modules/sysupdate.nix
./modules/utils.nix
];
}

View file

@ -14,7 +14,3 @@ build: build-image
# Build PatOS image
build-image:
nix build .#patos_image
run: build-image
qemu-efi -hda ./result/disk.qcow2

View file

@ -1,24 +1,13 @@
{
pkgs,
config,
lib,
...
}:
{
{ pkgs, config, ... }: {
boot = {
uki.name = "patos";
kernelParams = [ "console=ttyS0" ];
initrd.systemd.enable = true;
};
boot.uki.name = "patos";
boot.kernelParams = [ "console=ttyS0" ];
system.nixos = {
codeName = "Finn";
distroId = "patos";
distroName = "PatOS";
release = "2024-09";
};
system.nixos.release = "2024-09";
system.nixos.codeName = "Finn";
system.nixos.distroId = "patos";
system.nixos.distroName = "PatOS";
system.image.version = "0.0.1"; # FIXME: Use epoch version.
# Make the current system version visible in the prompt.
@ -31,6 +20,8 @@
services.getty.autologinUser = "root";
boot.initrd.systemd.enable = true;
# Don't accumulate crap.
boot.tmp.cleanOnBoot = true;
services.journald.extraConfig = ''

View file

@ -1,10 +1,8 @@
{ modulesPath, ... }:
{
{ modulesPath, ... }: {
imports = [
"${modulesPath}/profiles/minimal.nix"
];
boot.enableContainers = false;
boot.loader.grub.enable = false;
system.switch.enable = false;
@ -16,5 +14,6 @@
system.disableInstallerTools = true;
programs.less.lessopen = null;
programs.command-not-found.enable = false;
boot.enableContainers = false;
environment.defaultPackages = [ ];
}

View file

@ -1,11 +1,4 @@
{
config,
pkgs,
lib,
modulesPath,
...
}:
{
{ config, pkgs, lib, modulesPath, ... }: {
imports = [
"${modulesPath}/image/repart.nix"
@ -22,16 +15,16 @@
partitions = {
"esp" = {
contents = {
"/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source = "${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi";
"/EFI/BOOT/BOOT${lib.toUpper efiArch}.EFI".source =
"${pkgs.systemd}/lib/systemd/boot/efi/systemd-boot${efiArch}.efi";
"/EFI/Linux/${config.system.boot.loader.ukiFile}".source = "${config.system.build.uki}/${config.system.boot.loader.ukiFile}";
"/EFI/Linux/${config.system.boot.loader.ukiFile}".source =
"${config.system.build.uki}/${config.system.boot.loader.ukiFile}";
# systemd-boot configuration
"/loader/loader.conf".source = (
pkgs.writeText "$out" ''
timeout 3
''
);
"/loader/loader.conf".source = (pkgs.writeText "$out" ''
timeout 3
'');
};
repartConfig = {
Type = "esp";
@ -46,7 +39,7 @@
stripNixStorePrefix = true;
repartConfig = {
Type = "linux-generic";
Label = "${config.boot.uki.name}_${config.system.image.version}";
Label = "store_${config.system.image.version}";
Format = "squashfs";
Minimize = "off";
ReadOnly = "yes";

View file

@ -37,7 +37,9 @@ in
"${config.boot.uki.name}_@v.efi.xz"
];
Path = "https://images.dl.patagia.dev/patos/";
# We could fetch updates from the network as well:
#
Path = "https://images.dl.patagia.dev/";
Type = "url-file";
};
Target = {
@ -62,7 +64,7 @@ in
MatchPattern = [
"${config.boot.uki.name}_@v.img.xz"
];
Path = "https://images.dl.patagia.dev/patos/";
Path = "https://images.dl.patagia.dev/";
Type = "url-file";
};

View file

@ -1,15 +0,0 @@
{
config,
pkgs,
lib,
...
}:
let
script = pkgs.writeShellScriptBin "patos-upgrade.sh" ''
systemd-sysupdate --verify=no
systemd-sysupdate --verify=no update --reboot
'';
in
{
environment.systemPackages = [ script ];
}