Merge remote-tracking branch 'refs/remotes/origin/nixos' into nixos

stylix
Moritz Böhme 2024-01-30 21:44:17 +01:00
commit 89104209e8
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
4 changed files with 48 additions and 38 deletions

View File

@ -64,7 +64,7 @@ local on_attach_def = function(client, bufnr)
}, },
i = { i = {
function() function()
vim.lsp.inlay_hint(bufnr, nil) vim.lsp.inlay_hint.enable(bufnr, not vim.lsp.inlay_hint.is_enabled(bufnr))
end, end,
"LSP inlay hints", "LSP inlay hints",
}, },

3
statix.toml Normal file
View File

@ -0,0 +1,3 @@
disabled = []
nix_version = '2.4'
ignore = ['.direnv' 'templates']

View File

@ -1,2 +0,0 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"

View File

@ -1,50 +1,59 @@
{ {
inputs = { inputs = {
crane = { crane.url = "github:ipetkov/crane";
url = "github:ipetkov/crane"; crane.inputs.nixpkgs.follows = "nixpkgs";
inputs = { fenix.url = "github:nix-community/fenix";
flake-utils.follows = "flake-utils"; fenix.inputs.nixpkgs.follows = "nixpkgs";
nixpkgs.follows = "nixpkgs";
};
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
}; };
outputs = { self, crane, fenix, flake-utils, nixpkgs }: outputs = { self, crane, flake-utils, nixpkgs, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = (import nixpkgs) { inherit (pkgs) lib;
inherit system; pkgs = import nixpkgs { inherit system; };
}; fenix = inputs.fenix.packages.${system};
toolchain = fenix.packages.${system}.stable;
craneLib = crane.lib.${system}.overrideToolchain toolchain.toolchain; craneLib = crane.lib.${system}.overrideToolchain toolchain.toolchain;
mkSrc = extraPaths: with lib.fileset; let
root = ./.;
rustFiles = fromSource (craneLib.cleanCargoSource root);
fileset = union rustFiles (unions extraPaths);
in
toSource { inherit root fileset; };
## Customize here ##
toolchain = fenix.complete; # or fenix.stable;
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
in in
{ {
packages.default = packages.default = craneLib.buildPackage {
let inherit stdenv;
inherit (pkgs.lib) fileset; src = mkSrc [ ];
in strictDeps = true;
craneLib.buildPackage { buildInputs = [
src = fileset.toSource { # Add additional build inputs here
root = ./.; ] ++ lib.optionals pkgs.stdenv.isDarwin [
fileset = fileset.intersection # Additional darwin specific inputs can be set here
(fileset.difference ./. pkgs.libiconv
(fileset.unions [ ./.cargo ./flake.nix ./flake.lock ./.envrc ])) ];
(fileset.gitTracked ./.); # Additional environment variables can be set directly
}; # MY_CUSTOM_VAR = "some value";
}; };
devShell = pkgs.mkShell.override devShells.default = pkgs.mkShell.override { inherit stdenv; }
{ {
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv; nativeBuildInputs = with pkgs; [
} # Add additional build inputs here
{ ] ++ (with toolchain; [
nativeBuildInputs = with toolchain; [ rustc cargo rust-analyzer clippy ]; cargo
clippy
rustfmt
rustc
fenix.rust-analyzer
]);
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
}; };
}); }
);
} }