code review

This commit is contained in:
Miguel Palhas
2024-10-05 10:30:59 +01:00
parent 6aea960b69
commit 87ff93fb31
6 changed files with 42 additions and 49 deletions
+1 -3
View File
@@ -1,11 +1,9 @@
{ lib, config, ... }: {
imports = [ ./zsh.nix ./neovim ./rust ./solidity.nix ];
imports = [ ./zsh.nix ./neovim ./rust.nix ./git.nix ./solidity.nix ];
programs = {
home-manager.enable = true;
git.enable = true;
fzf.enable = true;
gh.enable = true;
};
home = {
+35
View File
@@ -0,0 +1,35 @@
{ pkgs, ... }: {
programs.git = {
enable = true;
userName = "Miguel Palhas";
userEmail = "mpalhas@gmail.com";
aliases = {
ls =
"log --color --graph --oneline --decorate --topo-order --pretty=format:'%C(yellow)%d%Creset %Cgreen(%cr)%Creset %C(bold blue)[%an]%Creset %s %Cred(%h)%Creset' --abbrev-commit";
ll = ''
log --reverse --pretty=format:"%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%an]" --decorate --numstat'';
conf = "diff --name-only --diff-filter=U";
br = "branch";
ba = "branch -a";
br = "checkout -b";
pb = "publish";
ps = "push -u";
pr = "pull-request";
ppr = "push-pr";
cpr = "close-pr";
opr = "open-pr";
pb = "publish";
f = "fetch";
c = "commit --verbose";
d = "diff";
dc = "diff --cached";
co = "checkout";
s = "status -sb";
b = "better-branch";
rb = "rebase";
rbc = "rebase --continue";
};
};
programs.gh.enable = true;
}
+4
View File
@@ -0,0 +1,4 @@
{ pkgs, ... }: {
home.packages = with pkgs; [ rustup ];
home.sessionPath = [ "\${CARGO_HOME:-~/.cargo}/bin" ];
}
-42
View File
@@ -1,42 +0,0 @@
{ pkgs, ... }:
let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
libPath = with pkgs;
lib.makeLibraryPath [
# load external libraries that you need in your rust project here
];
in pkgs.mkShell rec {
buildInputs = with pkgs; [
clang
# Replace llvmPackages with llvmPackages_X, where X is the latest LLVM version (at the time of writing, 16)
llvmPackages.bintools
rustup
];
RUSTC_VERSION = overrides.toolchain.channel;
# https://github.com/rust-lang/rust-bindgen#environment-variables
LIBCLANG_PATH =
pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
'';
# Add precompiled library to rustc search path
RUSTFLAGS = (builtins.map (a: "-L ${a}/lib") [
# add libraries here (e.g. pkgs.libvmi)
]);
LD_LIBRARY_PATH = libPath;
# Add glibc, clang, glib, and other headers to bindgen search path
BINDGEN_EXTRA_CLANG_ARGS =
# Includes normal include path
(builtins.map (a: ''-I"${a}/include"'') [
# add dev libraries here (e.g. pkgs.libvmi.dev)
pkgs.glibc.dev
])
# Includes with special directory paths
++ [
''
-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
''-I"${pkgs.glib.dev}/include/glib-2.0"''
"-I${pkgs.glib.out}/lib/glib-2.0/include/"
];
}
@@ -1,2 +0,0 @@
[toolchain]
channel = "stable"
+2 -2
View File
@@ -32,8 +32,8 @@ in {
description = "Miguel Palhas";
extraGroups = [ "networkmanager" "input" "wheel" "docker" ];
shell = pkgs.zsh;
hashedPassword =
"$y$j9T$0p/ZYQsSA/FroVjV59pI/0$LKyzass6W9GjJR0GLWI6xhVrLi0b5AYYMR3MvQKNK11";
initialHashedPassword =
"$y$j9T$uRTzF/sBdrqVGZTRhPuR00$wgLgEGlq.lEmlCPiy69jkbtfC9HKpyaVPDHDdBGtE5D";
};
services.nfs.server.enable = true;