Skip to content

Commit

Permalink
ref: use self instead of rootDir
Browse files Browse the repository at this point in the history
  • Loading branch information
Dich0tomy committed May 25, 2024
1 parent 315f775 commit d6514c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
18 changes: 6 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,20 @@
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = import inputs.systems;

imports = [./nix/dependencies];
imports = [
./nix/dependencies
./nix/package
];

perSystem = {
pkgs,
system,
lib,
...
}: let
rootDir = ./.;

version = lib.strings.fileContents ./VERSION;
in {
}: {
formatter = pkgs.alejandra;

_module.args = {inherit rootDir version;};

imports = [
./nix/package
./nix/shell
];
imports = [./nix/shell];
};
};
}
6 changes: 1 addition & 5 deletions nix/dependencies/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
inputs,
system,
...
}: {
{inputs, ...}: {
perSystem = {system, ...}: {
_module.args = {
pkgs = import inputs.nixpkgs {
Expand Down
19 changes: 11 additions & 8 deletions nix/package/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
pkgs,
rootDir,
version,
...
}: {
packages.default = pkgs.callPackage ./package.nix {
inherit rootDir version;
{self, ...}: {
perSystem = {
pkgs,
lib,
...
}: let
version = lib.strings.fileContents "${self}/VERSION";
in {
packages.default = pkgs.callPackage ./package.nix {
inherit self version;
};
};
}
4 changes: 2 additions & 2 deletions nix/package/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
rootDir,
self,
version,
stdenv,
meson,
Expand Down Expand Up @@ -34,7 +34,7 @@ stdenv.mkDerivation {
tl-expected
];

src = rootDir;
src = "${self}";

mesonBuildType = "release";

Expand Down

0 comments on commit d6514c0

Please sign in to comment.