[nix] Redo and restructure the entire config

Thanks @KaitlynEthylia :)
This commit is contained in:
Alyxia Sother 2024-07-11 19:07:47 +02:00
parent 19b92cd8fd
commit 2daf5f1b05
No known key found for this signature in database
GPG key ID: 01E16C4E775A37E4
13 changed files with 378 additions and 302 deletions

7
nix/home/default.nix Normal file
View file

@ -0,0 +1,7 @@
{ importAll, ... }:
{
imports = importAll [] ./.;
home.stateVersion = "24.05";
}

42
nix/home/git.nix Normal file
View file

@ -0,0 +1,42 @@
{ pkgs, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull; # contains git send-email et al
userName = "Alyxia Sother";
userEmail = "alyxia@riseup.net";
signing = {
key = "01E16C4E775A37E4";
signByDefault = true;
};
ignores = [
".DS_Store"
];
delta = {
enable = true;
options = {
line-numbers = true;
features = "decorations";
syntax-theme = "ansi";
};
};
extraConfig = {
init.defaultBranch = "master";
};
};
programs.gh = {
enable = true;
# Why the *fuck* are these packages as opposed to GitHub links???
extensions = with pkgs; [
gh-actions-cache
];
};
programs.gitui.enable = true;
}

38
nix/home/nvim.nix Normal file
View file

@ -0,0 +1,38 @@
{ self, pkgs, ... }:
{
programs.neovim = {
enable = true;
package = pkgs.neovim-unwrapped;
extraConfig = ''source ~/.dotfiles/nvim/init.vim"source ${self}/nvim/init.vim'';
coc = {
enable = true;
settings = {
languageserver = {
nix = {
command = "nil";
filetypes = [ "nix" ];
rootPatterns = [ "flake.nix" ];
"settings.nil" = {
"formatting.command" = [ "nixpkgs-fmt" ];
};
};
"go.goPlsOptions" = {
completion = true;
completeUnimported = true;
};
rescript = {
enable = true;
command = "rescript-language-server";
args = [ "--node-ipc" ];
filetypes = [ "rescript" ];
rootPatterns = [ "rescript.json" "bsconfig.json" ];
};
};
};
};
};
}

93
nix/home/packages.nix Normal file
View file

@ -0,0 +1,93 @@
{ pkgs, ... }:
let
packageSets = with pkgs; {
system = [
gnutls
gsasl
libtool
patchelf
pcre
pkg-config
];
base = [
act
bat
bitwarden-cli
cloudflared
delta
eza
ffmpeg
fzf
gh
git-crypt
gitui
gnupg
jq
kubectl
kubelogin-oidc
mosh
nixpkgs-fmt
pandoc
ripgrep
sops
stylua
texlive.combined.scheme-small
typst
vim
wget
# Fyra
glib-networking
meson
ninja
vala
desktop-file-utils
];
languages = [
crystal
dhall
dhall-json
dhall-lsp-server
go
jdk
kotlin
kotlin-language-server
lua-language-server
nil
nodejs_20
python2
ruby_3_1
sbcl
shards
zig
];
programs = [
rectangle
tailscale
];
multimedia = [
ffmpeg
];
fonts = [
nerdfonts
ibm-plex
];
python = with python311Packages; [
colorama
psutil
distro
];
};
everything = builtins.concatLists (builtins.attrValues packageSets);
in
{
home.packages = everything;
}

31
nix/home/zsh.nix Normal file
View file

@ -0,0 +1,31 @@
{ self, ... }:
{
programs.zsh = {
enable = true;
initExtra = ''
export GPG_TTY=$(tty)
source ~/.dotfiles/zsh/zshrc #source ${self}/zsh/zshrc
source "$HOME/.cargo/env"
[[ -d "$HOME/.local/bin" ]] || mkdir "$HOME/.local/bin"
export PATH="/Library/Developer/CommandLineTools/usr/bin:$PATH"
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$HOME/.npm-packages/bin"
export PATH="$PATH:$HOME/.dotnet/tools"
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
export FRENYARD_SCALE=2.40
export RETHINK_API="https://rethink.alyxia.dev"
export KUBECONFIG="$HOME/.kube/config.yaml"
function violent-update() {
# <https://github.com/adryd325/dotfiles/blob/c52d10f0cb4b54ee46e2ac5b01b8be9f8d57973d/install.sh#L17>
sudo -v; while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
cd "$HOME/.dotfiles/nix";
sudo nix-channel --update && nix-channel --update;
sudo nix-env -u;
}
'';
};
}