-
Notifications
You must be signed in to change notification settings - Fork 2
modular-services: update and cleanup #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
814b7a6
877ed7b
786bffb
783493c
563af80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| 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 { | ||
| inherit name; | ||
| nodes.machine = { | ||
| imports = [ self.nixosModules.default ]; | ||
| system.services = services; | ||
| }; | ||
| testScript = '' | ||
| machine.wait_for_condition("service/syslogd/ready") | ||
| machine.succeed("${testExe}") | ||
| ''; | ||
| }; | ||
| }; | ||
| } | ||
| ); | ||
| }; | ||
| } | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talking in the finix discord, this is a gap.
Ref: https://discord.com/channels/1488637726340288712/1488637727313494049/1545520476971991050