Skip to content

Commit

Permalink
flake.nix: update the package
Browse files Browse the repository at this point in the history
This primarily adds assert to hint on the magic URL.
  • Loading branch information
Cynerd committed Jan 28, 2025
1 parent 5e6e9a5 commit fb2131d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
fetch-depth: 1
- name: Install Nix
uses: cachix/install-nix-action@V28
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build
run: nix --experimental-features 'nix-command flakes' build -L "git+file://$(pwd)?submodules=1&rev=$(git rev-parse HEAD)"
run: nix --experimental-features 'nix-command flakes' build -L '.?submodules=1#'
- name: Flake check
run: nix --experimental-features 'nix-command flakes' flake check "git+file://$(pwd)?submodules=1&rev=$(git rev-parse HEAD)"
run: nix --experimental-features 'nix-command flakes' flake check '.?submodules=1#'
- name: Format
run: nix --experimental-features 'nix-command flakes' fmt && git diff --exit-code
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 33 additions & 41 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
nixpkgs,
}: let
inherit (flake-utils.lib) eachDefaultSystem;
inherit (nixpkgs.lib) hasSuffix composeManyExtensions;
inherit (nixpkgs.lib) assertMsg;
rev = self.shortRev or self.dirtyShortRev or "unknown";

shvspy = {
Expand All @@ -19,49 +19,41 @@
copyDesktopItems,
makeDesktopItem,
}:
stdenv.mkDerivation {
name = "shvspy-${rev}";
src = builtins.path {
path = ./.;
filter = path: _: ! hasSuffix ".nix" path;
assert assertMsg self.submodules
"Unable to build without submodules. Append '?submodules=1#' to the URL.";
stdenv.mkDerivation {
name = "shvspy-${rev}";
src = ./.;
buildInputs = [
qt6.wrapQtAppsHook
qt6.qtbase
qt6.qtserialport
qt6.qtwebsockets
qt6.qtsvg
qt6.qtnetworkauth
doctest
openldap
];
nativeBuildInputs = [
cmake
qt6.qttools
copyDesktopItems
];
desktopItems = [
(makeDesktopItem {
name = "shvspy";
exec = "shvspy";
desktopName = "SHVSpy";
categories = ["Network" "RemoteAccess"];
})
];
cmakeFlags = ["-DUSE_QT6=ON"];
meta.mainProgram = "shvspy";
};
buildInputs = [
qt6.wrapQtAppsHook
qt6.qtbase
qt6.qtserialport
qt6.qtwebsockets
qt6.qtsvg
qt6.qtnetworkauth
doctest
openldap
];
nativeBuildInputs = [
cmake
qt6.qttools
copyDesktopItems
];
desktopItems = [
(makeDesktopItem {
name = "shvspy";
exec = "shvspy";
desktopName = "SHVSpy";
categories = ["Network" "RemoteAccess"];
})
];
cmakeFlags = [
"-DUSE_QT6=ON"
];
meta.mainProgram = "shvspy";
};
in
{
overlays = {
pkgs = final: _: {
shvspy = final.callPackage shvspy {};
};
default = composeManyExtensions [
self.overlays.pkgs
];
overlays.default = final: _: {
shvspy = final.callPackage shvspy {};
};
}
// eachDefaultSystem (system: let
Expand Down

0 comments on commit fb2131d

Please sign in to comment.