diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index cb1ce8c..9215915 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -73,20 +73,20 @@ jobs: path: result/* retention-days: 1 - planterette: - name: Planterette + hpkg: + name: Hpkg runs-on: nix steps: - name: Checkout uses: actions/checkout@v4 - name: Run NixOS test - run: nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.planterette + run: nix build --out-link "result" --print-out-paths --print-build-logs .#checks.x86_64-linux.hpkg - name: Upload test output uses: actions/upload-artifact@v3 with: - name: "planterette-vm-output" + name: "hpkg-vm-output" path: result/* retention-days: 1 @@ -97,7 +97,7 @@ jobs: - race - sandbox - sandbox-race - - planterette + - hpkg runs-on: nix steps: - name: Checkout diff --git a/README.md b/README.md index 23d1304..0ac6e32 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@

Hakurei is a tool for running sandboxed graphical applications as dedicated subordinate users on the Linux kernel. -It also implements [planterette (WIP)](cmd/planterette), a self-contained Android-like package manager with modern security features. +It implements the application container of [planterette (WIP)](https://git.gensokyo.uk/security/planterette), +a self-contained Android-like package manager with modern security features. ## NixOS Module usage diff --git a/cmd/planterette/app.go b/cmd/hpkg/app.go similarity index 100% rename from cmd/planterette/app.go rename to cmd/hpkg/app.go diff --git a/cmd/planterette/build.nix b/cmd/hpkg/build.nix similarity index 100% rename from cmd/planterette/build.nix rename to cmd/hpkg/build.nix diff --git a/cmd/planterette/main.go b/cmd/hpkg/main.go similarity index 96% rename from cmd/planterette/main.go rename to cmd/hpkg/main.go index 75983a4..d808aa0 100644 --- a/cmd/planterette/main.go +++ b/cmd/hpkg/main.go @@ -23,7 +23,7 @@ var ( ) func init() { - hlog.Prepare("planterette") + hlog.Prepare("hpkg") if err := os.Setenv("SHELL", shellPath); err != nil { log.Fatalf("cannot set $SHELL: %v", err) } @@ -42,7 +42,7 @@ func main() { flagVerbose bool flagDropShell bool ) - c := command.New(os.Stderr, log.Printf, "planterette", func([]string) error { internal.InstallOutput(flagVerbose); return nil }). + c := command.New(os.Stderr, log.Printf, "hpkg", func([]string) error { internal.InstallOutput(flagVerbose); return nil }). Flag(&flagVerbose, "v", command.BoolFlag(false), "Print debug messages to the console"). Flag(&flagDropShell, "s", command.BoolFlag(false), "Drop to a shell in place of next hakurei action") @@ -66,7 +66,7 @@ func main() { } /* - Look up paths to programs started by planterette. + Look up paths to programs started by hpkg. This is done here to ease error handling as cleanup is not yet required. */ @@ -82,7 +82,7 @@ func main() { */ var workDir string - if p, err := os.MkdirTemp("", "planterette.*"); err != nil { + if p, err := os.MkdirTemp("", "hpkg.*"); err != nil { log.Printf("cannot create temporary directory: %v", err) return err } else { diff --git a/cmd/planterette/paths.go b/cmd/hpkg/paths.go similarity index 100% rename from cmd/planterette/paths.go rename to cmd/hpkg/paths.go diff --git a/cmd/planterette/proc.go b/cmd/hpkg/proc.go similarity index 100% rename from cmd/planterette/proc.go rename to cmd/hpkg/proc.go diff --git a/cmd/planterette/test/configuration.nix b/cmd/hpkg/test/configuration.nix similarity index 100% rename from cmd/planterette/test/configuration.nix rename to cmd/hpkg/test/configuration.nix diff --git a/cmd/planterette/test/default.nix b/cmd/hpkg/test/default.nix similarity index 96% rename from cmd/planterette/test/default.nix rename to cmd/hpkg/test/default.nix index 3ff76fc..4d5e3b0 100644 --- a/cmd/planterette/test/default.nix +++ b/cmd/hpkg/test/default.nix @@ -9,7 +9,7 @@ let buildPackage = self.buildPackage.${system}; in nixosTest { - name = "planterette"; + name = "hpkg"; nodes.machine = { environment.etc = { "foot.pkg".source = callPackage ./foot.nix { inherit buildPackage; }; diff --git a/cmd/planterette/test/foot.nix b/cmd/hpkg/test/foot.nix similarity index 100% rename from cmd/planterette/test/foot.nix rename to cmd/hpkg/test/foot.nix diff --git a/cmd/planterette/test/test.py b/cmd/hpkg/test/test.py similarity index 92% rename from cmd/planterette/test/test.py rename to cmd/hpkg/test/test.py index b551dc7..c994435 100644 --- a/cmd/planterette/test/test.py +++ b/cmd/hpkg/test/test.py @@ -79,15 +79,15 @@ print(machine.succeed("sudo -u alice -i hakurei version")) machine.wait_for_file("/run/user/1000/wayland-1") machine.wait_for_file("/tmp/sway-ipc.sock") -# Prepare planterette directory: +# Prepare hpkg directory: machine.succeed("install -dm 0700 -o alice -g users /var/lib/hakurei/1000") -# Install planterette app: -swaymsg("exec planterette -v install /etc/foot.pkg && touch /tmp/planterette-install-ok") -machine.wait_for_file("/tmp/planterette-install-ok") +# Install hpkg app: +swaymsg("exec hpkg -v install /etc/foot.pkg && touch /tmp/hpkg-install-ok") +machine.wait_for_file("/tmp/hpkg-install-ok") # Start app (foot) with Wayland enablement: -swaymsg("exec planterette -v start org.codeberg.dnkl.foot") +swaymsg("exec hpkg -v start org.codeberg.dnkl.foot") wait_for_window("hakurei@machine-foot") machine.send_chars("clear; wayland-info && touch /tmp/success-client\n") machine.wait_for_file("/tmp/hakurei.1000/tmpdir/2/success-client") diff --git a/cmd/planterette/with.go b/cmd/hpkg/with.go similarity index 100% rename from cmd/planterette/with.go rename to cmd/hpkg/with.go diff --git a/dist/install.sh b/dist/install.sh index 8601b27..ef2e13d 100755 --- a/dist/install.sh +++ b/dist/install.sh @@ -2,7 +2,7 @@ cd "$(dirname -- "$0")" || exit 1 install -vDm0755 "bin/hakurei" "${HAKUREI_INSTALL_PREFIX}/usr/bin/hakurei" -install -vDm0755 "bin/planterette" "${HAKUREI_INSTALL_PREFIX}/usr/bin/planterette" +install -vDm0755 "bin/hpkg" "${HAKUREI_INSTALL_PREFIX}/usr/bin/hpkg" install -vDm6511 "bin/hsu" "${HAKUREI_INSTALL_PREFIX}/usr/bin/hsu" if [ ! -f "${HAKUREI_INSTALL_PREFIX}/etc/hsurc" ]; then diff --git a/flake.nix b/flake.nix index 6cc94de..b4f9e39 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ buildPackage = forAllSystems ( system: nixpkgsFor.${system}.callPackage ( - import ./cmd/planterette/build.nix { + import ./cmd/hpkg/build.nix { inherit nixpkgsFor system @@ -69,7 +69,7 @@ withRace = true; }; - planterette = callPackage ./cmd/planterette/test { inherit system self; }; + hpkg = callPackage ./cmd/hpkg/test { inherit system self; }; formatting = runCommandLocal "check-formatting" { nativeBuildInputs = [ nixfmt-rfc-style ]; } '' cd ${./.} @@ -125,7 +125,7 @@ glibc xdg-dbus-proxy - # planterette + # hpkg zstd gnutar coreutils diff --git a/package.nix b/package.nix index c52ff33..48b91c7 100644 --- a/package.nix +++ b/package.nix @@ -13,7 +13,7 @@ wayland-scanner, xorg, - # for planterette + # for hpkg zstd, gnutar, coreutils, @@ -116,7 +116,7 @@ buildGoModule rec { makeBinaryWrapper "$out/libexec/hakurei" "$out/bin/hakurei" \ --inherit-argv0 --prefix PATH : ${lib.makeBinPath appPackages} - makeBinaryWrapper "$out/libexec/planterette" "$out/bin/planterette" \ + makeBinaryWrapper "$out/libexec/hpkg" "$out/bin/hpkg" \ --inherit-argv0 --prefix PATH : ${ lib.makeBinPath ( appPackages