This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
97 lines (87 loc) · 3.51 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
description = "⭐craft applications and libraries flake";
inputs = {
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{ self, unstable, ... }:
let
supportedSystems = [
"x86_64-linux"
# "aarch64-linux"
];
forAllSystems = unstable.lib.genAttrs supportedSystems;
pkgsForSystem =
system:
(import unstable {
inherit system;
overlays = [ self.overlay ];
});
in
{
overlay = final: prev: {
pythonPackagesOverlays = (prev.pythonPackagesOverlays or [ ]) ++ [
(_python-final: python_prev: rec {
apt = final.callPackage ./deps/apt.nix { };
catkin-pkg = final.callPackage ./deps/catkin-pkg.nix { };
craft-application = final.callPackage ./deps/craft-application.nix { };
craft-archives = final.callPackage ./deps/craft-archives.nix { };
craft-cli = final.callPackage ./deps/craft-cli.nix { };
craft-grammar = final.callPackage ./deps/craft-grammar.nix { };
craft-parts = final.callPackage ./deps/craft-parts { };
craft-providers = final.callPackage ./deps/craft-providers { };
craft-store = final.callPackage ./deps/craft-store.nix { };
gnupg = final.callPackage ./deps/gnupg.nix { };
macaroon-bakery = final.callPackage ./deps/macaroon-bakery.nix { };
pydantic-yaml = final.callPackage ./deps/pydantic-yaml.nix { };
snap-helpers = final.callPackage ./deps/snap-helpers.nix { };
spdx = final.callPackage ./deps/spdx.nix { };
spdx-lookup = final.callPackage ./deps/spdx-lookup.nix { };
types-deprecated = final.callPackage ./deps/types-deprecated.nix { };
pydantic = python_prev.pydantic_1;
})
];
python3 =
let
self = prev.python3.override {
inherit self;
packageOverrides = prev.lib.composeManyExtensions final.pythonPackagesOverlays;
};
in
self;
python3Packages = final.python3.pkgs;
# charmcraft = final.callPackage ./apps/charmcraft { };
# rockcraft = final.callPackage ./apps/rockcraft { };
# snapcraft = final.callPackage ./apps/snapcraft { };
charmcraft = throw "crafts-flake is deprecated; charmcraft is now available in nixpkgs unstable.";
rockcraft = throw "crafts-flake is deprecated; rockcraft is now available in nixpkgs unstable.";
snapcraft = throw "crafts-flake is deprecated; snapcraft is now available in nixpkgs unstable.";
# A virtual machine for integration testing the crafts
testVm = self.nixosConfigurations.testvm.config.system.build.vm;
# Helper script for running commands inside the test VM when it's running on a host.
testVmExec = final.writeShellApplication {
name = "vmExec";
runtimeInputs = with final.pkgs; [ sshpass ];
text = builtins.readFile ./test/vm-exec;
};
};
packages = forAllSystems (system: {
inherit (pkgsForSystem system)
charmcraft
rockcraft
snapcraft
testVm
testVmExec
;
});
# A minimal NixOS virtual machine which used for testing craft applications.
nixosConfigurations = {
testvm = unstable.lib.nixosSystem {
specialArgs = {
flake = self;
};
modules = [ ./test/vm.nix ];
};
};
};
}