Skip to content
Snippets Groups Projects
Commit b88270cc authored by Daniel Firth's avatar Daniel Firth
Browse files

nixpkgs-fmt

parent b32e2649
Branches
No related merge requests found
......@@ -19,82 +19,83 @@
, nixpkgs
, ...
}:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
with pkgs.lib;
with pkgs.writers;
with lint-utils.writers.${system};
let
horizon-gen-nix-app = get-flake horizon-gen-nix;
haskellLib = pkgs.haskell.lib.compose;
legacyPackages = pkgs.callPackage (nixpkgs + /pkgs/development/haskell-modules) {
buildHaskellPackages = pkgs.haskell.packages.ghc942;
compilerConfig = pkgs.callPackage ./configuration-ghc-9.4.x.nix { inherit haskellLib; };
configurationCommon = import ./configuration.nix;
configurationNix = { pkgs, haskellLib }: self: super: { };
ghc = pkgs.haskell.compiler.ghc942;
inherit haskellLib;
initialPackages = import ./initial-packages.nix;
nonHackagePackages = self: super: { };
};
flake-utils.lib.eachSystem [ "x86_64-linux" ]
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
with pkgs.lib;
with pkgs.writers;
with lint-utils.writers.${system};
let
horizon-gen-nix-app = get-flake horizon-gen-nix;
haskellLib = pkgs.haskell.lib.compose;
legacyPackages = pkgs.callPackage (nixpkgs + /pkgs/development/haskell-modules) {
buildHaskellPackages = pkgs.haskell.packages.ghc942;
compilerConfig = pkgs.callPackage ./configuration-ghc-9.4.x.nix { inherit haskellLib; };
configurationCommon = import ./configuration.nix;
configurationNix = { pkgs, haskellLib }: self: super: { };
ghc = pkgs.haskell.compiler.ghc942;
inherit haskellLib;
initialPackages = import ./initial-packages.nix;
nonHackagePackages = self: super: { };
};
packages = filterAttrs
(n: v: v != null
packages = filterAttrs
(n: v: v != null
&& builtins.typeOf v == "set"
&& pkgs.lib.hasAttr "type" v
&& v.type == "derivation"
&& v.meta.broken == false)
legacyPackages;
horizon-gen-gitlab-ci = writeBashBin "gen-gitlab-ci" "${pkgs.dhall-json}/bin/dhall-to-yaml --file .gitlab-ci.dhall";
run-impure-tests = writePorcelainOrDieBin {
name = "run-impure-tests";
src = ./.;
command = ''
export PATH=$PATH:${pkgs.nix-prefetch-git}/bin:${pkgs.cabal-install}/bin
cabal update
rm pkgs -rf && nix run .#horizon-gen-nix;
nixpkgs-fmt pkgs/*
'';
advice = "Try removing the offending packages from pkgs/ and running nix run .#horizon-gen-nix";
};
legacyPackages;
horizon-gen-gitlab-ci = writeBashBin "gen-gitlab-ci" "${pkgs.dhall-json}/bin/dhall-to-yaml --file .gitlab-ci.dhall";
run-impure-tests = writePorcelainOrDieBin {
name = "run-impure-tests";
src = ./.;
command = ''
export PATH=$PATH:${pkgs.nix-prefetch-git}/bin:${pkgs.cabal-install}/bin
cabal update
rm pkgs -rf && nix run .#horizon-gen-nix;
nixpkgs-fmt pkgs/*
'';
advice = "Try removing the offending packages from pkgs/ and running nix run .#horizon-gen-nix";
};
run-impure-tests-app = {
type = "app";
program = "${run-impure-tests}/bin/run-impure-tests";
};
run-impure-tests-app = {
type = "app";
program = "${run-impure-tests}/bin/run-impure-tests";
};
in
{
in
{
apps = {
apps = {
horizon-gen-nix = horizon-gen-nix-app.outputs.apps.${system}.horizon-gen-nix;
horizon-gen-nix = horizon-gen-nix-app.outputs.apps.${system}.horizon-gen-nix;
horizon-gen-gitlab-ci = {
type = "app";
program = "${horizon-gen-gitlab-ci}/bin/gen-gitlab-ci";
};
horizon-gen-gitlab-ci = {
type = "app";
program = "${horizon-gen-gitlab-ci}/bin/gen-gitlab-ci";
};
run-impure-tests = run-impure-tests-app;
};
run-impure-tests = run-impure-tests-app;
};
checks = {
dhall-format = lint-utils.outputs.linters.${system}.dhall-format { src = ./.; };
nixpkgs-fmt = lint-utils.outputs.linters.${system}.nixpkgs-fmt { src = ./.; };
};
checks = {
dhall-format = lint-utils.outputs.linters.${system}.dhall-format { src = ./.; };
nixpkgs-fmt = lint-utils.outputs.linters.${system}.nixpkgs-fmt { src = ./.; };
};
inherit legacyPackages;
inherit legacyPackages;
inherit packages;
inherit packages;
}) // {
}) // {
templates = rec {
default = minimal;
......@@ -104,6 +105,6 @@
path = ./templates/minimal;
};
};
};
};
};
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment