nixos/dysnomia: move into services (#351046)
This commit is contained in:
commit
c3632dc3aa
@ -40,7 +40,7 @@ in
|
|||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
dysnomia.enable = true;
|
services.dysnomia.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.disnix ] ++ lib.optional cfg.useWebServiceInterface pkgs.DisnixWebService;
|
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);
|
environment.variables.PATH = lib.optionals cfg.enableProfilePath (map (profileName: "/nix/var/nix/profiles/disnix/${profileName}/bin" ) cfg.profiles);
|
||||||
@ -74,7 +74,7 @@ in
|
|||||||
|
|
||||||
restartIfChanged = false;
|
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 = {
|
environment = {
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{pkgs, lib, config, ...}:
|
{pkgs, lib, config, ...}:
|
||||||
let
|
let
|
||||||
cfg = config.dysnomia;
|
cfg = config.services.dysnomia;
|
||||||
|
|
||||||
printProperties = properties:
|
printProperties = properties:
|
||||||
lib.concatMapStrings (propertyName:
|
lib.concatMapStrings (propertyName:
|
||||||
@ -79,7 +79,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
dysnomia = {
|
services.dysnomia = {
|
||||||
|
|
||||||
enable = lib.mkOption {
|
enable = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
@ -142,6 +142,10 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule ["dysnomia"] ["services" "dysnomia"])
|
||||||
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
@ -164,7 +168,7 @@ in
|
|||||||
|
|
||||||
environment.systemPackages = [ cfg.package ];
|
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 ''
|
enableLegacy = builtins.trace ''
|
||||||
WARNING: Dysnomia has been configured to use the legacy 'process' and 'wrapper'
|
WARNING: Dysnomia has been configured to use the legacy 'process' and 'wrapper'
|
||||||
modules for compatibility reasons! If you rely on these modules, consider
|
modules for compatibility reasons! If you rely on these modules, consider
|
||||||
@ -181,7 +185,7 @@ in
|
|||||||
'' true;
|
'' true;
|
||||||
});
|
});
|
||||||
|
|
||||||
dysnomia.properties = {
|
services.dysnomia.properties = {
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
inherit (pkgs.stdenv.hostPlatform) system;
|
inherit (pkgs.stdenv.hostPlatform) system;
|
||||||
|
|
||||||
@ -208,7 +212,7 @@ in
|
|||||||
++ lib.optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository";
|
++ lib.optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository";
|
||||||
};
|
};
|
||||||
|
|
||||||
dysnomia.containers = lib.recursiveUpdate ({
|
services.dysnomia.containers = lib.recursiveUpdate ({
|
||||||
process = {};
|
process = {};
|
||||||
wrapper = {};
|
wrapper = {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user