.files/nix/configurations/vanadium/home/dev.nix
2025-09-18 10:10:56 +08:00

126 lines
3 KiB
Nix

{
pkgs,
lib,
config,
...
}: {
home.packages = [
# preview markdown
pkgs.python3Packages.grip
# For nix contribution
pkgs.gh
pkgs.nixfmt-rfc-style
pkgs.nix-doc
pkgs.nixpkgs-review
pkgs.shellcheck
pkgs.lua-language-server
pkgs.stylua # lua
pkgs.nil # nix
pkgs.fish-lsp # fish
pkgs.pyright # python
pkgs.taplo # toml
pkgs.vscode-langservers-extracted # JSON etc
pkgs.yaml-language-server # yaml
# bash
pkgs.shfmt
pkgs.nodePackages.bash-language-server
];
programs.git = {
enable = true;
signing.signByDefault = true;
maintenance = {
enable = true;
repositories =
lib.map (path: config.home.homeDirectory + "/${path}")
[
"r/nixos/nixpkgs"
];
};
includes = let
hasconfigRemoteCondition = cfg: let
cfg' = builtins.removeAttrs cfg ["url" "path"];
path = cfg.path or "*/**";
in [
(cfg' // {condition = "hasconfig:remote.*.url:git@${cfg.url}:${path}";})
(cfg' // {condition = "hasconfig:remote.*.url:https://${cfg.url}/${path}";})
];
haskellIdentity = {
init.defaultBranch = "main";
user.name = "Léana Jiang";
};
universityIdentity = {
init.defaultBranch = "main";
user = {
name = "Léana CHIANG";
email = "leana.chiang@etudiant.univ-rennes1.fr";
signingKey = "0x32035DB97E777EEB";
};
};
blameIgnore = {
blame.ignoreRevsFile = ".git-blame-ignore-revs";
};
in
builtins.concatMap hasconfigRemoteCondition [
# Univ stuff
{
url = "gitlab.istic.univ-rennes1.fr";
contents = universityIdentity;
}
{
url = "gitlab2.istic.univ-rennes1.fr";
contents = universityIdentity;
}
# Haskell
{
url = "gitlab.haskell.org";
contents = haskellIdentity;
}
# Blame
# Turning this on globally will fail if the file doesn't exist
{
url = "github.com";
path = "nixos/nixpkgs.git";
contents = blameIgnore;
}
{
url = "gitlab.haskell.org";
path = "ghc/ghc.git";
contents = blameIgnore;
}
];
};
programs.gpg.enable = true;
# programs.vscode = {
# enable = true;
# profiles.default.extensions = [
# pkgs.vscode-extensions.redhat.java
# pkgs.vscode-extensions.vscjava.vscode-java-pack
# ];
# };
nix = {
settings = {
# extra-substituters = [
# "https://ghc-nix.cachix.org"
# "https://haskell-language-server.cachix.org"
# "https://helix.cachix.org"
# ];
extra-trusted-public-keys = [
"ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg="
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
];
};
};
}