Skip to content

Commit

Permalink
nixos/dysnomia: move into services (#351046)
Browse files Browse the repository at this point in the history
  • Loading branch information
h7x4 authored Oct 29, 2024
2 parents aeea90e + 8f96ccf commit c3632dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/misc/disnix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ in
###### implementation

config = lib.mkIf cfg.enable {
dysnomia.enable = true;
services.dysnomia.enable = true;

environment.systemPackages = [ pkgs.disnix ] ++ lib.optional cfg.useWebServiceInterface pkgs.DisnixWebService;
environment.variables.PATH = lib.optionals cfg.enableProfilePath (map (profileName: "/nix/var/nix/profiles/disnix/${profileName}/bin" ) cfg.profiles);
Expand Down Expand Up @@ -74,7 +74,7 @@ in

restartIfChanged = false;

path = [ config.nix.package cfg.package config.dysnomia.package "/run/current-system/sw" ];
path = [ config.nix.package cfg.package config.services.dysnomia.package "/run/current-system/sw" ];

environment = {
HOME = "/root";
Expand Down
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 c3632dc

Please sign in to comment.