diff --git a/flake.nix b/flake.nix index 70ad213..4b5e8ad 100644 --- a/flake.nix +++ b/flake.nix @@ -23,7 +23,7 @@ ) // { nixosModules = { - night-light = import ./module.nix; + night-light = import ./module.nix self; }; }; } diff --git a/module.nix b/module.nix index e1a8edf..3ffba08 100644 --- a/module.nix +++ b/module.nix @@ -1,3 +1,4 @@ +self: { config, lib, @@ -7,8 +8,8 @@ with lib; let + inherit (pkgs.stdenv.hostPlatform) system; cfg = config.services.nightLight; - pkg = pkgs.callPackage ./default.nix { }; in { options.services.nightLight = { @@ -29,7 +30,7 @@ in after = [ "network.target" ]; serviceConfig = { - ExecStart = "${pkg}/bin/NightLight"; + ExecStart = "${self.packages.${system}.default}/bin/NightLight"; Restart = "on-failure"; User = "night-light"; Group = "night-light";