This commit is contained in:
Rongsong Shen 2025-11-05 16:42:06 +08:00
parent f7244c7e45
commit c28b44152f
5 changed files with 114 additions and 13 deletions

View file

@ -16,6 +16,7 @@ let
uem = callPackage ./pkgs/u/uem/package.nix {
pkgs = pkgs;
};
cetcd = callPackage ./pkgs/cetcd/package.nix {};
in
{
xbuild = xbuild;
@ -25,4 +26,5 @@ in
tinylog = tinylog;
unity_test_with_color = unity_test_with_color;
uem = uem;
cetcd = cetcd;
}

34
flake.lock generated
View file

@ -1,5 +1,23 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1762111121,
@ -18,8 +36,24 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View file

@ -1,21 +1,29 @@
{
description = "A very basic flake";
description = "Flake for some special packages";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs}:
outputs = { self, nixpkgs, flake-utils}:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system: let
flake-utils.lib.eachSystem supportedSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./default.nix { inherit pkgs; });
xpkgs = import ./default.nix { inherit pkgs; };
in rec {
packages = xpkgs;
defaultPackage = xpkgs.uem;
devShells.default = pkgs.mkShell {
nativeBuildInputs = xpkgs.uem.nativeBuildInputs;
};
devShell = self.devShells.${system}.default;
}
);
}

40
pkgs/c/cetcd/package.nix Normal file
View file

@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchFromGitHub,
pkgs,
...
}:
stdenv.mkDerivation {
pname = "cetcd";
version = "1.0.0";
src = fetchFromGitHub {
owner = "shen390s";
repo = "cetcd";
rev = "master";
# sha256 = "sha256-9dzSc3w+yxYzsF/rZe3qIarKOpjt2zvIyjuS5FXngIM=";
};
nativeBuildInputs = [
pkgs.make
pkgs.curl
pkgs.pkg-config
pkgs.yajl
];
configurePhase = ''
true
'';
buildPhase = ''
make prefix=$out
'';
installPhase = ''
runHook preInstall
make install prefix=$out
runHook postInstall
'';
}

View file

@ -3,6 +3,7 @@
stdenv,
fetchFromGitHub,
cmake,
pkgs,
}:
let
@ -22,14 +23,30 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "shen390s";
repo = "uem";
tag = "v${finalAttrs.version}";
# hash = "sha256-g0ubq7RxGQmL1R6vz9RIGJpVWYsgrZhsTWSrL1ySEug=";
rev = "develop";
hash = "sha256-WLQak+5dbD4Zo3EgnW5YVhj5tNPJlkXYdd4lNLzRlq0=";
};
nativeBuildInputs = [ roswell ];
nativeBuildInputs = [ pkgs.roswell ];
doCheck = true;
buildPhase = ''
ros build roswell/uem.ros
set +e
export HOME=/build
env
ros version
find .
mkdir -p $HOME/.roswell
cat >$HOME/.roswell/init.lisp <<EOF
;; (ql:quickload 'asdf-driver)
(let ((cwd (parse-native-namestring (sb-posix:getcwd)
nil
*default-pathname-defaults*
:as-directory t)))
(push cwd
asdf:*central-registry*))
EOF
ros -l $HOME/.roswell/init.lisp build roswell/uem.ros
'';
})