Skip to content

Instantly share code, notes, and snippets.

View orzklv's full-sized avatar
🏴
For me, open source is a moral thing.

Orzklv orzklv

🏴
For me, open source is a moral thing.
View GitHub Profile
@orzklv
orzklv / linkedshit.rs
Created March 14, 2024 14:37
Linked List implementation on Rust
use std::mem;
pub struct List<T> {
head: Link<T>,
}
type Link<T> = Option<Box<Node<T>>>;
struct Node<T> {
elem: T,
@orzklv
orzklv / readme.md
Last active June 22, 2025 19:04
How to migrate from homebrew to Nix package manager by Orzklv! Moved to: https://nix-darwin.uz/guide/

How to migrate from Homebrew to Nix

#homebrew #brew #nix #nixos

I'll be honest with ya'll, you don't wanna get away from Homebrew completely, yes, I'll explain!

I've been using Nix package manager in all my MacOS machines about 3-4 months and I always kept Homebrew installed. You see, Nix is a very good package manager and with its home-manager, it becomes a good config farm as well. However, installing & managing GUI & unfree apps via Nix has been a quite painful experience for me. Sometimes, it wouldn't run properly, crash or wouldn't even start. Also, Nix doesn't have most of GUI packages that Homebrew has. Therefore, I keep homebrew and use it only for its "casks" registry to install GUI & unfree apps whereas having nix to manage dot file configurations and cli apps.

@orzklv
orzklv / before-flake.nix
Created August 15, 2024 15:56
My life before flake-utils.lib.eachDefaultSystem was:
...
let
lib = nixpkgs.lib;
systems = [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
{
homeConfigurations = {
# ___ __
# / | ____ ____ / /__
# / /| | / __ \/ __ \/ / _ \
# / ___ |/ /_/ / /_/ / / __/
# /_/ |_/ .___/ .___/_/\___/
# /_/ /_/
# For all my current OSX machines
"sakhib@apple" = home-manager.lib.homeManagerConfiguration {
{
lib,
stdenv,
jre8,
curl,
ccid,
fetchurl,
pcsclite,
pcsc-tools,
writeShellScript,
@orzklv
orzklv / good-example.hs
Created March 28, 2025 18:10
Java devs, get the rope!
-- Algebraic data type definition
data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show)
-- Insertion function
insert :: (Ord a) => a -> Tree a -> Tree a
insert x Empty = Node Empty x Empty
insert x (Node left v right)
| x < v = Node (insert x left) v right
| otherwise = Node left v (insert x right)