Skip to content

Instantly share code, notes, and snippets.

Danylo Hlynskyi danbst

Block or report user

Report or block danbst

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danbst / home-etc.nix
Created Dec 27, 2019
Manage your /etc from home-manager (install home-manager as root)
View home-etc.nix
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
]; = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {

Okay, I've got a need to build Firefox from source, and I'd like to do that on a remote machine, and then copy build result back to my laptop. With Nix, using bastion host. I'll note details of my successful adventure.

Setup & Sources of knowledge

Here's the list of resources I've used actively:

Here's my setup:

danbst / README.adoc
Created Sep 5, 2019
Pure Nix Minecraft launcher. For every MC version!
View README.adoc

Pure Nix Minecraft launchers

  1. Download .nix file

  2. Run:

    $ nix run -f all-minecrafts.nix versions.v1_8_9.client -c minecraft
  3. Enjoy (…​power of fixed-output derivations)!

View asciidoc.adoc

Hey let’s start a list:

  1. Yeah, all good.

    a bit of code.
    Oh wow, it is indented compared to markdown!

    A bit of text. Wow, it is indeted as well!

danbst /
Last active Jun 19, 2019
[Linux] [Firefox] Open link in browser, which is in current workspace

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

danbst / uuid-bloom.sql
Created Apr 27, 2019
Postgresql UUID Bloom index support (best for UUIDv4) (
View uuid-bloom.sql
create extension "uuid-ossp";
create extension bloom;
CREATE or replace FUNCTION hashuuid(u uuid) RETURNS integer AS $$
a bytea := uuid_send(u);
RETURN (get_byte(a, 3) << 24) + (get_byte(a, 2) << 16) + (get_byte(a, 1) << 8) + get_byte(a, 0);
danbst / background-script.js
Created Mar 30, 2019
Firefox extension, which tracks time spent in Facebook and tells it to you INSTANTLY.
View background-script.js
timeSpent = 0;
timeStarts = 0
browser.tabs.onActivated.addListener((activeInfo) => {
{timeSpent: timeSpent}
).then(response => {
timeStarts = (new Date).getTime();
}).catch(error => {
View submodule-with-parent-config.nix
sub = { config, lib, parentConfig, ...}: { = lib.mkOption {
type = lib.types.bool;
default =;
in { config, lib, ...}: { = lib.mkOption { type = lib.types.bool; default = true; };
danbst / all-packages.nix
Created Jan 19, 2019
Overlays in nixpkgs!
View all-packages.nix
inherit (import ../servers/sql/postgresql-default.nix pkgs super)
danbst /
Last active Jan 17, 2019
Nixos need a replacement for nixos-rebuild!

nixos executable

Basic features:

  • installable as package, even on non-nixos
  • is named nixos
  • is written in C++ and binds to Nix C++ library (or maybe Haskell? Nodejs? What you think?)
  • autocomplete, ncurses, Nix 2.0
  • commit to Git by default on each rebuild


You can’t perform that action at this time.