Skip to content

Commit

Permalink
flake.nix: use git submodules instead of flake input for libshv
Browse files Browse the repository at this point in the history
It is really easy to encounter broken state because nix's flake.lock is
not updated by the upstream developers and thus we end up with broker
build due to mismatching libshv and the shvspy code.

This pivots back to use submodules as upstream is using them to pin
their dependencies.
  • Loading branch information
Cynerd committed Sep 23, 2024
1 parent d8772ef commit e1c7692
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 148 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
with:
submodules: true
- name: Install Nix
uses: cachix/install-nix-action@v26
uses: cachix/install-nix-action@V28
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Build
run: nix --experimental-features 'nix-command flakes' build -L .
run: nix --experimental-features 'nix-command flakes' build -L "git+file://$(pwd)?submodules=1&rev=$(git rev-parse HEAD)"
- name: Flake check
run: nix --experimental-features 'nix-command flakes' flake check .
run: nix --experimental-features 'nix-command flakes' flake check "git+file://$(pwd)?submodules=1&rev=$(git rev-parse HEAD)"
- name: Format
run: nix --experimental-features 'nix-command flakes' fmt && git diff --exit-code
134 changes: 1 addition & 133 deletions flake.lock

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

14 changes: 2 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
description = "Silicon Heaven Spy";

inputs.libshv.url = "github:silicon-heaven/libshv";

outputs = {
self,
flake-utils,
nixpkgs,
libshv,
}: let
inherit (flake-utils.lib) eachDefaultSystem;
inherit (nixpkgs.lib) hasSuffix composeManyExtensions;
Expand All @@ -17,8 +14,6 @@
stdenv,
cmake,
qt6,
libshvForClients,
necrolog,
doctest,
openldap,
copyDesktopItems,
Expand All @@ -28,7 +23,7 @@
name = "shvspy-${rev}";
src = builtins.path {
path = ./.;
filter = path: type: ! hasSuffix ".nix" path;
filter = path: _: ! hasSuffix ".nix" path;
};
buildInputs = [
qt6.wrapQtAppsHook
Expand All @@ -37,8 +32,6 @@
qt6.qtwebsockets
qt6.qtsvg
qt6.qtnetworkauth
necrolog
libshvForClients
doctest
openldap
];
Expand All @@ -56,20 +49,17 @@
})
];
cmakeFlags = [
"-DSHVSPY_USE_LOCAL_NECROLOG=ON"
"-DSHVSPY_USE_LOCAL_LIBSHV=ON"
"-DUSE_QT6=ON"
];
meta.mainProgram = "shvspy";
};
in
{
overlays = {
pkgs = final: prev: {
pkgs = final: _: {
shvspy = final.callPackage shvspy {};
};
default = composeManyExtensions [
libshv.overlays.default
self.overlays.pkgs
];
};
Expand Down

0 comments on commit e1c7692

Please sign in to comment.