Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Nix backend to use Nix Flakes #414

Merged
merged 10 commits into from Feb 8, 2022
27 changes: 27 additions & 0 deletions backends/nix/buildenv.nix.gen.hh
@@ -0,0 +1,27 @@
R"foo(
{ derivations, manifest }:

derivation {
name = "user-environment";
system = "builtin";
builder = "builtin:buildenv";

inherit manifest;

# !!! grmbl, need structured data for passing this in a clean way.
derivations =
map (d:
[ (d.meta.active or "true")
(d.meta.priority or 5)
(builtins.length d.outputs)
] ++ map (output: builtins.getAttr output d) d.outputs)
derivations;

# Building user environments remotely just causes huge amounts of
# network traffic, so don't do that.
preferLocalBuild = true;

# Also don't bother substituting.
allowSubstitutes = false;
}
)foo"
11 changes: 6 additions & 5 deletions backends/nix/meson.build
@@ -1,23 +1,24 @@
add_languages('cpp')

nix_expr_dep = dependency('nix-expr', version: '>=1.12')
nix_main_dep = dependency('nix-main', version: '>=1.12')
nix_store_dep = dependency('nix-store', version: '>=1.12')
nix_expr_dep = dependency('nix-expr', version: '>=2.6')
nix_main_dep = dependency('nix-main', version: '>=2.6')
nix_store_dep = dependency('nix-store', version: '>=2.6')
nix_cmd_dep = dependency('nix-cmd', version: '>=2.6')

shared_module(
'pk_backend_nix',
'pk-backend-nix.cc',
'nix-helpers.cc',
'nix-lib-plus.cc',
include_directories: packagekit_src_include,
dependencies: [
packagekit_glib2_dep,
nix_expr_dep,
nix_main_dep,
nix_cmd_dep,
nix_store_dep,
gmodule_dep,
],
c_args: [
cpp_args: [
'-DPK_COMPILATION=1',
'-DG_LOG_DOMAIN="PackageKit-Nix"',
],
Expand Down
182 changes: 0 additions & 182 deletions backends/nix/nix-helpers.cc

This file was deleted.

63 changes: 0 additions & 63 deletions backends/nix/nix-helpers.hh

This file was deleted.