Skip to content

Instantly share code, notes, and snippets.

Avatar

Domen Kožar domenkozar

View GitHub Profile
@domenkozar
domenkozar / configuration.nix
Last active May 13, 2021
NixOS Raspberry Pi 4 configuration
View configuration.nix
{ config, pkgs, lib, ... }:
let
user = "guest";
password = "guest";
SSID = "mywifi";
SSIDpassword = "mypassword";
interface = "wlan0";
hostname = "myhostname";
@domenkozar
domenkozar / cachix.org.spec.purs
Created Jan 28, 2021
Automated testing for 404/500 errors
View cachix.org.spec.purs
module Spec where
import Quickstrom
import Data.Foldable (any)
import Data.Maybe (maybe)
import Data.Tuple (Tuple(..))
import Data.String.CodeUnits (contains)
import Data.String.Pattern (Pattern(..))
readyWhen = "body"
@domenkozar
domenkozar / output
Created Dec 13, 2020
Bluez 5.54 segfault
View output
(gdb) bt
#0 0x00007f07c459808a in raise () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#1 0x00007f07c4582528 in abort () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#2 0x00007f07c45d98a8 in __libc_message () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#3 0x00007f07c45e0a0a in malloc_printerr () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#4 0x00007f07c45e27f5 in _int_free () from /nix/store/33idnvrkvfgd5lsx2pwgwwi955adl6sk-glibc-2.31/lib/libc.so.6
#5 0x0000561454342d61 in load_remote_seps ()
#6 0x0000561454345b28 in avdtp_set_state ()
#7 0x00005614543495d4 in avdtp_connect_cb ()
#8 0x000056145437d70b in connect_cb ()
View diff
diff --git a/overlays/bootstrap.nix b/overlays/bootstrap.nix
index b165ab1..197b32f 100644
--- a/overlays/bootstrap.nix
+++ b/overlays/bootstrap.nix
@@ -134,11 +134,11 @@ in {
++ fromUntil "8.10" "8.10.2" ./patches/ghc/67738db10010fd28a8e997b5c8f83ea591b88a0e.patch
++ final.lib.optional (versionAtLeast "8.6.4" && versionLessThan "8.8") ./patches/ghc/ghc-no-system-linker.patch
- ++ fromUntil "8.10.2" "8.12" ./patches/ghc/MR3714-backported-to-8.10.2.patch
+ #++ fromUntil "8.10.2" "8.12" ./patches/ghc/MR3714-backported-to-8.10.2.patch
@domenkozar
domenkozar / Repl.hs
Last active Feb 25, 2021
Cachix Server Repl using hint
View Repl.hs
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Repl where
import Cachix.Config (readConfig)
import Cachix.Env (setupApp)
import Cachix.Server.Prelude
import qualified Control.Exception.Safe as Safe
import qualified Language.Haskell.Interpreter as Interpreter
import Protolude
@domenkozar
domenkozar / HasqlNestedMaybeRecord.hs
Created Nov 25, 2020
Hasql nested records and maybe/nullable
View HasqlNestedMaybeRecord.hs
#!/usr/bin/env stack
-- stack --nix --nix-packages postgresql --resolver lts-16.23 --install-ghc runghc --package hasql --package text --package bytestring
{-# LANGUAGE OverloadedStrings #-}
import Data.Text
import Data.ByteString
import Data.Int
import qualified Hasql.Decoders as HD
import qualified Hasql.Encoders as HE
import qualified Hasql.Statement as HQ
@domenkozar
domenkozar / README.md
Created Jun 23, 2020
Haskell + GitHub Actions + Cachix
View README.md
View 2.3.4
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
Switched to a new branch '2.3.4'
KernelVersion: 4.4.0-1060-aws
Components: [{u'Version': u'18.03.1-ee-3', u'Name': u'Engine', u'Details': {u'KernelVersion': u'4.4.0-1060-aws', u'Os': u'linux', u'BuildTime': u'2018-08-30T18:42:30.000000000+00:00', u'ApiVersion': u'1.37', u'MinAPIVersion': u'1.12', u'GitCommit': u'b9a5c95', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.10.2'}}]
Arch: amd64
BuildTime: 2018-08-30T18:42:30.000000000+00:00
ApiVersion: 1.37
Platform: {u'Name': u''}
Version: 18.03.1-ee-3
View bluetooth.nix
hardware.pulseaudio.enable = true;
# https://askubuntu.com/questions/113704/make-pulseaudio-prefer-external-audio-device
hardware.pulseaudio.extraConfig = ''
load-module module-switch-on-connect
load-module module-switch-on-port-available
load-module module-bluetooth-discover
load-module module-bluetooth-policy
load-module module-bluez5-discover
#load-module module-bluez5-device
'';
View nixops-close.md

Hello!

Thank you for this PR.

In the past several months, some major changes have taken place in NixOps:

  1. Backends have been removed, preferring a plugin-based architecture. Here are some of them: