add nushell & thorium

This commit is contained in:
arielherself 2024-08-13 19:59:30 +08:00
parent 820fdc558f
commit dbdd3f8a49
Signed by: arielherself
SSH Key Fingerprint: SHA256:AK3cyo9tFsp7Mox7K0sYphleC8hReXhnRKxwuDT5LBc
7 changed files with 109 additions and 5 deletions

View File

@ -1,9 +1,10 @@
# vim: set expandtab tabstop=2 softtabstop=2 shiftwidth=2: # vim: set expandtab tabstop=2 softtabstop=2 shiftwidth=2:
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; }; unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
mypkgs = import ../mypkgs/default.nix;
in { in {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
@ -19,7 +20,12 @@ in {
# plain files is through 'home.file'. # plain files is through 'home.file'.
home.file = { home.file = {
".profile" = { ".profile" = {
source = ../.profile; text = ''
export GTK_THEME=Adwaita:dark
export MOZ_USE_XINPUT2=1
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share
export QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.libsForQt5.qt5.qtbase.bin}/lib/qt-${pkgs.libsForQt5.qt5.qtbase.version}/plugins";
'';
}; };
".gitconfig" = { ".gitconfig" = {
text = '' text = ''
@ -33,6 +39,9 @@ in {
}; };
xdg.configFile = { xdg.configFile = {
"starship.toml" = {
source = ../starship.toml;
};
"tmux/plugins/tpm" = { "tmux/plugins/tpm" = {
source = builtins.fetchGit { source = builtins.fetchGit {
url = "https://github.com/tmux-plugins/tpm.git"; url = "https://github.com/tmux-plugins/tpm.git";
@ -146,6 +155,7 @@ in {
unstable._1password unstable._1password
unstable._1password-gui unstable._1password-gui
pkgs.nix-index pkgs.nix-index
pkgs.dua
# Pwn # Pwn
pkgs.nmap pkgs.nmap
@ -195,7 +205,7 @@ in {
pkgs.fastfetch pkgs.fastfetch
pkgs.onefetch pkgs.onefetch
pkgs.lf # Terminal file manager pkgs.lf # Terminal file manager
# pkgs.smassh # Typing test pkgs.smassh # Typing test
pkgs.you-get # YouTube video downloader pkgs.you-get # YouTube video downloader
pkgs.asciinema # Record terminal sessions pkgs.asciinema # Record terminal sessions
pkgs.ulauncher # application launcher pkgs.ulauncher # application launcher
@ -208,7 +218,11 @@ in {
pkgs.adwaita-qt pkgs.adwaita-qt
pkgs.adwaita-qt6 pkgs.adwaita-qt6
pkgs.firefox-devedition pkgs.firefox-devedition
mypkgs.thorium
pkgs.wiki-tui pkgs.wiki-tui
pkgs.asciiquarium
pkgs.starship
pkgs.patchelf
# My version of BerkeleyMono NF is incomplete. Should add some fallback fonts. # My version of BerkeleyMono NF is incomplete. Should add some fallback fonts.
(pkgs.nerdfonts.override { fonts = [ (pkgs.nerdfonts.override { fonts = [
@ -347,6 +361,17 @@ in {
programs.nushell = { programs.nushell = {
enable = true; enable = true;
configFile.source = ../nushell/config.nu;
envFile.source = ../nushell/env.nu;
extraConfig = ''
'';
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
}; };
services.mpris-proxy.enable = true; services.mpris-proxy.enable = true;

3
mypkgs/default.nix Normal file
View File

@ -0,0 +1,3 @@
{
thorium = import ./thorium/default.nix;
}

View File

@ -0,0 +1,65 @@
with import <nixpkgs> {};
pkgs.stdenv.mkDerivation rec {
name = "thorium-${version}";
version = "124.0.6367.218";
src = pkgs.fetchurl {
url = "https://github.com/Alex313031/thorium/releases/download/M${version}/thorium-browser_${version}_AVX2.deb";
hash = "sha256-nXz5ocZYDBWLIaARk8lN9LhP+7p8bEx+Kk+JAT2tG5c=";
};
sourceRoot = ".";
unpackPhase = "dpkg-deb --fsys-tarfile ${src} | tar -x --no-same-owner";
nativeBuildInputs = [
pkgs.dpkg
pkgs.autoPatchelfHook
pkgs.qt5.wrapQtAppsHook
pkgs.wrapGAppsHook
];
buildInputs = with pkgs; [
glib
libgcc
qt5.full
qt6.full
qt5.qtbase
cairo
at-spi2-atk
pango
cups
libGL
];
dontConfigure = true;
dontBuild = true;
installPhase= ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share
cp -R usr/bin $out/
cp -R usr/share $out/
cp -R opt $out/
substituteInPlace $out/share/applications/thorium-browser.desktop --replace /usr/bin/ $out/bin/
substituteInPlace $out/share/applications/thorium-shell.desktop --replace /usr/bin/ $out/bin/
substituteInPlace $out/share/applications/thorium-shell.desktop --replace /opt/ $out/opt/
substituteInPlace $out/bin/thorium-shell --replace /opt/ $out/opt/
patchelf $out/opt/chromium.org/thorium/thorium --add-needed libGL.so.1
ln -fs $out/opt/chromium.org/thorium/thorium-browser $out/bin/thorium-browser
runHook postInstall
'';
# preFixup = ''
# makeWrapperArgs+=("''${qtWrapperArgs[@]}")
# '';
meta = with lib; {
homepage = "https://thorium.rocks";
description = "Web Browser";
platforms = platforms.linux;
};
}

3
nushell/config.nu Normal file
View File

@ -0,0 +1,3 @@
use ~/.cache/starship/init.nu
alias la = ls -la

2
nushell/env.nu Normal file
View File

@ -0,0 +1,2 @@
mkdir ~/.cache/starship
starship init nu | save -f ~/.cache/starship/init.nu

View File

@ -473,6 +473,7 @@ local plugins = {
{ 'echasnovski/mini.trailspace', version = '*' }, { 'echasnovski/mini.trailspace', version = '*' },
{ url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' }, { url = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' },
{ 'glacambre/firenvim', build = ":call firenvim#install(0)" }, { 'glacambre/firenvim', build = ":call firenvim#install(0)" },
{ 'nushell/tree-sitter-nu' },
} }
require("lazy").setup(plugins, {}) require("lazy").setup(plugins, {})
@ -671,6 +672,7 @@ lspconfig.nil_ls.setup {
capabilities = capabilities capabilities = capabilities
} }
lspconfig.mojo.setup {} lspconfig.mojo.setup {}
lspconfig.nushell.setup {}
capabilities.workspace = { capabilities.workspace = {
didChangeWatchedFiles = { didChangeWatchedFiles = {
@ -737,7 +739,7 @@ vim.keymap.set('i', '<C-x>', '<ESC>ddi')
vim.keymap.set('i', '<Home>', '<ESC>^i') vim.keymap.set('i', '<Home>', '<ESC>^i')
vim.keymap.set('i', '<C-a>', '<ESC>ggVG') vim.keymap.set('i', '<C-a>', '<ESC>ggVG')
vim.keymap.set('n', '<C-a>', 'ggVG') vim.keymap.set('n', '<C-a>', 'ggVG')
vim.keymap.set('n', '<leader>`', '<Cmd>split<CR><Cmd>terminal<CR>i') vim.keymap.set('n', '<leader>`', '<Cmd>split<CR><Cmd>terminal bash<CR>i')
vim.keymap.set('n', '<leader>n', '<Cmd>tabnew<CR>') vim.keymap.set('n', '<leader>n', '<Cmd>tabnew<CR>')
vim.keymap.set('n', '<leader><tab>', '<Cmd>tabnext<CR>') vim.keymap.set('n', '<leader><tab>', '<Cmd>tabnext<CR>')
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', {noremap=true}) vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', {noremap=true})
@ -924,7 +926,7 @@ vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = t
vim.api.nvim_create_user_command('Backup', '!git add . && git commit -S -m "backup" && git push', {}) vim.api.nvim_create_user_command('Backup', '!git add . && git commit -S -m "backup" && git push', {})
vim.api.nvim_create_user_command('Config', 'e ~/.config/nvim', {}) vim.api.nvim_create_user_command('Config', 'e ~/dotfiles/nvim', {})
require('Comment').setup() require('Comment').setup()
local str = require("cmp.utils.str") local str = require("cmp.utils.str")

4
starship.toml Normal file
View File

@ -0,0 +1,4 @@
format = '''
[\[Ariel\]](bold purple)[\[$directory\]](grey)\[$cmd_duration\]
$symbol '''