Skip to content

Commit

Permalink
fix recursion???
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldsteinE committed Sep 3, 2022
1 parent 6f89cb8 commit 1bf2739
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ classified: { config, pkgs, ... }:

let
cfg = config.classified;
# enabled = assert cfg.files != { } -> cfg.keys != { }; cfg.files != { };
enabled = true;
enabled = assert cfg.files != { } -> cfg.keys != { }; cfg.files != { };
ifEnabled = alt: x: if enabled then x else alt;
jsonConfig = builtins.toFile "classified.json" (builtins.toJSON cfg);

in
Expand Down Expand Up @@ -74,22 +74,21 @@ in

config = {
environment.systemPackages = [ classified ];
} // (if enabled then {
systemd.services.classified = {
systemd.services.classified = ifEnabled { } {
wantedBy = [ "multi-user.target" ];
restartTriggers = [ jsonConfig ];
script = ''
${classified}/bin/classified batch ${jsonConfig}
${pkgs.coreutils}/bin/sleep inf
'';
};
systemd.mounts = [{
systemd.mounts = ifEnabled [ ] [{
what = "tmpfs";
type = "tmpfs";
where = cfg.targetDir;
requiredBy = [ "classified.service" ];
before = [ "classified.service" ];
partOf = [ "classified.service" ];
}];
} else { });
};
}

0 comments on commit 1bf2739

Please sign in to comment.