feat: fixed horrible lsp problem

This commit is contained in:
Nick 2025-04-11 13:29:01 -05:00
parent 38b0583e7f
commit c4db6a0617
7 changed files with 122 additions and 103 deletions

View file

@ -1 +1 @@
/nix/store/a2kn134qqb4whsh5y4bikcryhka2dgl4-pre-commit-config.json /nix/store/si1f73qc72k63h6kqdb5yz230p0vlnm4-pre-commit-config.json

108
flake.lock generated
View file

@ -1,15 +1,31 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1736143030, "lastModified": 1743550720,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,13 +33,34 @@
"type": "indirect" "type": "indirect"
} }
}, },
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"haskell-flake": { "haskell-flake": {
"locked": { "locked": {
"lastModified": 1736651225, "lastModified": 1743922999,
"narHash": "sha256-uLIDMc3DjZuXCKydXLDH6Inb/35qIIGa6acGytYkQCs=", "narHash": "sha256-Wh+Zak8sZUgair4pnZR0mLrLIhhInHS8izj7C1H10B8=",
"owner": "srid", "owner": "srid",
"repo": "haskell-flake", "repo": "haskell-flake",
"rev": "4b12bdd07b3aee5e4e5768b1b3db3c8b429af446", "rev": "d102e0f8a1773b1a63a616faef670cf5e129f9e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -34,54 +71,77 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1736883708, "lastModified": 1744316434,
"narHash": "sha256-uQ+NQ0/xYU0N1CnXsa2zghgNaOPxWpMJXSUJJ9W7140=", "narHash": "sha256-lzFCg/1C39pyY2hMB2gcuHV79ozpOz/Vu15hdjiFOfI=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eb62e6aa39ea67e0b8018ba8ea077efe65807dc8", "rev": "d19cf9dfc633816a437204555afeb9e722386b76",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1735774519, "lastModified": 1743296961,
"narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"type": "tarball", "owner": "nix-community",
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" "repo": "nixpkgs.lib",
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"type": "github"
}, },
"original": { "original": {
"type": "tarball", "owner": "nix-community",
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" "repo": "nixpkgs.lib",
"type": "github"
} }
}, },
"nixpkgs-stable": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1720535198, "lastModified": 1730768919,
"narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=", "narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5", "rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-23.11", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1742649964,
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"haskell-flake": "haskell-flake", "haskell-flake": "haskell-flake",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable" "pre-commit-hooks-nix": "pre-commit-hooks-nix"
} }
} }
}, },

View file

@ -1,30 +1,22 @@
{ {
description = "Elm Environment";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
haskell-flake.url = "github:srid/haskell-flake"; haskell-flake.url = "github:srid/haskell-flake";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
}; };
outputs = inputs @ { outputs =
flake-parts, inputs@{
self, self,
... nixpkgs,
}: let flake-parts,
system = "x86_64-linux"; ...
in }:
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ imports = [
./parts
inputs.haskell-flake.flakeModule inputs.haskell-flake.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
./parts
]; ];
systems = [system]; systems = nixpkgs.lib.systems.flakeExposed;
perSystem = {pkgs, ...}: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
};
_module.args.pkgs-stable = import inputs.nixpkgs-stable {
inherit system;
};
};
}; };
} }

View file

@ -1,30 +0,0 @@
module Auth exposing (User, onPageLoad, viewLoadingPage)
import Auth.Action
import Dict
import Route exposing (Route)
import Route.Path
import Shared
import View exposing (View)
type alias User =
{}
{-| Called before an auth-only page is loaded.
-}
onPageLoad : Shared.Model -> Route () -> Auth.Action.Action User
onPageLoad shared route =
Auth.Action.pushRoute
{ path = Route.Path.NotFound_
, query = Dict.empty
, hash = Nothing
}
{-| Renders whenever `Auth.Action.showLoadingPage` is returned from `onPageLoad`.
-}
viewLoadingPage : Shared.Model -> Route () -> View Never
viewLoadingPage shared route =
View.fromString "Loading..."

View file

@ -1,40 +1,32 @@
{ pkgs, config, ... }:
{ {
pkgs,
config,
pkgs-stable,
...
}: {
haskellProjects.default = { haskellProjects.default = {
devShell = { devShell = {
enable = true; enable = true;
tools = hp: { tools = hp: {
inherit inherit (hp) cabal-fmt haskell-language-server;
(hp)
cabal-fmt
haskell-language-server
;
inherit inherit (pkgs)
(pkgs) age
alejandra just
nil
nixd
sops
ssh-to-age
nixfmt-rfc-style
dhall dhall
dhall-json dhall-json
dhall-lsp-server dhall-lsp-server
helix-gpt helix-gpt
just
libz libz
ngrep ngrep
nil
sops
ssh-to-age
stripe-cli stripe-cli
vscode-langservers-extracted vscode-langservers-extracted
zlib zlib
; ;
inherit inherit (pkgs.elmPackages)
(pkgs-stable.elmPackages)
elm elm
elm-format elm-format
elm-land elm-land
@ -43,17 +35,11 @@
elm-test elm-test
; ;
inherit inherit (pkgs.haskellPackages) nixfmt;
(pkgs.nodePackages_latest)
dotenv-cli
forever
nodejs
npm
typescript-language-server
;
}; };
hlsCheck.enable = true; hlsCheck.enable = true;
mkShellArgs.shellHook = "${config.pre-commit.installationScript}";
}; };
}; };
} }

4
parts/config/packages.nix Executable file
View file

@ -0,0 +1,4 @@
{ self, ... }:
{
packages.default = self.packages.example;
}

7
parts/config/pre-commit.nix Executable file
View file

@ -0,0 +1,7 @@
{
pre-commit.settings.hooks = {
nixfmt-rfc-style.enable = true;
commitizen.enable = true;
statix.enable = true;
};
}