Skip to content

Commit

Permalink
nixos/dysnomia: move into services
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Oct 24, 2024
1 parent ccae71c commit caf9b73
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions nixos/modules/services/misc/dysnomia.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{pkgs, lib, config, ...}:
let
cfg = config.dysnomia;
cfg = config.services.dysnomia;

printProperties = properties:
lib.concatMapStrings (propertyName:
Expand Down Expand Up @@ -79,7 +79,7 @@ let
in
{
options = {
dysnomia = {
services.dysnomia = {

enable = lib.mkOption {
type = lib.types.bool;
Expand Down Expand Up @@ -142,6 +142,10 @@ in
};
};

imports = [
(lib.mkRenamedOptionModule ["dysnomia"] ["services" "dysnomia"])
];

config = lib.mkIf cfg.enable {

environment.etc = {
Expand All @@ -164,7 +168,7 @@ in

environment.systemPackages = [ cfg.package ];

dysnomia.package = pkgs.dysnomia.override (origArgs: dysnomiaFlags // lib.optionalAttrs (cfg.enableLegacyModules) {
services.dysnomia.package = pkgs.dysnomia.override (origArgs: dysnomiaFlags // lib.optionalAttrs (cfg.enableLegacyModules) {
enableLegacy = builtins.trace ''
WARNING: Dysnomia has been configured to use the legacy 'process' and 'wrapper'
modules for compatibility reasons! If you rely on these modules, consider
Expand All @@ -181,7 +185,7 @@ in
'' true;
});

dysnomia.properties = {
services.dysnomia.properties = {
hostname = config.networking.hostName;
inherit (pkgs.stdenv.hostPlatform) system;

Expand All @@ -208,7 +212,7 @@ in
++ lib.optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository";
};

dysnomia.containers = lib.recursiveUpdate ({
services.dysnomia.containers = lib.recursiveUpdate ({
process = {};
wrapper = {};
}
Expand Down

0 comments on commit caf9b73

Please sign in to comment.