A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Migrate packages to flake-parts

+96 -68
-68
flake.nix
··· 75 75 in rec { 76 76 inherit internalMatrix; 77 77 78 - packages = { 79 - default = packages.attic; 80 - 81 - inherit (cranePkgs) attic attic-client attic-server; 82 - 83 - attic-nixpkgs = pkgs.callPackage ./package.nix { }; 84 - 85 - attic-ci-installer = pkgs.callPackage ./ci-installer.nix { 86 - inherit self; 87 - }; 88 - 89 - book = pkgs.callPackage ./book { 90 - attic = packages.attic; 91 - }; 92 - } // (lib.optionalAttrs (system != "x86_64-darwin") { 93 - # Unfortunately, x86_64-darwin fails to evaluate static builds 94 - # TODO: Make this work with Crane 95 - attic-static = (pkgs.pkgsStatic.callPackage ./package.nix { 96 - nix = pkgs.pkgsStatic.nix.overrideAttrs (old: { 97 - patches = (old.patches or []) ++ [ 98 - # To be submitted 99 - (pkgs.fetchpatch { 100 - url = "https://github.com/NixOS/nix/compare/3172c51baff5c81362fcdafa2e28773c2949c660...6b09a02536d5946458b537dfc36b7d268c9ce823.diff"; 101 - hash = "sha256-LFLq++J2XitEWQ0o57ihuuUlYk2PgUr11h7mMMAEe3c="; 102 - }) 103 - ]; 104 - }); 105 - }).overrideAttrs (old: { 106 - nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ 107 - pkgs.nukeReferences 108 - ]; 109 - 110 - # Read by pkg_config crate (do some autodetection in build.rs?) 111 - PKG_CONFIG_ALL_STATIC = "1"; 112 - 113 - "NIX_CFLAGS_LINK_${pkgs.pkgsStatic.stdenv.cc.suffixSalt}" = "-lc"; 114 - RUSTFLAGS = "-C relocation-model=static"; 115 - 116 - postFixup = (old.postFixup or "") + '' 117 - rm -f $out/nix-support/propagated-build-inputs 118 - nuke-refs $out/bin/attic 119 - ''; 120 - }); 121 - 122 - attic-client-static = packages.attic-static.override { 123 - clientOnly = true; 124 - }; 125 - }) // (lib.optionalAttrs pkgs.stdenv.isLinux { 126 - attic-server-image = pkgs.dockerTools.buildImage { 127 - name = "attic-server"; 128 - tag = "main"; 129 - copyToRoot = [ 130 - # Debugging utilities for `fly ssh console` 131 - pkgs.busybox 132 - packages.attic-server 133 - 134 - # Now required by the fly.io sshd 135 - pkgs.dockerTools.fakeNss 136 - ]; 137 - config = { 138 - Entrypoint = [ "${packages.attic-server}/bin/atticd" ]; 139 - Env = [ 140 - "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" 141 - ]; 142 - }; 143 - }; 144 - }); 145 - 146 78 checks = let 147 79 makeIntegrationTests = pkgs: import ./integration-tests { 148 80 pkgs = import inputs.nixpkgs {
+96
flake/packages.nix
··· 1 + { self, inputs, lib, ... }: 2 + let 3 + makeCranePkgs = pkgs: let 4 + craneLib = inputs.crane.mkLib pkgs; 5 + in pkgs.callPackage ../crane.nix { inherit craneLib; }; 6 + in 7 + { 8 + _module.args.makeCranePkgs = makeCranePkgs; 9 + 10 + perSystem = { self', pkgs, cranePkgs, ... }: (lib.mkMerge [ 11 + { 12 + _module.args.cranePkgs = makeCranePkgs pkgs; 13 + 14 + packages = { 15 + default = self'.packages.attic; 16 + 17 + inherit (cranePkgs) 18 + attic 19 + attic-client 20 + attic-server 21 + ; 22 + 23 + attic-nixpkgs = pkgs.callPackage ../package.nix { }; 24 + 25 + attic-ci-installer = pkgs.callPackage ../ci-installer.nix { 26 + inherit self; 27 + }; 28 + 29 + book = pkgs.callPackage ../book { 30 + attic = self'.packages.attic; 31 + }; 32 + }; 33 + } 34 + 35 + (lib.mkIf pkgs.stdenv.isLinux { 36 + packages = { 37 + attic-server-image = pkgs.dockerTools.buildImage { 38 + name = "attic-server"; 39 + tag = "main"; 40 + copyToRoot = [ 41 + self'.packages.attic-server 42 + 43 + # Debugging utilities for `fly ssh console` 44 + pkgs.busybox 45 + 46 + # Now required by the fly.io sshd 47 + pkgs.dockerTools.fakeNss 48 + ]; 49 + config = { 50 + Entrypoint = [ "${self'.packages.attic-server}/bin/atticd" ]; 51 + Env = [ 52 + "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" 53 + ]; 54 + }; 55 + }; 56 + }; 57 + }) 58 + 59 + # Unfortunately, x86_64-darwin fails to evaluate static builds 60 + (lib.mkIf (pkgs.system != "x86_64-darwin") { 61 + packages = { 62 + # TODO: Make this work with Crane 63 + attic-static = (pkgs.pkgsStatic.callPackage ../package.nix { 64 + nix = pkgs.pkgsStatic.nix.overrideAttrs (old: { 65 + patches = (old.patches or []) ++ [ 66 + # To be submitted 67 + (pkgs.fetchpatch { 68 + url = "https://github.com/NixOS/nix/compare/3172c51baff5c81362fcdafa2e28773c2949c660...6b09a02536d5946458b537dfc36b7d268c9ce823.diff"; 69 + hash = "sha256-LFLq++J2XitEWQ0o57ihuuUlYk2PgUr11h7mMMAEe3c="; 70 + }) 71 + ]; 72 + }); 73 + }).overrideAttrs (old: { 74 + nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ 75 + pkgs.nukeReferences 76 + ]; 77 + 78 + # Read by pkg_config crate (do some autodetection in build.rs?) 79 + PKG_CONFIG_ALL_STATIC = "1"; 80 + 81 + "NIX_CFLAGS_LINK_${pkgs.pkgsStatic.stdenv.cc.suffixSalt}" = "-lc"; 82 + RUSTFLAGS = "-C relocation-model=static"; 83 + 84 + postFixup = (old.postFixup or "") + '' 85 + rm -f $out/nix-support/propagated-build-inputs 86 + nuke-refs $out/bin/attic 87 + ''; 88 + }); 89 + 90 + attic-client-static = self'.packages.attic-static.override { 91 + clientOnly = true; 92 + }; 93 + }; 94 + }) 95 + ]); 96 + }