Skip to content

Commit 90f6a7d

Browse files
committed
Deadnix cleanup and refactor common shellHook and tools into settings.nix
1 parent 6f2a01e commit 90f6a7d

File tree

28 files changed

+141
-177
lines changed

28 files changed

+141
-177
lines changed

api/build.nix

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
self@{ inputs, ... }:
1+
{ inputs, ... }:
22
{
33
perSystem = { pkgs, system, config, ... }:
44
let
@@ -12,14 +12,9 @@ self@{ inputs, ... }:
1212
pkgs.protobuf
1313
pkgs.haskellPackages.proto-lens-protoc
1414
pkgs.protoc-gen-doc
15-
]; # ++ builtins.attrValues commonTools;
15+
] ++ config.settings.shell.tools;
1616

17-
shellHookd = ''
18-
export LC_CTYPE=C.UTF-8;
19-
export LC_ALL=C.UTF-8;
20-
export LANG=C.UTF-8;
21-
${config.pre-commit.installationScript}
22-
'';
17+
shellHook = config.settings.shell.hook;
2318
};
2419

2520
packages = {

docs/build.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{ inputs, lib, ... }: {
2-
perSystem = { pkgs, system, inputs', config, ... }:
1+
_: {
2+
perSystem = { pkgs, config, ... }:
33
{
44
devShells.dev-docs = pkgs.mkShell {
55
name = "docs-env";

experimental/build.nix

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ inputs, ... }: {
1+
_: {
22
perSystem = { pkgs, config, ... }:
33
{
44

@@ -19,14 +19,9 @@
1919
pkgs.protobuf
2020
pkgs.haskellPackages.proto-lens-protoc
2121
pkgs.swiPrologWithGui
22-
]; # ++ builtins.attrValues commonTools;
22+
] ++ config.settings.shell.tools;
2323

24-
shellHook = ''
25-
export LC_CTYPE=C.UTF-8;
26-
export LC_ALL=C.UTF-8;
27-
export LANG=C.UTF-8;
28-
${config.pre-commit.installationScript}
29-
'';
24+
shellHook = config.settings.shell.hook;
3025
};
3126

3227
};

extras/build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
imports = [
44
inputs.flake-parts.flakeModules.easyOverlay # Adds perSystem.overlayAttrs
55
];
6-
perSystem = { pkgs, config, ... }:
6+
perSystem = { pkgs, ... }:
77
{
88

99
overlayAttrs = {

extras/lbf-nix/lbf-haskell.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ lbf:
77
# LambdaBuffers Haskell Codegen
88
lbg-haskell:
99
let
10-
utils = import ./utils.nix pkgs;
11-
1210
lbfHaskellOpts =
1311
{
1412
# Source that is passed to `lbf` as the `--import-path` flag and used to find `files`.

extras/lbf-nix/lbf-plutus-purescript.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let
1616
};
1717
classes = {
1818
default = [ ];
19-
override = cls: [ "Prelude.Eq" "Plutus.V1.PlutusData" ]; # TODO(bladyjoker): When Json instances are implemented for CTL Plutus types, bring back Json.
19+
override = _: [ "Prelude.Eq" "Plutus.V1.PlutusData" ]; # TODO(bladyjoker): When Json instances are implemented for CTL Plutus types, bring back Json.
2020
};
2121
configs = {
2222
default = [ ];

extras/lbf-nix/lbf-purescript.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ lbf:
77
# LambdaBuffers Purescript Codegen
88
lbg-purescript:
99
let
10-
utils = import ./utils.nix pkgs;
11-
1210
lbfPurescriptOpts =
1311
{
1412
# Source that is passed to `lbf` as the `--import-path` flag and used to find `files`.

flake.nix

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
purifix.url = "github:purifix/purifix";
1515
};
1616

17-
outputs = inputs@{ self, nixpkgs, flake-utils, pre-commit-hooks, protobufs-nix, mlabs-tooling, hci-effects, iohk-nix, flake-parts, purifix, ... }:
17+
outputs = inputs@{ flake-parts, ... }:
1818
flake-parts.lib.mkFlake { inherit inputs; } {
1919
imports = [
2020
(import ./pkgs.nix)
2121
(import ./settings.nix)
22-
(import ./hercules-ci.nix)
2322
(import ./pre-commit.nix)
23+
(import ./hercules-ci.nix)
2424
(import ./docs/build.nix)
2525
(import ./extras/build.nix)
2626
(import ./extras/lbf-nix/build.nix)
@@ -45,23 +45,5 @@
4545
];
4646
debug = true;
4747
systems = [ "x86_64-linux" "x86_64-darwin" ];
48-
perSystem = { system, config, pkgs, ... }:
49-
let
50-
inherit self;
51-
52-
# pre-commit-hooks.nix
53-
54-
fourmolu = pkgs.haskell.packages.ghc924.fourmolu;
55-
56-
apply-refact = pkgs.haskellPackages.apply-refact;
57-
58-
commonTools = {
59-
inherit (pre-commit-hooks.outputs.packages.${system}) nixpkgs-fmt cabal-fmt shellcheck hlint typos markdownlint-cli dhall purty;
60-
inherit (pkgs) protolint txtpbfmt;
61-
inherit fourmolu;
62-
inherit apply-refact;
63-
};
64-
in
65-
{ };
6648
};
6749
}

hercules-ci.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ self, inputs, ... }: {
1+
{ inputs, ... }: {
22
imports = [
33
inputs.hci-effects.flakeModule # Adds hercules-ci and herculesCI options
44
];
@@ -17,7 +17,7 @@
1717
};
1818
};
1919
hercules-ci.github-pages.branch = "main";
20-
perSystem = { pkgs, config, ... }: {
20+
perSystem = { config, ... }: {
2121
hercules-ci.github-pages.settings.contents = config.packages.lambda-buffers-book;
2222
};
2323

lambda-buffers-codegen/build.nix

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
self@{ inputs, ... }:
22
{
3-
perSystem = { pkgs, system, inputs', config, ... }:
3+
perSystem = { pkgs, config, ... }:
44
let
55
project = { lib, ... }: {
66
src = ./.;
@@ -34,19 +34,14 @@ self@{ inputs, ... }:
3434

3535
exactDeps = true;
3636

37-
#nativeBuildInputs = builtins.attrValues commonTools;
37+
nativeBuildInputs = config.settings.shell.tools;
3838

3939
tools = {
4040
cabal = { };
4141
haskell-language-server = { };
4242
};
4343

44-
shellHook = lib.mkForce ''
45-
export LC_CTYPE=C.UTF-8;
46-
export LC_ALL=C.UTF-8;
47-
export LANG=C.UTF-8;
48-
${config.pre-commit.installationScript}
49-
'';
44+
shellHook = lib.mkForce config.settings.shell.hook;
5045
};
5146
};
5247
hsNixFlake = (pkgs.haskell-nix.cabalProject' [

0 commit comments

Comments
 (0)