forked from sio2project/sioworkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
70 lines (65 loc) · 2.19 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
{
description = "The task runner used by SIO2";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.filetracker = {
url = "github:Stowarzyszenie-Talent/filetracker/nixpkgs-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, filetracker }:
let
importWithPin = file:
({ pkgs, lib, config, ... }: import file {
# Use pinned nixpkgs from our input for epic reproducibility.
pkgs = import nixpkgs {
inherit (pkgs) system; overlays = [ self.overlays.default filetracker.overlays.default ];
};
inherit lib config;
});
selfImports = [
(importWithPin ./nix/module/worker.nix)
(importWithPin ./nix/module/workersd.nix)
];
in
{
overlays.default = final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
sioworkers = prev.callPackage ./nix/package.nix python-prev;
})
];
sioworkers = with final.python311Packages; toPythonApplication sioworkers;
};
nixosModules.self = {
nixpkgs.overlays = [ self.overlays.default ];
imports = selfImports;
};
nixosModules.default = {
nixpkgs.overlays = [ self.overlays.default ];
imports = [ filetracker.nixosModules.default ] ++ selfImports;
};
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
nixosModules.self = {
nixpkgs.overlays = [ self.overlays.default ];
imports = selfImports;
};
modules = [
(_: {
nixpkgs.overlays = [
self.overlays.default
filetracker.overlays.default
];
})
./nix/container.nix
];
};
} // (flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default filetracker.overlays.default ]; };
in
{
packages.default = pkgs.sioworkers;
devShell = pkgs.sioworkers;
}));
}