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;
|
cfg = config.dyn-gandi;
|
||||||
package = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
package = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
inherit (lib) mkIf mkEnableOption mkOption types;
|
inherit (lib) mkIf mkEnableOption mkOption types;
|
||||||
|
|
||||||
|
format = pkgs.formats.json {};
|
||||||
|
configFile = format.generate "config.json" cfg.settings;
|
||||||
in {
|
in {
|
||||||
options.dyn-gandi = {
|
options.dyn-gandi = {
|
||||||
enable = mkEnableOption "dyn-gandi";
|
enable = mkEnableOption "dyn-gandi";
|
||||||
@ -40,10 +43,6 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [package]; # TODO: make this architecture independent
|
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
|
systemd.user.services.dyn-gandi = mkIf (cfg.timer
|
||||||
!= null) {
|
!= null) {
|
||||||
Unit = {
|
Unit = {
|
||||||
@ -54,7 +53,7 @@ in {
|
|||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Type = "oneshot";
|
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 {
|
config = mkIf cfg.enable {
|
||||||
environment = {
|
environment.systemPackages = [package];
|
||||||
systemPackages = [package];
|
|
||||||
|
|
||||||
# etc."dyn-gandi.json" = {
|
|
||||||
# text = builtins.toJSON cfg.settings;
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.dyn-gandi = mkIf (cfg.timer
|
systemd.services.dyn-gandi = mkIf (cfg.timer
|
||||||
!= null) {
|
!= null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user