Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ programs.linuxfiles = {
};
```

This installs a patched helper, a matching polkit action and trusted deployment manifest, and enables the pkexec wrapper. A session authentication agent is required. The flake still pins alpha2 and rejects this opt-in through a runtime-capability assertion. Alpha3 contains the runtime support, but root file operations require a follow-up flake update with the published alpha3 assets, hashes and compatible-runtime marker. See [Nix packaging details](../docs/linux-port/packaging.md#nix-flake).
This installs a patched helper, a matching polkit action and trusted deployment manifest, and enables the pkexec wrapper. A session authentication agent is required. The flake pins alpha3, which supports this opt-in. A runtime-capability assertion rejects incompatible or unmarked package overrides. See [Nix packaging details](../docs/linux-port/packaging.md#nix-flake).

### AppImage

Expand Down
6 changes: 3 additions & 3 deletions docs/linux-port/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ First used for `linux-v0.1.0-alpha1` (prerelease; install instructions are in `.

`flake.nix` (with `flake.lock`, pinned to `nixos-unstable`) exposes `packages.x86_64-linux.{linuxfiles,default}`, `apps.x86_64-linux.default`, `overlays.default` (adds `pkgs.linuxfiles`), and `nixosModules.default`. The package repackages the pinned release tarballs, patches all ELF files with `autoPatchelfHook` (including the retained Native AOT helper), and installs the app under `$out/lib/linuxfiles`. Runtime dlopen libraries are added to ELF runpaths rather than the launch environment, so child programs do not inherit Nix libraries. The unused CoreCLR LTTng tracing provider remains exempt from dependency checking.

Plain `nix run` and `nix profile install` retain `.root-actions-disabled`: all root actions remain off. Installing a profile cannot activate host polkit. NixOS administrators may opt in through their configuration flake once a compatible runtime is packaged (the current alpha2 pin rejects this opt-in):
Plain `nix run` and `nix profile install` retain `.root-actions-disabled`: all root actions remain off. Installing a profile cannot activate host polkit. NixOS administrators may opt in through their configuration flake with the compatible alpha3 runtime:

```nix
# inputs.linuxfiles.url = "github:MemerGamer/LinuxFiles";
Expand All @@ -166,7 +166,7 @@ The module selects the package's `enableRootActions` variant, removes its disabl

`pkexec` uses `/run/wrappers/bin` before the system profile and `/usr/bin`/`/bin`. The module enables `security.polkit.enablePkexecWrapper` when present; older nixpkgs uses `security.wrappers.pkexec`. Only pkexec is setuid, never the LinuxFiles helper. A session authentication agent and an administrator identity are still required. The narrow store exception accepts a root-owned sticky `/nix/store` with group write (1775), but rejects other write there, non-root ownership, and any writable entries beneath it. Native `/usr` helper/policy checks retain their existing restrictions.

**Release integration:** the current pin is still `0.1.0-alpha2`, whose app predates deployment-manifest and Nix elevation-wrapper discovery. Its `passthru.supportsNixRootActions` marker is false, so the module rejects `rootActions = true` with an assertion. Packages without the marker are also rejected. Keep root actions disabled until a native release containing both runtime changes is published; update the version/hashes below and set the package marker to true only for that compatible release.
**Release integration:** the current pin is `0.1.0-alpha3`, which includes deployment-manifest and Nix elevation-wrapper discovery. Its `passthru.supportsNixRootActions` marker is true, so the module accepts `rootActions = true`. Overrides with a false or missing marker are still rejected by the runtime-capability assertion. For future releases, verify that both runtime changes are present before retaining the compatible-runtime marker.

Per release (after CI has attached `SHA256SUMS`; the flake's tag is `linux-v<version>`):

Expand All @@ -177,7 +177,7 @@ scripts/linux/update-nix-flake.sh X.Y.Z[-pre] SHA256SUMS # rewrites version +

Commit `flake.nix` in a PR. It is deliberately not a CI step: the hashes only exist after the release job has uploaded the assets, and `main` takes changes through PRs. Run `nix flake update` separately to bump nixpkgs.

The earlier plain package passed `nix flake check --no-build` and `nix build` with nix-portable. The `checks.x86_64-linux.root-actions-module` check covers rejection of the incompatible pin and packages without the capability marker, opt-out defaults, and a marked fixture for compatible-runtime module wiring. When built, it also checks helper presence, marker state, and the generated policy path; the fixture does not establish alpha2 runtime compatibility. Re-run `nix flake check` against the locked revision after the release bump; sandboxed DNS failures cannot establish NixOS evaluation or packaged loader startup. See the headless checklist below.
The earlier plain package passed `nix flake check --no-build` and `nix build` with nix-portable. The `checks.x86_64-linux.root-actions-module` check covers rejection of packages with a false or missing capability marker, opt-out defaults, and compatible-runtime module wiring using the pinned alpha3 package. When built, it also checks helper presence, marker state, and the generated policy path. Re-run `nix flake check` against the locked revision after the release bump; sandboxed DNS failures cannot establish NixOS evaluation or packaged loader startup. See the headless checklist below.

## Nightly builds

Expand Down
20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
, icu, openssl, zlib, krb5, glib, enableRootActions ? false }:
let
# version and both hashes are rewritten by scripts/linux/update-nix-flake.sh
version = "0.1.0-alpha2";
version = "0.1.0-alpha3";
base = "https://github.com/MemerGamer/LinuxFiles/releases/download/linux-v${version}";
app = fetchurl {
url = "${base}/files-linux-x64.tar.gz";
hash = "sha256-f6zBuMzd3mb0tDnMVtcBz9RXlNvQcjKlBVcRwMpIbbc=";
hash = "sha256-4AsvaWZC4Mg/11XnG5ggRCz/pNFzvJzfSwjl/s2IG5A=";
};
packaging = fetchurl {
url = "${base}/files-packaging.tar.gz";
hash = "sha256-QhBF4IhA4+y+6ZslPTYWt0xJGot/KjoZgKDoVVo5u60=";
hash = "sha256-POB/aZzXxXhs5GGuHAfGwPQ+OLLMz/6VEOKs8se/kUE=";
};
# Opened with dlopen at runtime, so autoPatchelf cannot discover them; added to every ELF file's runpath.
runtimeLibs = [
Expand All @@ -37,8 +37,8 @@
stdenv.mkDerivation {
pname = "linuxfiles";
inherit version;
# Set true only after pinning a release with NixOS helper/tool discovery.
passthru.supportsNixRootActions = false;
# Alpha3 includes NixOS deployment-manifest and elevation-wrapper discovery.
passthru.supportsNixRootActions = true;

dontUnpack = true;
dontConfigure = true;
Expand Down Expand Up @@ -122,7 +122,7 @@
environment.systemPackages = [ package ];
assertions = [{
assertion = !cfg.rootActions || (package.passthru.supportsNixRootActions or false);
message = "programs.linuxfiles.rootActions requires a runtime with NixOS deployment-manifest and elevation-wrapper discovery (passthru.supportsNixRootActions = true). Disable rootActions or select a compatible package; the pinned alpha2 release is incompatible.";
message = "programs.linuxfiles.rootActions requires a runtime with NixOS deployment-manifest and elevation-wrapper discovery (passthru.supportsNixRootActions = true). Disable rootActions or select a compatible package.";
}];
}
(lib.mkIf cfg.rootActions (lib.mkMerge [
Expand All @@ -147,15 +147,15 @@

checks.${system}.root-actions-module =
let
# This fixture checks module/layout wiring, not the pinned runtime's capabilities.
compatible = self.packages.${system}.linuxfiles.overrideAttrs (old: {
passthru = (old.passthru or { }) // { supportsNixRootActions = true; };
});
compatible = self.packages.${system}.linuxfiles;
unsupported = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ self.nixosModules.default {
programs.linuxfiles.enable = true;
programs.linuxfiles.rootActions = true;
programs.linuxfiles.package = compatible.overrideAttrs (old: {
passthru = (old.passthru or { }) // { supportsNixRootActions = false; };
});
} ];
};
unmarked = nixpkgs.lib.nixosSystem {
Expand Down
Loading