diff options
| author | uakci <uakci@uakci.pl> | 2022-02-23 20:35:19 +0100 |
|---|---|---|
| committer | uakci <uakci@uakci.pl> | 2022-02-23 20:35:19 +0100 |
| commit | 59f26710921c2c352d002bb38e185f6a4f8629f3 (patch) | |
| tree | 2098e900c526d471e15417bfa479787a9633721c | |
| parent | remove ${system} subpath from flake nixosModule (diff) | |
| download | nuogai-59f26710921c2c352d002bb38e185f6a4f8629f3.tar.gz nuogai-59f26710921c2c352d002bb38e185f6a4f8629f3.zip | |
flake purity fix
| -rw-r--r-- | flake.nix | 9 | ||||
| -rw-r--r-- | module.nix | 8 |
2 files changed, 8 insertions, 9 deletions
@@ -12,11 +12,7 @@ outputs = { self, nixpkgs, gomod2nix, nuigui-upstream , serial-predicate-engine-upstream, flake-utils, ... }: - { - inherit (gomod2nix) devShell; - nixosModule = { config, pkgs, lib, ... }@args: - import ./module.nix (args // { inherit self; }); - } // flake-utils.lib.eachDefaultSystem (system: + flake-utils.lib.eachDefaultSystem (system: let pkgs = (import nixpkgs { inherit system; @@ -71,5 +67,8 @@ in { defaultPackage = nuogai; packages = schemePkgs // { inherit toaqScript nuogai; }; + inherit (gomod2nix) devShell; + nixosModule = { config, pkgs, lib, ... }@args: + import ./module.nix (args // { inherit self system; }); }); } @@ -11,9 +11,9 @@ in with lib; { ]); tokenPath = mkOption { type = types.path; }; }; - config = mkIf cfg.enable { - fonts.fonts = [ self.packages.${system}.toaqScript ]; - systemd.services = lib.mapAttrs (k: v: + config = let enable = cfg.enable; in { + fonts.fonts = optionals enable [ self.packages.${system}.toaqScript ]; + systemd.services = optionalAttrs enable (mapAttrs (k: v: { wants = [ "network-online.target" ]; } // (v self.packages.${system}.${k})) { @@ -41,6 +41,6 @@ in with lib; { serviceConfig.ExecStart = "${pkg}/bin/serial-predicate-engine"; environment.PORT = toString cfg.ports.serial-predicate-engine; }; - }; + }); }; } |
