using flakes for devshell without reimporting nixpkgs multiple times
This commit is contained in:
@@ -1 +1 @@
|
||||
use nix
|
||||
use flake .#clan
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, lib ? pkgs.lib
|
||||
, python3 ? pkgs.python3
|
||||
, ruff ? pkgs.ruff
|
||||
, runCommand ? pkgs.runCommand
|
||||
, installShellFiles ? pkgs.installShellFiles
|
||||
, zerotierone ? pkgs.zerotierone
|
||||
, bubblewrap ? pkgs.bubblewrap
|
||||
{ pkgs
|
||||
, lib
|
||||
, python3
|
||||
, ruff
|
||||
, runCommand
|
||||
, installShellFiles
|
||||
, zerotierone
|
||||
, bubblewrap
|
||||
}:
|
||||
let
|
||||
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
|
||||
name = pyproject.project.name;
|
||||
package = pkgs.callPackage ./default.nix { };
|
||||
shell = pkgs.callPackage ./shell.nix { };
|
||||
in
|
||||
{
|
||||
packages.${name} = package;
|
||||
devShells.${name} = shell;
|
||||
packages.default = package;
|
||||
checks = package.tests;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
,
|
||||
}:
|
||||
{ pkgs }:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
python3 = pkgs.python3;
|
||||
package = import ./default.nix {
|
||||
inherit lib python3;
|
||||
};
|
||||
pythonWithDeps = python3.withPackages (
|
||||
package = pkgs.callPackage ./default.nix { };
|
||||
pythonWithDeps = pkgs.python3.withPackages (
|
||||
ps:
|
||||
package.propagatedBuildInputs
|
||||
++ package.devDependencies
|
||||
@@ -18,7 +12,8 @@ let
|
||||
checkScript = pkgs.writeScriptBin "check" ''
|
||||
nix build -f . tests -L "$@"
|
||||
'';
|
||||
devShell = pkgs.mkShell {
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.ruff
|
||||
pythonWithDeps
|
||||
@@ -51,6 +46,4 @@ let
|
||||
register-python-argcomplete --shell fish clan > $tmp_path/share/fish/vendor_completions.d/clan.fish
|
||||
register-python-argcomplete --shell bash clan > $tmp_path/share/bash-completion/completions/clan
|
||||
'';
|
||||
};
|
||||
in
|
||||
devShell
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user