Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dev-flake/flake-compat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
else {}
)
);
rev = info.rev;
inherit (info) rev;
shortRev = builtins.substring 0 7 info.rev;
lastModified = info.lastModified;
inherit (info) lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
inherit (info) narHash;
}
else if info.type == "git"
then
Expand All @@ -44,7 +44,7 @@
builtins.fetchGit
(
{
url = info.url;
inherit (info) url;
shallow = true;
allRefs = true;
}
Expand All @@ -59,14 +59,14 @@
else {}
)
);
lastModified = info.lastModified;
inherit (info) lastModified;
lastModifiedDate = formatSecondsSinceEpoch info.lastModified;
narHash = info.narHash;
inherit (info) narHash;
}
// (
if info ? rev
then {
rev = info.rev;
inherit (info) rev;
shortRev = builtins.substring 0 7 info.rev;
}
else {}
Expand All @@ -79,7 +79,7 @@
then src + ("/" + info.path)
else info.path;
};
narHash = info.narHash;
inherit (info) narHash;
}
else if info.type == "tarball"
then {
Expand Down
10 changes: 6 additions & 4 deletions examples/packages/basics/derivation/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
6 changes: 3 additions & 3 deletions examples/packages/basics/htop-with-flags/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
dream2nix,
...
}: let
deps = config.deps;
stdenv = deps.stdenv;
inherit (config) deps;
inherit (deps) stdenv;
in {
# select mkDerivation as a backend for this package
imports = [
Expand All @@ -24,7 +24,7 @@ in {
stdenv
systemd
;
IOKit = nixpkgs.darwin.IOKit;
inherit (nixpkgs.darwin) IOKit;
};

# specify flags that this package provdes
Expand Down
11 changes: 6 additions & 5 deletions examples/packages/basics/htop-with-flags/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
9 changes: 5 additions & 4 deletions examples/packages/basics/mkDerivation/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
10 changes: 6 additions & 4 deletions examples/packages/languages/nodejs-packaging/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
11 changes: 6 additions & 5 deletions examples/packages/languages/php-packaging/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dream2nix,
...
}: let
python = config.deps.python;
inherit (config.deps) python;
nixpkgsTorch = python.pkgs.torch;
torchWheel = config.deps.runCommand "torch-wheel" {} ''
file="$(ls "${nixpkgsTorch.dist}")"
Expand Down Expand Up @@ -39,15 +39,11 @@ in {

# Override for torch to pick the wheel from nixpkgs instead of pypi
overrides.torch = {
mkDerivation.src = torchWheel;
# This hack is needed to put the right filename into the src attribute.
# We cannot know the exact wheel filename upfront, as it is system dependent.
mkDerivation.prePhases = ["selectWheelFile"];
env.selectWheelFile = ''
export src="$src/$(ls $src)"
'';
# The original build inputs of torch are required for the autoPatchelf phase
mkDerivation.buildInputs = nixpkgsTorch.buildInputs;
mkDerivation = {
src = torchWheel;
prePhases = ["selectWheelFile"];
inherit (nixpkgsTorch) buildInputs;
};
buildPythonPackage = {
format = "wheel";
pyproject = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
Expand Down
12 changes: 7 additions & 5 deletions examples/packages/languages/python-local-development/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
};
}
];
};
});
devShells = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
my_tool = self.packages.${system}.default;
python = my_tool.config.deps.python;
inherit (my_tool.config.deps) python;
in {
default = pkgs.mkShell {
# inherit from the dream2nix generated dev shell
Expand Down
11 changes: 6 additions & 5 deletions examples/packages/languages/python-packaging-ansible/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
dream2nix,
...
}: let
python = config.deps.python;
inherit (config.deps) python;
in {
imports = [
dream2nix.modules.dream2nix.pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
{
# Aid dream2nix to find the project root. This setup should also works for mono
# repos. If you only have a single project, the defaults should be good enough.
paths.projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
paths.projectRootFile = "flake.nix";
paths.package = ./.;
}
paths = {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
package = ./.;
}; }
];
};
});
Expand Down
Loading