Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
ce06c30f
Commit
ce06c30f
authored
3 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
[wip]
parent
9641b255
No related branches found
Branches containing commit
No related tags found
1 merge request
!277
Refactor the Nix packaging for reduced duplication and to provide a more useful shell environment
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
default.nix
+2
-0
2 additions, 0 deletions
default.nix
shell.nix
+12
-15
12 additions, 15 deletions
shell.nix
tests.nix
+13
-19
13 additions, 19 deletions
tests.nix
with
27 additions
and
34 deletions
default.nix
+
2
−
0
View file @
ce06c30f
...
...
@@ -37,6 +37,8 @@ in
};
in
rec
{
inherit
pkgs
mach-nix
;
tahoe-lafs
=
mach-nix
.
buildPythonPackage
rec
{
inherit
python
providers
;
name
=
"tahoe-lafs"
;
...
...
This diff is collapsed.
Click to expand it.
shell.nix
+
12
−
15
View file @
ce06c30f
# Note: Passing arguments through here to customize the environment does not
# work on Nix 2.3. It works with Nix 2.5. I'm not sure about 2.4.
{
...
}
@
args
:
let
sources
=
import
nix/sources.nix
;
tests
=
import
./tests.nix
args
;
inherit
(
tests
)
pkgs
;
in
{
pkgs
?
import
sources
.
release2105
{}
,
tahoe-lafs-source
?
"tahoe-lafs"
}:
let
tests
=
pkgs
.
callPackage
./tests.nix
{
inherit
tahoe-lafs-source
;
};
in
pkgs
.
mkShell
{
packages
=
[
tests
.
python
pkgs
.
niv
];
}
pkgs
.
mkShell
{
buildInputs
=
[
tests
.
python
tests
.
lint-python
pkgs
.
niv
];
}
This diff is collapsed.
Click to expand it.
tests.nix
+
13
−
19
View file @
ce06c30f
let
sources
=
import
nix/sources.nix
;
in
{
pkgs
?
import
sources
.
release2105
{}
,
pypiData
?
sources
.
pypi-deps-db
,
mach-nix
?
import
sources
.
mach-nix
{
inherit
pkgs
pypiData
;
}
,
tahoe-lafs-source
?
"tahoe-lafs"
,
tahoe-lafs-repo
?
sources
.
${
tahoe-lafs-source
}
,
privatestorage
?
import
./.
{
inherit
pkgs
pypiData
mach-nix
;
inherit
tahoe-lafs-repo
;
}
{
privatestorage
?
import
./.
args
,
hypothesisProfile
?
null
,
collectCoverage
?
false
,
testSuite
?
null
,
trialArgs
?
null
,
}:
let
,
...
}
@
args
:
let
inherit
(
privatestorage
)
pkgs
mach-nix
zkapauthorizer
;
inherit
(
pkgs
)
lib
;
inherit
(
privatestorage
)
zkapauthorizer
;
hypothesisProfile
'
=
if
hypothesisProfile
==
null
then
"default"
else
hypothesisProfile
;
defaultTrialArgs
=
[
"--rterrors"
]
++
(
lib
.
optional
(
!
collectCoverage
)
"--jobs=$(($NIX_BUILD_CORES > 8 ? 8 : $NIX_BUILD_CORES))"
);
trialArgs
'
=
if
trialArgs
==
null
then
defaultTrialArgs
else
trialArgs
;
...
...
@@ -38,10 +27,11 @@ in
requirements
=
''
isort
black
flake8
''
;
};
in
pkgs
.
runCommand
"zkapauthorizer-tests"
{
tests
=
pkgs
.
runCommand
"zkapauthorizer-tests"
{
passthru
=
{
inherit
python
;
};
...
...
@@ -65,4 +55,8 @@ in
cp -v .coverage.* "$out/coverage"
''
}
''
''
;
in
{
inherit
pkgs
python
lint-python
tests
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment