pkgs: build attic without relying on flakes

This commit is contained in:
Nikodem Rabuliński 2025-05-01 13:30:50 +02:00
parent 111d88a193
commit 2ff9d98635
Signed by: nrabulinski
SSH key fingerprint: SHA256:AZZVyfKStaCo8sbJB+3Rr/CRrlym1oEgw7vMnynJeR8
4 changed files with 41 additions and 9 deletions

17
flake.lock generated
View file

@ -122,6 +122,22 @@
"type": "github"
}
},
"crane_2": {
"flake": false,
"locked": {
"lastModified": 1745454774,
"narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=",
"owner": "ipetkov",
"repo": "crane",
"rev": "efd36682371678e2b6da3f108fdb5c613b3ec598",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
@ -586,6 +602,7 @@
"agenix": "agenix",
"attic": "attic",
"conduit-src": "conduit-src",
"crane": "crane_2",
"darwin": "darwin",
"disko": "disko",
"firefox-darwin": "firefox-darwin",

View file

@ -60,6 +60,10 @@
inputs.lix.follows = "lix";
inputs.lix-module.follows = "lix-module";
};
crane = {
url = "github:ipetkov/crane";
flake = false;
};
helix = {
url = "github:helix-editor/helix";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -47,15 +47,6 @@
getPkgs = system: builtins.mapAttrs (_: pkg: pkg.result.${system}) config.packages;
in
{
# Re-export for convenience and for caching
attic-client = mkPackageFlakeOutput {
input = "attic";
output = "attic-client";
};
attic-server = mkPackageFlakeOutput {
input = "attic";
output = "attic-server";
};
agenix = mkPackageFlakeOutput { input = "agenix"; };
base-packages = mkPackage (
{ symlinkJoin, system }:

View file

@ -1,5 +1,6 @@
{
config,
lib,
inputs,
}:
let
@ -12,6 +13,14 @@ let
mkPackage = package: {
inherit systems package builder;
};
atticPkgs = lib.attrs.generate systems (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system}.extend inputs.lix-module.overlays.default;
craneLib = import inputs.crane { inherit pkgs; };
in
pkgs.callPackage "${inputs.attic}/crane.nix" { inherit craneLib; }
);
in
{
config.packages.conduit-next = {
@ -49,4 +58,15 @@ in
'';
}
);
config.packages.attic-client = {
inherit systems;
builder = "custom-load";
package = { system }: atticPkgs.${system}.attic-client;
};
config.packages.attic-server = {
inherit systems;
builder = "custom-load";
package = { system }: atticPkgs.${system}.attic-server;
};
}