diff --git a/flake.nix b/flake.nix index e37e52c4..4064f78b 100644 --- a/flake.nix +++ b/flake.nix @@ -15,42 +15,30 @@ inputs.flake-root.flakeModule ]; perSystem = { self', system, lib, config, pkgs, ... }: { - apps.default = { - type = "app"; - program = - let - run-hackage-server = pkgs.writeShellApplication { - name = "run-hackage-server"; - runtimeInputs = [ config.packages.default ]; - text = '' - if [ ! -d "state" ]; then - hackage-server init --static-dir=datafiles --state-dir=state - else - echo "'state' state-dir already exists" - fi - hackage-server run \ - --static-dir=datafiles \ - --state-dir=state \ - --base-uri=http://127.0.0.1:8080 - ''; - }; - in "${lib.getExe run-hackage-server}"; + apps.default.program = pkgs.writeShellApplication { + name = "run-hackage-server"; + runtimeInputs = [ config.packages.default ]; + text = '' + if [ ! -d "state" ]; then + hackage-server init --static-dir=datafiles --state-dir=state + else + echo "'state' state-dir already exists" + fi + hackage-server run \ + --static-dir=datafiles \ + --state-dir=state \ + --base-uri=http://127.0.0.1:8080 + ''; }; - apps.mirror-hackage-server = { - type = "app"; - program = - let - mirror-hackage-server = pkgs.writeShellApplication { - name = "mirror-hackage-server"; - runtimeInputs = [ config.packages.default ]; - text = '' - echo 'Copying packages from real Hackage Server into local Hackage Server.' - echo 'This assumes the local Hackage Server uses default credentials;' - echo 'otherwise, override in nix-default-servers.cfg' - hackage-mirror nix-default-servers.cfg - ''; - }; - in "${lib.getExe mirror-hackage-server}"; + apps.mirror-hackage-server.program = pkgs.writeShellApplication { + name = "mirror-hackage-server"; + runtimeInputs = [ config.packages.default ]; + text = '' + echo 'Copying packages from real Hackage Server into local Hackage Server.' + echo 'This assumes the local Hackage Server uses default credentials;' + echo 'otherwise, override in nix-default-servers.cfg' + hackage-mirror nix-default-servers.cfg + ''; }; packages.default = config.packages.hackage-server; haskellProjects.default = {