Skip to content

Instantly share code, notes, and snippets.

View zimbatm's full-sized avatar
🦙
nixified

Jonas Chevalier zimbatm

🦙
nixified
View GitHub Profile
{ system ? builtins.currentSystem
, baseModulesFile ? ../nixos/modules/module-list.nix
}:
let
evalNixOS = import ../nixos/lib/eval-config.nix {
system = system;
baseModules = import baseModulesFile;
modules = [
{ system ? builtins.currentSystem
, baseModules ? import ../nixos/modules/module-list.nix
}:
let
evalNixOS = import ../nixos/lib/eval-config.nix {
inherit system baseModules;
modules = [
({ modulesPath, ... }: {
# these are required for nixos to evaluate
boot.loader.systemd-boot.enable = true;
# Small function that checks if a TCP port on localhost is open.
#
# Timeout after 10 attempts.
#
# Usage: wait_port <port>
wait_port() (
local i=0 port=$1
echo "waiting on port $port"
# Bash has a magic filesystem that can be used to do basic TCP.
#
variable "users" {
type = list(string)
default = ["bob"]
}
resource "random_password" "passwords" {
for_each = toset(var.users)
length = 32
special = false
}
{ pkgs, callPackage }:
let
evalHome = import "${toString pkgs.sources.home-manager}/modules";
in
{
home-manager = evalHome {
configuration = ./home-manager.nix;
lib = pkgs.lib;
pkgs = pkgs;
};
#!/usr/bin/env bash
#
# A small bash wrapper to kaniko with a few assumptions built in.
set -euo pipefail
context=$1
dockerfile=$2
destination=$3
cache=true
cache_repo=$(echo "$destination" | cut -d : -f 1)-cache
lib: prev: {
servant-client-core = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant-client-core.nix { }));
servant-multipart = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant-multipart.nix { }));
generic-lens = lib.doJailbreak (lib.dontCheck (prev.callPackage ./generic-lens.nix { }));
servant-client = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant-client.nix { }));
servant-foreign = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant-foreign.nix { }));
servant = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant.nix { }));
servant-server = lib.doJailbreak (lib.dontCheck (prev.callPackage ./servant-server.nix { }));
protolude = lib.doJailbreak (lib.dontCheck (prev.callPackage ./protolude.nix { }));
openapi3 = lib.doJailbreak (lib.dontCheck (prev.callPackage ./openapi3.nix { }));
#!/usr/bin/env bash
# Run this script to update the dependencies
set -euo pipefail
# This is the list of dependencies that should be generated using `cabal2nix`.
# The left-hand side is the name of the package, and .nix file that will be
# generated.
# The right-hand side is a `cabal2nix`-compatible URI.
declare -A dependencies=(
[protolude]=cabal://protolude-0.3.0 # password-instances depends on this
{ pkgs, lib, ... }: {
imports = [
./wayland.nix
];
home.packages = with pkgs; [
brightnessctl
#dmenu
grim # screenshot CLI
i3status-rust # menu bar
#!/usr/bin/env bash
set -euo pipefail
targetHost=$(basename "$(dirname "$(readlink -f "$0")")")
hostname=$(< /proc/sys/kernel/hostname)
args=(
--flake ".#$targetHost"
--use-remote-sudo
)