From 779d507d5a83d341e2f29c5fd9de7550440f1b5c Mon Sep 17 00:00:00 2001 From: Konstantin Shabanov Date: Fri, 24 Jul 2026 08:56:59 +0000 Subject: [PATCH 1/4] nix: Drop dead code --- flake.nix | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 27a262db1..6ecacbc69 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,7 @@ ... }: flake-parts.lib.mkFlake { inherit inputs; } ( - top@{ - config, - withSystem, - moduleWithSystem, + { ... }: { @@ -35,8 +32,6 @@ perSystem = { system, - lib, - inputs', ... }: let @@ -64,11 +59,6 @@ # Provides a script that copies required files to ~/ default = let - rustPlatform = pkgs.makeRustPlatform { - cargo = rust-bin; - rustc = rust-bin; - }; - podmanSetupScript = let registriesConf = pkgs.writeText "registries.conf" '' From 3bf4290802b67c3767a16beb83214e4f108898f9 Mon Sep 17 00:00:00 2001 From: Konstantin Shabanov Date: Mon, 20 Jul 2026 09:45:46 +0000 Subject: [PATCH 2/4] nix: Update flake inputs - Rename perl packages - Renape X11 deps --- flake.lock | 24 ++++++++++++------------ flake.nix | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index ab7e6a327..cf055a66a 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1763759067, - "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "lastModified": 1782949081, + "narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1763934636, - "narHash": "sha256-9glbI7f1uU+yzQCq5LwLgdZqx6svOhZWkd4JRY265fc=", + "lastModified": 1784494590, + "narHash": "sha256-Gn7vGw9aIyoJy7GkNbsHXvSkvXeNLoP9ZiK1RtS/0M8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ee09932cedcef15aaf476f9343d1dea2cb77e261", + "rev": "472e4428b5aee60be7ac35c03662ebb36c901edd", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1761765539, - "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "lastModified": 1782614948, + "narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c", "type": "github" }, "original": { @@ -63,11 +63,11 @@ ] }, "locked": { - "lastModified": 1784611586, - "narHash": "sha256-OfqgY+0hp/zseZB7uyH0U8kIDPS4scZZCyAurEplvG0=", + "lastModified": 1784526465, + "narHash": "sha256-L37teKC6oINWG4PGZLIqbphMWvSQ0PEz+aWxAk+rIDw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "14f58845249f3552a89b07772626b8d3c632fa86", + "rev": "58c6334db52d51fc5dd8877c90b01f00cf8a696b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6ecacbc69..0e6793f92 100644 --- a/flake.nix +++ b/flake.nix @@ -148,8 +148,8 @@ nasm ninja perl - perl540Packages.HTMLParser - perl540Packages.Po4a + perlPackages.HTMLParser + perlPackages.Po4a pkg-config pkgconf (python3.withPackages (ps: with ps; [ mako ])) @@ -173,8 +173,8 @@ libpng # netsurf fontconfig # orbutils SDL # prboom - xorg.utilmacros # libX11 - xorg.xtrans # libX11 + utilmacros # libX11 + xtrans # libX11 ]; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; From d48b58a9a2757da0f6c7feb3c41aca28598edf21 Mon Sep 17 00:00:00 2001 From: Konstantin Shabanov Date: Mon, 20 Jul 2026 10:20:21 +0000 Subject: [PATCH 3/4] nix: Get Rust version from rust-toolchain --- flake.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 0e6793f92..42f9a30ce 100644 --- a/flake.nix +++ b/flake.nix @@ -40,13 +40,7 @@ overlays = [ rust-overlay.overlays.default ]; }; - rust-bin = pkgs.rust-bin.nightly."2026-05-24".default.override { - extensions = [ - "rust-analyzer" - "rust-src" - ]; - targets = [ "x86_64-unknown-redox" ]; - }; + rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; in { formatter = pkgs.nixfmt-rfc-style; From ce274844fd42c8c41b577d8bf34aadedd131c36e Mon Sep 17 00:00:00 2001 From: Konstantin Shabanov Date: Wed, 22 Jul 2026 11:48:32 +0000 Subject: [PATCH 4/4] nix: Drop flake-parts --- flake.lock | 34 ------ flake.nix | 323 ++++++++++++++++++++++++++--------------------------- 2 files changed, 156 insertions(+), 201 deletions(-) diff --git a/flake.lock b/flake.lock index cf055a66a..ffbc8c9dc 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1782949081, - "narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1784494590, @@ -34,24 +16,8 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1782614948, - "narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, "root": { "inputs": { - "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" } diff --git a/flake.nix b/flake.nix index 42f9a30ce..7ff148ccf 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,6 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -11,177 +10,167 @@ }; outputs = - inputs@{ + { nixpkgs, - flake-parts, rust-overlay, ... }: - flake-parts.lib.mkFlake { inherit inputs; } ( - { - ... - }: - { - systems = [ - "i686-linux" - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - perSystem = - { - system, - ... - }: + let + systems = [ + "i686-linux" + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + overlays = [ rust-overlay.overlays.default ]; + + pkgsFor = + system: + import nixpkgs { + inherit system overlays; + }; + + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (pkgsFor system)); + in + { + formatter = forAllSystems (pkgs: pkgs.nixfmt-tree); + + # TODO: Create Redox OS Image as package + # TODO: No cross-compile for now, as there is no pkgsCross.aarch64-unknown-redox and so on + # TODO: Get rid of make env step: package custom libtool and setup rust toolchain properly + devShells = forAllSystems (pkgs: { + # Podman config taken from https://nixos.wiki/wiki/Podman and https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947 + # Provides a script that copies required files to ~/ + default = let - pkgs = import nixpkgs { - inherit system; - - overlays = [ rust-overlay.overlays.default ]; - }; - rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - in - { - formatter = pkgs.nixfmt-rfc-style; - - # TODO: Create Redox OS Image as package - # TODO: No cross-compile for now, as there is no pkgsCross.aarch64-unknown-redox and so on - # TODO: Get rid of make env step: package custom libtool and setup rust toolchain properly - devShells = { - # Podman config taken from https://nixos.wiki/wiki/Podman and https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947 - # Provides a script that copies required files to ~/ - default = - let - podmanSetupScript = - let - registriesConf = pkgs.writeText "registries.conf" '' - [registries.search] - registries = ['docker.io'] - [registries.block] - registries = [] - ''; - in - pkgs.writeScript "podman-setup" '' - #!${pkgs.runtimeShell} - # Dont overwrite customised configuration - if ! test -f ~/.config/containers/policy.json; then - install -Dm555 ${pkgs.skopeo.src}/default-policy.json ~/.config/containers/policy.json - fi - if ! test -f ~/.config/containers/registries.conf; then - install -Dm555 ${registriesConf} ~/.config/containers/registries.conf - fi - systemctl --user start podman.socket || true - export PODMAN_SYSTEMD_UNIT=podman.socket - ''; - # Provides a fake "docker" binary mapping to podman - dockerCompat = pkgs.runCommand "docker-podman-compat" { } '' - mkdir -p $out/bin - ln -s ${pkgs.podman}/bin/podman $out/bin/docker - ''; - - in - pkgs.mkShell rec { - buildInputs = with pkgs; [ - # Podman - dockerCompat - podman # Docker compat - runc # Container runtime - conmon # Container runtime monitor - skopeo # Interact with container registry - slirp4netns # User-mode networking for unprivileged namespaces - fuse-overlayfs # CoW for images, much faster than default vfs - - # with FSTOOLS_IN_PODMAN=1 these are not needed - # without it, the installer fails to link FUSE somehow - #fuse - #rust-bin - qemu_kvm - ]; - - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; - SKIP_CHECK_TOOLS = "1"; - FSTOOLS_IN_PODMAN = "1"; - PODMAN_BUILD = "1"; - shellHook = '' - # Install required configuration - ${podmanSetupScript} - echo "Redox podman build environment loaded" - ''; - }; - - #TODO: This isn't tested yet, use at your own risk - native = pkgs.mkShell rec { - nativeBuildInputs = - let - autoreconf269 = pkgs.writeShellScriptBin "autoreconf2.69" "${pkgs.autoconf269}/bin/autoreconf"; - in - with pkgs; - [ - ant - autoconf - autoreconf269 # gnu-binutils - automake - bison - cmake - curl - doxygen - file - flex - gettext - gnumake - gnupatch - gperf - help2man - just - llvmPackages.clang - llvmPackages.llvm - lua - m4 - meson - nasm - ninja - perl - perlPackages.HTMLParser - perlPackages.Po4a - pkg-config - pkgconf - (python3.withPackages (ps: with ps; [ mako ])) - qemu_kvm - rust-cbindgen - scons - texinfo - unzip - waf - wget - xdg-utils - xxd - zip - ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86 [ - pkgs.syslinux - ]; - - buildInputs = with pkgs; [ - rust-bin - fuse # fuser - libpng # netsurf - fontconfig # orbutils - SDL # prboom - utilmacros # libX11 - xtrans # libX11 - ]; - - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; - PERL_PATH = "${pkgs.perl}/bin/perl"; - SKIP_CHECK_TOOLS = "1"; - PODMAN_BUILD = "0"; - shellHook = with pkgs; '' - export PKG_CONFIG_PATH="${fuse.dev}/lib/pkgconfig\ - :${libpng.dev}/lib/pkgconfig" + podmanSetupScript = + let + registriesConf = pkgs.writeText "registries.conf" '' + [registries.search] + registries = ['docker.io'] + [registries.block] + registries = [] ''; - }; - }; + in + pkgs.writeScript "podman-setup" '' + #!${pkgs.runtimeShell} + # Dont overwrite customised configuration + if ! test -f ~/.config/containers/policy.json; then + install -Dm555 ${pkgs.skopeo.src}/default-policy.json ~/.config/containers/policy.json + fi + if ! test -f ~/.config/containers/registries.conf; then + install -Dm555 ${registriesConf} ~/.config/containers/registries.conf + fi + systemctl --user start podman.socket || true + export PODMAN_SYSTEMD_UNIT=podman.socket + ''; + # Provides a fake "docker" binary mapping to podman + dockerCompat = pkgs.runCommand "docker-podman-compat" { } '' + mkdir -p $out/bin + ln -s ${pkgs.podman}/bin/podman $out/bin/docker + ''; + in + pkgs.mkShell rec { + buildInputs = with pkgs; [ + # Podman + dockerCompat + podman # Docker compat + runc # Container runtime + conmon # Container runtime monitor + skopeo # Interact with container registry + slirp4netns # User-mode networking for unprivileged namespaces + fuse-overlayfs # CoW for images, much faster than default vfs + + # with FSTOOLS_IN_PODMAN=1 these are not needed + # without it, the installer fails to link FUSE somehow + #fuse + qemu_kvm + ]; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; + SKIP_CHECK_TOOLS = "1"; + FSTOOLS_IN_PODMAN = "1"; + PODMAN_BUILD = "1"; + shellHook = '' + # Install required configuration + ${podmanSetupScript} + echo "Redox podman build environment loaded" + ''; }; - } - ); + + #TODO: This isn't tested yet, use at your own risk + native = pkgs.mkShell rec { + nativeBuildInputs = + let + autoreconf269 = pkgs.writeShellScriptBin "autoreconf2.69" "${pkgs.autoconf269}/bin/autoreconf"; + in + with pkgs; + [ + ant + autoconf + autoreconf269 # gnu-binutils + automake + bison + cmake + curl + doxygen + file + flex + gettext + gnumake + gnupatch + gperf + help2man + just + llvmPackages.clang + llvmPackages.llvm + lua + m4 + meson + nasm + ninja + perl + perlPackages.HTMLParser + perlPackages.Po4a + pkg-config + pkgconf + (python3.withPackages (ps: with ps; [ mako ])) + qemu_kvm + rust-cbindgen + scons + texinfo + unzip + waf + wget + xdg-utils + xxd + zip + ] + ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86 [ + pkgs.syslinux + ]; + + buildInputs = with pkgs; [ + (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml) + fuse # fuser + libpng # netsurf + fontconfig # orbutils + SDL # prboom + utilmacros # libX11 + xtrans # libX11 + ]; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; + PERL_PATH = "${pkgs.perl}/bin/perl"; + SKIP_CHECK_TOOLS = "1"; + PODMAN_BUILD = "0"; + shellHook = with pkgs; '' + export PKG_CONFIG_PATH="${fuse.dev}/lib/pkgconfig\ + :${libpng.dev}/lib/pkgconfig" + ''; + }; + }); + }; }