Skip to content

Instantly share code, notes, and snippets.

View Lillecarl's full-sized avatar
🦕
Dinosaurs are a lie!

Carl Lillecarl

🦕
Dinosaurs are a lie!
View GitHub Profile
# Apply function to all strings in an attrset recursively through lists as well.
mapStringsDeep =
function: value:
if builtins.isString value then
function value
else if builtins.isAttrs value then
lib.mapAttrs (name: mapStringsDeep function) value
else if builtins.isList value then
map (mapStringsDeep function) value
else
[01:22:40]❌1 ❯ nvd diff /nix/var/nix/profiles/system-838-link/ /nix/var/nix/profiles/system-839-link/
<<< /nix/var/nix/profiles/system-838-link
>>> /nix/var/nix/profiles/system-839-link
Version changes:
[U.] #001 bc 1.08.1 -> 1.08.2
[U.] #002 breeze-icons 6.14.0 -> 6.15.0
[U*] #003 curl 8.13.0 x2, 8.13.0-bin, 8.13.0-debug, 8.13.0-man -> 8.14.1 x2, 8.14.1-bin, 8.14.1-debug, 8.14.1-man
[U.] #004 elfutils 0.192 x2, 0.192-bin, 0.192-dev -> 0.193 x2, 0.193-bin, 0.193-dev
[U.] #005 ell 0.76 x2 -> 0.77 x2
[D*] #006 file 5.46 x3, 5.46-dev, 5.46-man -> 5.45 x3, 5.45-dev, 5.45-man
# Note: nix will also try to replace @@escapeCode@@ and @@text@@ with "@@" and whatever is in the full text. Won't matter in practice
let
replaceStrings' =
{ escapeCode, text, ... }@replacements:
let
names = builtins.map (name: "${escapeCode}${name}${escapeCode}") (builtins.attrNames replacements);
values = builtins.attrValues replacements;
replacedText = builtins.replaceStrings names values text;
verificationMatches = builtins.match "^.*(@@.*@@).*$" replacedText;
verificationError = "Found unreplaced text ${builtins.concatStringsSep " " verificationMatches}";
diff --git a/default.nix b/default.nix
index 18aafb6..0fabd2e 100644
--- a/default.nix
+++ b/default.nix
@@ -148,15 +148,20 @@ let
shortRev = builtins.substring 0 7 info.rev;
}
else if info.type == "path" then
- {
- outPath = builtins.path (
diff --git a/default.nix b/default.nix
index 18aafb6..0fabd2e 100644
--- a/default.nix
+++ b/default.nix
@@ -148,15 +148,20 @@ let
shortRev = builtins.substring 0 7 info.rev;
}
else if info.type == "path" then
- {
- outPath = builtins.path (
~/C/flake-compat [🎋 main][!⇡][📦 v0.0.0][🐍 ][🗀 not loaded/not allowed][🐚fish][as🧙]
[15:47:06]❯ nix build --file $FLAKE/default.nix "nixosConfigurations.\"$hostname\".config.system.build.toplevel" --log-format internal-json
@nix {"action":"start","id":4712262023512064,"level":5,"parent":0,"text":"copying '/home/lillecarl/Code/nixpkgs/pkgs/stdenv/generic/source-stdenv.sh' to the store","type":0}
@nix {"action":"stop","id":4712262023512064}
@nix {"action":"start","id":4712262023512065,"level":5,"parent":0,"text":"copying '/home/lillecarl/Code/nixpkgs/pkgs/stdenv/generic/default-builder.sh' to the store","type":0}
@nix {"action":"stop","id":4712262023512065}
@nix {"action":"start","id":4712262023512066,"level":5,"parent":0,"text":"copying '/home/lillecarl/Code/nixpkgs/pkgs/stdenv/linux/bootstrap-tools/glibc/unpack-bootstrap-tools.sh' to the store","type":0}
@nix {"action":"stop","id":4712262023512066}
@nix {"action":"start","id":4712262023512067,"level":5,"parent":0,"text":"copying '/home/lillecarl/Code/nixpkgs/pk
#! /usr/bin/env fish
function padd
for path in $(nix build nixpkgs#$argv[1] --print-out-paths --no-link)
set bin "$path/bin"
if test -d $bin
echo "Added $bin to PATH"
set --prepend --global PATH $bin
end
end
end
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 496226e89..b2975c94d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,38 +46,6 @@ get_filename_component(REAL_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}" REALPATH)
add_definitions(-DCMAKE_BINARY_DIR="${REAL_CMAKE_BINARY_DIR}")
add_definitions(-DCMAKE_SOURCE_DIR="${REAL_CMAKE_SOURCE_DIR}")
-# Define a function to build and link dependencies.
-function(CREATE_TARGET target)
{
stdenv,
fetchFromGitHub,
cmake,
rust,
rustc,
cargo,
ncurses,
pcre2,
gettext,
{ lib, config, ... }:
let
modName = "template";
cfg = config.ps.${modName};
in
{
options.ps = {
${modName} = {
enable = lib.mkOption {
default = true;