From 279df7c459731030b5b94fd78a9f1c497f59e290 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 25 Nov 2025 22:12:22 +0200 Subject: [PATCH] feat: makeimg --- .gitignore | 1 + default.nix | 40 +++++++++++++++++++++++++++++++++++ flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 17 +++++++++++++++ 4 files changed, 119 insertions(+) create mode 100644 .gitignore create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e37da56 --- /dev/null +++ b/default.nix @@ -0,0 +1,40 @@ +{ + makeWrapper, + lib, + pkgs, + stdenv, + coreutils, + util-linux, + e2fsprogs, + parted, + apk-tools, + findutils, + ... +}: let +in + stdenv.mkDerivation rec { + pname = "makeimg"; + version = "0.14.0"; + + src = pkgs.fetchFromSourcehut { + owner = "~bitfehler"; + repo = "makeimg"; + tag = "v${version}"; + hash = "sha256-cLCLCG0+ShFazuVBG9GcvVmQNJtuMkKdGEP3QNJPTAo="; + }; + + dontBuild = true; + + nativeBuildInputs = [makeWrapper]; + installPhase = '' + install -Dm755 -t $out/bin makeimg + wrapProgram $out/bin/makeimg --set PATH ${lib.makeBinPath [ + coreutils + util-linux + e2fsprogs + parted + apk-tools + findutils + ]} + ''; + } diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2f73c40 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1763934636, + "narHash": "sha256-9glbI7f1uU+yzQCq5LwLgdZqx6svOhZWkd4JRY265fc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ee09932cedcef15aaf476f9343d1dea2cb77e261", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1761765539, + "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..22433af --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs @ {...}: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux"]; + perSystem = { + pkgs, + ... + }: { + packages.default = pkgs.callPackage ./default.nix {}; + }; + }; +} -- 2.44.1