syndicate-flake/flake.nix

63 lines
1.9 KiB
Nix
Raw Normal View History

2021-09-02 10:16:35 +00:00
{
description = "Syndicate utilities";
2021-09-02 10:16:35 +00:00
2023-10-10 10:50:58 +00:00
outputs = { self, nixpkgs }: {
2022-03-14 19:12:50 +00:00
lib = nixpkgs.lib.extend (import ./lib.nix);
2023-10-10 10:50:58 +00:00
overlays.default = import ./overlay.nix;
2022-03-14 19:12:50 +00:00
legacyPackages =
self.lib.mapAttrs (system: pkgs: pkgs.extend self.overlays.default) {
inherit (nixpkgs.legacyPackages) x86_64-linux;
};
2022-03-14 19:12:50 +00:00
packages = self.lib.mapAttrs (system: pkgs:
with pkgs; {
2023-05-09 11:00:56 +00:00
inherit fontconfig_actor libnotify_actor noise-c preserves-tools squeak
2023-11-30 10:23:20 +00:00
squeaker syndicate-server syndicated-open syndicate_utils;
2022-03-14 19:13:50 +00:00
preserves-py = python3Packages.preserves;
2023-11-30 10:23:20 +00:00
syndicate-py = python3Packages.syndicate-py;
2022-03-14 19:12:50 +00:00
}) self.legacyPackages;
nixosModules.default = self.nixosModules.syndicate-server;
2022-03-14 19:12:50 +00:00
nixosModules.syndicate-server =
# A little hack to apply our overlay to this module only.
{ config, lib, pkgs, ... }:
(import ./nixos/syndicate-server.nix) {
2022-03-14 19:12:50 +00:00
inherit config lib;
pkgs = pkgs.extend self.overlays.default;
};
devShells = self.lib.mapAttrs (system: pkgs:
with pkgs; {
default =
mkShell { packages = builtins.attrValues self.packages.${system}; };
}) self.legacyPackages;
2022-06-29 13:48:45 +00:00
checks = self.lib.mapAttrs (system: pkgs':
with import (nixpkgs + "/nixos/lib/testing-python.nix") {
inherit system;
pkgs = pkgs';
}; {
simple = simpleTest {
name = "http";
nodes.machine = { config, pkgs, ... }: {
imports = [ self.nixosModules.syndicate-server ];
nixpkgs.pkgs = pkgs';
services.syndicate.tty1 = {
enable = true;
user = "loser";
config = [ ];
};
users.users.loser.isNormalUser = true;
};
testScript = ''
machine.wait_for_job("syndicate-tty1")
'';
};
2022-06-29 13:48:45 +00:00
}) { inherit (self.legacyPackages) x86_64-linux; };
2022-03-14 19:12:50 +00:00
};
2021-09-02 10:16:35 +00:00
}