moved config insto nix store for home manager module
This commit is contained in:
parent
84f4b11b9c
commit
7eb2ab7fe3
@ -7,6 +7,9 @@ self: {
|
||||
cfg = config.dyn-gandi;
|
||||
package = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
inherit (lib) mkIf mkEnableOption mkOption types;
|
||||
|
||||
format = pkgs.formats.json {};
|
||||
configFile = format.generate "config.json" cfg.settings;
|
||||
in {
|
||||
options.dyn-gandi = {
|
||||
enable = mkEnableOption "dyn-gandi";
|
||||
@ -40,10 +43,6 @@ in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [package]; # TODO: make this architecture independent
|
||||
|
||||
xdg.configFile."dyn-gandi/config.json" = {
|
||||
text = builtins.toJSON cfg.settings;
|
||||
};
|
||||
|
||||
systemd.user.services.dyn-gandi = mkIf (cfg.timer
|
||||
!= null) {
|
||||
Unit = {
|
||||
@ -54,7 +53,7 @@ in {
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${package}/bin/dyn_gandi"; # TODO: add config file via command line options
|
||||
ExecStart = "${package}/bin/dyn_gandi --config ${configFile}";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -42,13 +42,7 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment = {
|
||||
systemPackages = [package];
|
||||
|
||||
# etc."dyn-gandi.json" = {
|
||||
# text = builtins.toJSON cfg.settings;
|
||||
# };
|
||||
};
|
||||
environment.systemPackages = [package];
|
||||
|
||||
systemd.services.dyn-gandi = mkIf (cfg.timer
|
||||
!= null) {
|
||||
|
Loading…
Reference in New Issue
Block a user