Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# finix - modular services

Support for [NixOS modular services](https://nixos.org/manual/nixos/unstable/#modular-services) for `finix`.
Support for [Modular services](https://nixos.org/manual/nixos/unstable/#modular-services) for `finix`.

There is a Matrix room for discussions:

Expand Down
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 76 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,79 @@
{
description = "Support for NixOS modular services in finix";

outputs = _: {
nixosModules.default = import ./modules;
description = "Support for Modular services in finix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
finix.url = "github:finix-community/finix";
};

outputs =
{
self,
nixpkgs,
finix,
}:
let
finixSystems = [
"x86_64-linux"
"aarch64-linux"
];

forAllFinixSystems =
f:
nixpkgs.lib.genAttrs finixSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
in
f pkgs system
);
in
{
nixosModules.default = import ./modules/service.nix;

checks = forAllFinixSystems (
pkgs: system: {
default = pkgs.testers.modularServiceCompliance {
callReload = path: "initctl reload ${path}";
sharedDir = ".finix-test";
evalConfig =
{ services, ... }:
let
machine = finix.lib.finixSystem {
inherit (pkgs) lib;
modules = [
{
nixpkgs.pkgs = nixpkgs.lib.mkDefault pkgs;
}
{
system.services = services;
}
self.nixosModules.default
];
};
in
{
config = machine.config.system.services;
checkDrv = machine.config.system.build.toplevel;
};
mkTest =
{
name,
services,
testExe,
}:
finix.lib.mkTest {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc/@aanderse we might need to expose mkTest.

@eveeifyeve eveeifyeve Sep 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inherit name;
nodes.machine = {
imports = [ self.nixosModules.default ];
system.services = services;
};
testScript = ''
machine.wait_for_condition("service/syslogd/ready")
machine.succeed("${testExe}")
'';
};
};
}
);
};
}
47 changes: 0 additions & 47 deletions modules/default.nix

This file was deleted.

33 changes: 0 additions & 33 deletions modules/finit/service.nix

This file was deleted.

29 changes: 0 additions & 29 deletions modules/finit/system.nix

This file was deleted.

32 changes: 0 additions & 32 deletions modules/portable/assertions.nix

This file was deleted.

64 changes: 0 additions & 64 deletions modules/portable/config-data-item.nix

This file was deleted.

45 changes: 0 additions & 45 deletions modules/portable/config-data.nix

This file was deleted.

Loading