Skip to content

Instantly share code, notes, and snippets.

View dejanr's full-sized avatar

Dejan Ranisavljević dejanr

View GitHub Profile
@dejanr
dejanr / shell.nix
Created May 17, 2021 16:31 — forked from Nadrieril/shell.nix
Building LineageOS on NixOS
# I used this shell.nix to build LineageOS 13.0 for my maguro (Samsung Galaxy Nexus GSM) phone
# The build instructions for normal Linuxes are here: https://wiki.lineageos.org/devices/maguro/build
# For NixOS, follow those instructions but skip anything related to installing packages
# Detailed instructions:
# cd into an empty directory of your choice
# copy this file there
# in nix-shell:
# $ repo init -u https://github.com/LineageOS/android.git -b cm-13.0
# $ repo sync
# $ source build/envsetup.sh
@dejanr
dejanr / README.md
Created March 3, 2021 10:08 — forked from akihikodaki/README.en.md
Linux Desktop on Apple Silicon/M1 in Practice

Linux Desktop on Apple Silicon/M1 in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon/M1.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

My Grandfather Time

As a kid I used to grow up beside a very stubborn and an amazing grandfather. During WW2, he was around 10, and that’s when he started as a blacksmith apprentice, he became an amazing blacksmith, and we still have his workshop and tools, and as a kid during 90s i couldn’t be more greatfull for having access to all of that, and support of an amazing craftssman.

One very unique thing he did is that he would never change time on his watch during daylight time saving. I remember asking him why he does that,

@dejanr
dejanr / nixos setup
Last active November 29, 2020 07:48
parted
mklabel gpt
mkpart ESP fat32 8MiB 2048MiB
set 1 boot on
set 1 bios_grub on
mkpart swap linux-swap 2048MiB 10GiB
mkpart zfs 10GiB -1
zpool create -O xattr=sa -O acltype=posixacl -O atime=off -o ashift=12 -O mountpoint=legacy -f zpool mirror /dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21NNSAFC24953N-part3 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21NNSAFC24938P-part3
//
// Prelude
// A zero dependency, one file drop in for faster Typescript development with fewer bugs
// through type safe, functional programming. Comments are inline with links to blog posts motiviating the use.
// alias for a function with arity 1
export type Fn<A, B> = (a: A) => B;
// alias for a function with arity 2
@dejanr
dejanr / nixos-encrypted-zfs.sh
Created November 8, 2019 15:12 — forked from dysinger/nixos-encrypted-zfs.sh
How I installed Encrypted ZFS root on NixOS
#!/bin/sh
# FIRST STOP THE zfs-zed SERVICE
systemctl stop zfs-zed
# FORCE UNLOAD ZFS KERNEL MODULES
lsmod | grep zfs | cut -d' ' -f1 | xargs rmmod -f
# NOW ADD THE FOLLOWING TO /etc/nixos/configuration.nix
#
@dejanr
dejanr / gist.sh
Last active June 11, 2019 22:52
deploy github page
#!/usr/bin/env bash
setup() {
git stash push
git checkout gh-pages
}
cleanup() {
git checkout master
git stash pop
'use strict';
require('webpack');
const CopyAssets = require('copy-webpack-plugin');
const fs = require('fs');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const os = require('os');
const path = require('path');
const runMode = require('run-mode');

Keybase proof

I hereby claim:

  • I am dejanr on github.
  • I am dejanr (https://keybase.io/dejanr) on keybase.
  • I have a public key ASD_ZnmyADuGJ8VRhAbUr9glgd3exzO2YFd0hZISMLxnHQo

To claim this, I am signing this object:

@dejanr
dejanr / vsls
Created February 27, 2019 13:52 — forked from b333z/vsls
vccode live share nixos
#!/usr/bin/env bash
# TODO: Look at nixpkgs/pkgs/build-support/setup-hooks/auto-patchelf.sh
# https://ms-vsliveshare.gallery.vsassets.io/_apis/public/gallery/publisher/MS-vsliveshare/extension/vsliveshare/0.3.423/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage
set -eu
TOOLS="patchelf xsel"
DEPS="utillinux.out openssl.out icu zlib curl.out lttng-ust libsecret libkrb5"