TIL: How to Access System in Home Manager Using Flakes
Recently I needed to install devenv using flakes in home-manager. One of the things I needed to pass to was the type of system to install on i.e. "x86_64-linux".
So as I temp hack I had something like: inputs.devenv.packages."x86_64-linux".devenv.
However I was able to access the system using the pkgs attribute like so:
{ inputs, pkgs, ... }: { home.packages = [ inputs.
...
TIL: How to Fix tmux-resurrect on NixOS
When I moved to NixOS I noticed that tmux-resurrect stop restoring some applications such as man and nvim. Like it used to on my Arch machine. I recently found a solution to my problem (thanks to a lovely chap on the nixos discourse).
By adding the following lines to our tmux config:
resurrect_dir="$HOME/.tmux/resurrect" set -g @resurrect-dir $resurrect_dir set -g @resurrect-hook-post-save-all 'target=$(readlink -f $resurrect_dir/last); sed "s| --cmd .
...
In this post, I will go over how you can use Cachix’s devenv tool to help create/set up consistent repeatable developer environments. You could use nix flakes if you wanted to as well, without needing another tool. However, I like how devenv provides a few other “tools” within that we can set up from a single devenv.nix file. Such as pre-commit hooks, container support etc.
This blog leverages devenv to create/set up its developer environment.
...
TIL: How to Colour Neovim Line Numbers
Recently I was trying to configure my own neovim config. I wanted the current line I was onto be coloured slighty differently and also the line number to be white. So it’s easier to see the line number and which line I was on.
It was not immediately obvious how to do this and took me long to work out than I’d like to admit 😅.
...
In this article, we will go over how we can self-host our instance of Atuin. A tool we can use to sync our shell history across multiple devices. In the previous article, I showed how you can use the official server. However you may want to run your self-hosted one, so no one can access even the encrypted version of your shell history.
We will deploy our instance to fly.io. Why fly.
...
Atuin is a great tool I recently discovered that can be used to sync our shell history across multiple machines. We can either self-host this or use the “officially” hosted one. In a future article, I will show you how you can self-host your version of Atuin on fly.io. But for this article, I will assume you have a server setup. Your history is end-to-end encrypted so the official server is safe to use and store your history on.
...
TIL: How to Setup Neovim for Nixlang
I have been recently using NixOS/home-manager and I have been writing a lot of nixlang. To have my system state declaratively set up. I have been doing most of this editing in neovim. It took me a bit of time to work out how to get it set up so there is some basic LSP support and auto-formatting. I created a file called nix.
...
TIL: How to Fix VIA Permission Issues on Linux
Recently I have been trying to configure my newish Keychron keyboard using VIA. To add a key to be able to take print screens, making use of the layers provided, as my Keychron Q1 PRO doesn’t have a dedicated print key 😓.
However, when I opened the app or the website, I would get the following error.
If we go to chrome://device-log you should be able to see something like this: Failed to open '/dev/hidraw9': FILE_ERROR_ACCESS_DENIED.
...
In this blog post, I will show you how you can easily setup Neotest to make testing easier in neovim and DAP to make debugging your tests is a lot easier.
I am using the LazyVim neovim distribution, where these two come as easily installed extra plugins. However, it should be easy enough for you to copy the config over to your neovim lua config. LazyVim even has the config available on its website, you don’t even need to deep dive into the code 😄.
...
TIL: How to get Kanshi to work on NixOS and Hyprland
I have been using Kanshi to setup my monitor setups automagically depending on which monitors are plugged i.e. if my laptop is docked or not. If it is docked I want my laptop display to be off, when not docked I want it to be on. So my kanshi config file ~/.config/kanshi/config to look something like:
I use the name of my monitors as the ports they are plugged into my vary.
...
Introduction Dev Machine My main machine for development at the moment is a 12th Generation Intel Framework Laptop.
This series has been inspired by Dev Workflow Intro by Josh Medeski.
In this series of posts, I will go over how I have set up my developer workflow and explain why I have made certain decisions and why I use certain tools. This series aim to make it less daunting for you to start your journey on improving your developer workflow.
...
This series has been inspired by Dev Workflow Intro by Josh Medeski.
This is sort of a precursor to my series about how I have set up my development workflow. Hopefully, you will be able to pick a few tips and tricks you can add to your development workflow to make it more efficient. Or even give me tips on how I can make my workflow more efficient.
In this post we will go over arguably the least important, but at the same time quite important, part of our workflow.
...
My latest iteration of my dotfiles, where I am now using a Laptop as my main development machine (Framework). I’m also using Hyprland as my window manager. Most importantly using NixOS and home-manager to declaratively define the state of my machine i.e. what packages to install, dotfiles.
CURRENTLY A WIP
🏠 My dotfiles repo, setup using nixos/home-manager
Install 🔥 I wouldn’t recommend just blinding using my dotfiles. They are setup for my specific use-case.
...
Recently I’ve been trying to work out how to update packages that I define declaratively in my Nix config. I think I figured out how to do it using my Nix flake. By running nix flake update and then sudo nixos-rebuild switch --flake ~/dotfiles#framework to update the packages.
However, I have some plugins say for tmux which are defined like so:
t-smart-manager = pkgs.tmuxPlugins.mkTmuxPlugin { pluginName = "t-smart-tmux-session-manager"; version = "unstable-2023-06-05"; rtpFilePath = "t-smart-tmux-session-manager.
...
Introduction In this post I will show you how you can setup tmux (plugins) using the nix package manager, specifically using home-manager. I will also show you how you can avoid an issue I encountered where tmux resurrect wasn’t working properly due to plugin ordering.
Typically we use the tmux plugin manager to manage our tmux plugins. However, when I moved to NixOS, I wanted to move away from having lots of different ways of managing what is on my system.
...
Recently I decided to move from Arch Linux to NixOS. Rather than doing what I should’ve done which was try to use NixOS in a VM first and learn Nix properly. I decided to jump into the deep end and completely delete my current Arch Linux build with Nix. This included replacing my dotfiles setup using DotBot moving them to Nix flakes and home-manager (more on this in a bit). In this post, I’ll go over why I moved over to NixOS, and why I am staying put for now.
...
TIL: How to use NUR with Home-Manager & Nix Flakes
NUR is the Nix user repository like the Arch user repository (AUR). It exists so that:
The NUR was created to share new packages from the community in a faster and more decentralized way. - https://github.com/nix-community/NUR
If we want to install packages from NUR in our home manager config which is set up using Nix Flakes. Assuming you build your home manager like
...
TIL: How to Declaratively Setup Mullvad VPN with NixOS
I have recently moved to NixOS, one of the great features of NixOS is that you can set up your entire machine from a single git repo. We can do this declaratively, what we mean by this is we tell nix what we want the state to be and nixos will work out how to get there.
For example, we can install Mullvad set various options already.
...
TIL: How to Add Vim Navigation FZF
FZF is an amazing fuzzy finder tool, that is super flexible and you can create some cool cli one-liners with it. For example, I use it with the fish shell plugin to search through my command history (CTRL + R).
In this post, I will show you how vim style navigation to the FZF pop-up preview. All we need to do is add the following to the relevant file i.
...
TIL: How to change the fish greeter
In this post I will show you how you can change your fish shell greeter from the default
Welcome to fish, the friendly interactive shell Type `help` for instructions on how to use fish To something custom, this will run every time you open a new shell!
To do this, go to your fish_greeter.fish file which can usually be found at ~/.config/fish/functions/fish_greeting.fish. Where mine looks like:
...
Following on from my previous post about dotfiles and my development workflow (WIP), in this post I will go over my operating system.
Arch As the name implies I use Linux as my main operating system. I am a big fan of Linux because not only is free and open-source, it provides a great developer experience where I find tools that just work on Linux. It also is a lot more customisable as compared with Windows or MacOS.
...
I know I recently made a post about my dotfiles but I’ve made a few changes since then, so here are my updated dotfiles.
out of date These dotfiles are out of date check out my updated ones here System Overview OS: Arch Linux DE: Gnome Shell: Fish Prompt: Starship Terminal: Alacritty Editor: Neovim (using LazyVim config) Colorscheme: Catppuccin for EVERYTHING!!! Fonts: Mono Lisa Extensions I use the following Gnome extension.
...
Workflows Change This post is accurate as of date of publish. But likely will go stale, if I update my workflows I will likely publish another post. In this blog post, I will go over my current development workflow using the above tools namely, fish shell tmux and neovim. I’ll be using the dotfiles found here.
I aim to move away from using my mouse as much as possible as it just slows me down when my hands are away from my keyboard.
...
This post is a quick introduction to dotfiles, accurate as of 25th of April 2023.
out of date These dotfiles are out of date check out my updated ones here Dotfiles 🏠 My dotfiles setup using Dotbot.
Install 🔥 I wouldn’t recommend just blinding using my dotfiles. They are setup for my specific use-case. I think you’re better picking and choosing what you like 😄.
git clone [email protected]:hmajid2301/dotfiles.git cd dotfiles make install profile=arch System Overview OS: Arch Linux DE: Gnome Shell: Fish Prompt: Starship Terminal: Alacritty Editor: Neovim (using astronvim config) Colorscheme: Dracula Icons: Tela-circle-dracula-dark Fonts: Mono Lisa Extensions I use the following Gnome extension.
...
In this post, I will show you how to get code coverage reports from your Playwright tests in your SvelteKit app. So let’s imagine we are starting with the basic SvelteKit template. First, we need to install:
npm i -D vite-plugin-istanbul We need the vite plugin to instrument our code using Istanbul. Istanbul is a tool which allows us to instrument our code such that it can determine which lines were covered by our tests.
...