summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruakci <uakci@uakci.pl>2022-02-23 20:35:19 +0100
committeruakci <uakci@uakci.pl>2022-02-23 20:35:19 +0100
commit59f26710921c2c352d002bb38e185f6a4f8629f3 (patch)
tree2098e900c526d471e15417bfa479787a9633721c
parentremove ${system} subpath from flake nixosModule (diff)
downloadnuogai-59f26710921c2c352d002bb38e185f6a4f8629f3.tar.gz
nuogai-59f26710921c2c352d002bb38e185f6a4f8629f3.zip
flake purity fix
-rw-r--r--flake.nix9
-rw-r--r--module.nix8
2 files changed, 8 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index f63229b..06988d2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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; });
});
}
diff --git a/module.nix b/module.nix
index f06b884..54881de 100644
--- a/module.nix
+++ b/module.nix
@@ -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;
};
- };
+ });
};
}