diff --git a/nixos/modules/overlays.nix b/nixos/modules/overlays.nix index 6084665f006774b4d816f35471e5a98c5e27033a..376ffa56b013764934c3e8cecb5b10426728a1b4 100644 --- a/nixos/modules/overlays.nix +++ b/nixos/modules/overlays.nix @@ -1,7 +1,7 @@ let - # Define a Python packageOverride that puts our version of Twisted into - # python27Packages. - pythonTwistedOverride = python-self: python-super: { + # Define a Python packageOverride that puts our version of some Python + # packages into python27Packages. + pythonPackageOverride = python-self: python-super: rec { # Get our Twisted derivation. Pass in the old one so it can have pieces # overridden. It needs to be passed in explicitly because callPackage is # specially crafted to always pull attributes from the fixed-point. That @@ -12,6 +12,15 @@ let twisted = python-self.callPackage ../pkgs/twisted.nix { inherit (python-super) twisted; }; + + # Put in our preferred version of tahoe-lafs as well. + tahoe-lafs = python-self.callPackage ../pkgs/tahoe-lafs.nix { }; + + # This is handy too... + zkapauthorizer = python-self.callPackage ../pkgs/zkapauthorizer.nix { + # And explicitly configure it with our preferred version of Tahoe-LAFS. + inherit tahoe-lafs; + }; }; in self: super: { @@ -26,7 +35,9 @@ self: super: { # instead because it implies a whole mess of derivations (all of the Python # modules available). privatestorage = self.python27.buildEnv.override - { extraLibs = + { # ... for dropin.cache + ignoreCollisions = true; + extraLibs = [ self.python27Packages.tahoe-lafs self.python27Packages.zkapauthorizer ]; @@ -38,8 +49,8 @@ self: super: { python27 = super.python27.override (old: { packageOverrides = if old ? packageOverrides then - super.lib.composeExtensions old.packageOverrides pythonTwistedOverride + super.lib.composeExtensions old.packageOverrides pythonPackageOverride else - pythonTwistedOverride; + pythonPackageOverride; }); } diff --git a/nixos/modules/pspkgs.nix b/nixos/modules/pspkgs.nix index 11ef89929ef0ad20f3c5f7795554a90085ed66f9..697bc5a0b4edf4734ac131d40a3584f4e7d5406a 100644 --- a/nixos/modules/pspkgs.nix +++ b/nixos/modules/pspkgs.nix @@ -1,19 +1,4 @@ -# Derive a brand new version of pkgs which has our overlays applied. This -# includes the ZKAPAuthorizer overlay which defines some Python overrides as -# well as our own which defines the `privatestorage` derivation. +# Derive a brand new version of pkgs which has our overlays applied. This is +# where the `privatestorage` derivation is added to nixpkgs. { pkgs }: -import pkgs.path { - overlays = [ - # For some reason the order of these overlays matters. Maybe it has to do - # with our python27 override, I'm not sure. In the other order, we end up - # with two derivations of each of Twisted and treq which conflict with - # each other. - (import ./overlays.nix) - # It might be nice to eventually remove this. ZKAPAuthorizer now - # self-applies this overlay without our help. We only still have it - # because it also defines tahoe-lafs which we want to use. We can't see - # tahoe-lafs from the self-applied overlay because that overlay is applied - # to ZKAPAuthorizer's nixpkgs, not to the one we're using. - (import ./zkap-overlay.nix) - ]; -} +pkgs.extend (import ./overlays.nix) diff --git a/nixos/pkgs/tahoe-lafs-repo.nix b/nixos/pkgs/tahoe-lafs-repo.nix new file mode 100644 index 0000000000000000000000000000000000000000..dd5ecbb6b6e91160edd42a659d218c8e8bcdf9f4 --- /dev/null +++ b/nixos/pkgs/tahoe-lafs-repo.nix @@ -0,0 +1,9 @@ +let + pkgs = import <nixpkgs> {}; +in + pkgs.fetchFromGitHub { + owner = "tahoe-lafs"; + repo = "tahoe-lafs"; + rev = "23e1223c94330741f5b1dda476c3aeb42c3a012f"; + sha256 = "1zh37rvkiigciwadgrjvnq9519lap1c260v8593g65qrpc1zwjxz"; + } \ No newline at end of file diff --git a/nixos/pkgs/tahoe-lafs.nix b/nixos/pkgs/tahoe-lafs.nix new file mode 100644 index 0000000000000000000000000000000000000000..3289c5f5761df1ea60b33d3ef3d64d4dd0e3e1cb --- /dev/null +++ b/nixos/pkgs/tahoe-lafs.nix @@ -0,0 +1,5 @@ +{ callPackage }: +let + tahoe-lafs-repo = import ./tahoe-lafs-repo.nix; +in + callPackage "${tahoe-lafs-repo}/nix" { } diff --git a/nixos/pkgs/zkapauthorizer-repo.nix b/nixos/pkgs/zkapauthorizer-repo.nix index 179c02ee95ea5e43987e46ba450fcff73726effb..dffc40ed22d2fb0113fd033f1cf12c09b91eb0dd 100644 --- a/nixos/pkgs/zkapauthorizer-repo.nix +++ b/nixos/pkgs/zkapauthorizer-repo.nix @@ -4,6 +4,6 @@ in pkgs.fetchFromGitHub { owner = "PrivateStorageio"; repo = "ZKAPAuthorizer"; - rev = "17d66c052bfd08f8d00301cc431a83c70f05db0f"; - sha256 = "10ss41lk2mlb3ys7b8dc9dkcdiabkvi8clklkm75llk0g5bkvvss"; + rev = "6cd0c32cc53a9734e2cb7c19a9ad28d479612197"; + sha256 = "0i1r75471yjj4bfi5814ihrcyjk1zdz8rzm06bngij3n70svqhsm"; } \ No newline at end of file diff --git a/nixos/pkgs/zkapauthorizer.nix b/nixos/pkgs/zkapauthorizer.nix new file mode 100644 index 0000000000000000000000000000000000000000..a76a770ec0678a22c44e07c5e0761851f9920dbc --- /dev/null +++ b/nixos/pkgs/zkapauthorizer.nix @@ -0,0 +1 @@ +import "${import ./zkapauthorizer-repo.nix}/default.nix"