Skip to content

Commit

Permalink
ref(nix): use ../.. as a source, not self
Browse files Browse the repository at this point in the history
  • Loading branch information
Dich0tomy committed Jul 3, 2024
1 parent 552c7df commit 05b623c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
5 changes: 1 addition & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];

imports = [
./nix/package
];

perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;

imports = [
./nix/dependencies
./nix/package
./nix/shell
];
};
Expand Down
20 changes: 7 additions & 13 deletions nix/package/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{self, ...}: {
perSystem = {
pkgs,
lib,
config,
...
}: let
version = lib.strings.fileContents "${self}/VERSION";
in {
packages.default = pkgs.callPackage ./package.nix ({
inherit self version;
} // config.legacyPackages);
};
{
pkgs,
config,
...
}:
{
packages.default = pkgs.callPackage ./package.nix config.legacyPackages;
}
17 changes: 14 additions & 3 deletions nix/package/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
self,
version,
stdenv,
meson,
ninja,
Expand All @@ -9,7 +7,12 @@
tl-optional,
tl-expected,
fmt,
lib,
}:
let
self = ../../.;
version = lib.strings.fileContents "${self}/VERSION";
in
stdenv.mkDerivation {
pname = "dire";
inherit version;
Expand All @@ -34,7 +37,15 @@ stdenv.mkDerivation {
tl-expected
];

src = "${self}";
src = lib.fileset.toSource {
root = self;
fileset = lib.fileset.unions [
(self + /src)
(self + /VERSION)
(self + /meson.build)
(self + /meson_options.txt)
];
};

mesonBuildType = "release";

Expand Down

0 comments on commit 05b623c

Please sign in to comment.