Compare commits

..

3 commits

Author SHA1 Message Date
870f24db3a
sync 2025-01-13 15:09:12 +01:00
0d6f9adacc
add vscode update script and update extensions 2025-01-13 14:29:00 +01:00
a0c487d602
flake.lock: Update
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/d00c6f6d0ad16d598bf7e2956f52c1d9d5de3c3a?narHash=sha256-i5ay20XsvpW91N4URET/nOc0VQWOAd4c4vbqYtcH8Rc%3D' (2024-12-06)
  → 'github:nix-community/home-manager/5ad12b6ea06b84e48f6b677957c74f32d47bdee0?narHash=sha256-uTstP36WaFrw%2BTEHb8nLF14hFPzQBOhmIxzioHCDaL8%3D' (2025-01-05)
• Updated input 'unstable':
    'github:nixos/nixpkgs/d0797a04b81caeae77bcff10a9dde78bc17f5661?narHash=sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG%2BcBns%3D' (2024-12-05)
  → 'github:nixos/nixpkgs/6df24922a1400241dae323af55f30e4318a6ca65?narHash=sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk%3D' (2025-01-02)
2025-01-05 10:48:33 +01:00
3 changed files with 214 additions and 73 deletions

View file

@ -3,73 +3,122 @@
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [ extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [
bbenoist.nix {
yzhang.markdown-all-in-one name = "vsc-prolog";
haskell.haskell publisher = "arthurwang";
justusadam.language-haskell version = "0.8.23";
maximedenes.vscoq sha256 = "1i6rgz8ap269pph6bh04bimw9yyajd7iyq8dvv7sqmpfk859vb8d";
james-yu.latex-workshop }
mkhl.direnv {
catppuccin.catppuccin-vsc name = "agda-mode";
valentjn.vscode-ltex publisher = "banacorn";
ms-vscode.cpptools version = "0.5.1";
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ sha256 = "02r28a8y6pdjhad76z193xrlc4yk4fsynn064w7cff56gdc31bd5";
{ }
name = "doxdocgen"; {
publisher = "cschlosser"; name = "nix";
version = "1.4.0"; publisher = "bbenoist";
sha256 = "sha256-InEfF1X7AgtsV47h8WWq5DZh6k/wxYhl2r/pLZz9JbU="; version = "1.0.1";
} sha256 = "0zd0n9f5z1f0ckzfjr38xw2zzmcxg1gjrava7yahg5cvdcw6l35b";
{ }
name = "vsc-prolog"; {
publisher = "arthurwang"; name = "catppuccin-vsc";
version = "0.8.23"; publisher = "catppuccin";
sha256 = "sha256-Da2dCpruVqzP3g1hH0+TyvvEa1wEwGXgvcmIq9B/2cQ="; version = "3.16.0";
} sha256 = "1g4021qrsy67fw2b1lvazn58nvr64dkvpywqanbpz24dlgk2573r";
{ }
name = "better-cpp-syntax"; {
publisher = "jeff-hykin"; name = "doxdocgen";
version = "1.27.1"; publisher = "cschlosser";
sha256 = "sha256-GO/ooq50KLFsiEuimqTbD/mauQYcD/p2keHYo/6L9gw="; version = "1.4.0";
} sha256 = "1d95znf2vsdzv9jqiigh9zm62dp4m9jz3qcfaxn0n0pvalbiyw92";
{ }
name = "c-cpp-flylint"; {
publisher = "jbenden"; name = "simple-alignment";
version = "1.15.0"; publisher = "earshinov";
sha256 = "sha256-k6sH0Rx4VjGmKjvCR9x/OWrxmo7+S2bvRlZi3Z9PNPw="; version = "1.0.1";
} sha256 = "1ak1v1dbwx7d6ablla5njznj59z9jaqbzmci22jmpsd3a70kka1f";
{ }
name = "agda-mode"; {
publisher = "banacorn"; name = "yuck";
version = "0.4.7"; publisher = "eww-yuck";
sha256 = "sha256-gNa3n16lP3ooBRvGaugTua4IXcIzpMk7jBYMJDQsY00="; version = "0.0.3";
} sha256 = "1hxdxa13s1vlilw7fidr8vnl19c9wjazjvnvmqgl4fsswwny110c";
{ }
name = "yuck"; {
publisher = "eww-yuck"; name = "todo-tree";
version = "0.0.3"; publisher = "gruntfuggly";
sha256 = "sha256-DITgLedaO0Ifrttu+ZXkiaVA7Ua5RXc4jXQHPYLqrcM="; version = "0.0.226";
} sha256 = "0yrc9qbdk7zznd823bqs1g6n2i5xrda0f9a7349kknj9wp1mqgqn";
{ }
name = "simple-alignment"; {
publisher = "earshinov"; name = "haskell";
version = "1.0.1"; publisher = "haskell";
sha256 = "sha256-Lqg5wVGj6VulEJHVv7CS6aci7Ze2KEqXMu10vlrYYao="; version = "2.5.3";
} sha256 = "13s39fvb6kwxklcfsa5xh4z7y8y3y0h6jv39ljrgl24qkwgx8xnw";
{ }
name = "todo-tree"; {
publisher = "Gruntfuggly"; name = "latex-workshop";
version = "0.0.226"; publisher = "james-yu";
sha256 = "sha256-Fj9cw+VJ2jkTGUclB1TLvURhzQsaryFQs/+f2RZOLHs="; version = "10.7.5";
} sha256 = "0habsbk0w2g8vcxqzdbnwy6f0x0ghvcx1f9szd4p1pwjfij2vnax";
{ }
name = "lean4"; {
publisher = "leanprover"; name = "c-cpp-flylint";
version = "0.0.133"; publisher = "jbenden";
sha256 = "sha256-tjBTOkh4UeEmOo/ZbadpeyW07QiPcUO4aI2NWdtTxrE="; version = "1.15.0";
} sha256 = "1z1l9ygxsqjn8vpncjzyisdg2sirgzf4ghiv5ak32mkq3k8hgawk";
]; }
{
name = "better-cpp-syntax";
publisher = "jeff-hykin";
version = "1.27.1";
sha256 = "037nigza7n71j5vgl3qw0swrmy8gvfj9m8jbi1nb2a3lmsifivqq";
}
{
name = "language-haskell";
publisher = "justusadam";
version = "3.6.0";
sha256 = "115y86w6n2bi33g1xh6ipz92jz5797d3d00mr4k8dv5fz76d35dd";
}
{
name = "lean4";
publisher = "leanprover";
version = "0.0.187";
sha256 = "04pyq6v0s5dy6b8bpjakp33dff4plxxa100x8gvbw36v6ddpsx7d";
}
{
name = "vscoq";
publisher = "maximedenes";
version = "2.2.1";
sha256 = "04m1dby6zfzg5nahnricjax28g47mgnja7d9cbll270i7ahnyncm";
}
{
name = "direnv";
publisher = "mkhl";
version = "0.17.0";
sha256 = "1n2qdd1rspy6ar03yw7g7zy3yjg9j1xb5xa4v2q12b0y6dymrhgn";
}
{
name = "cpptools";
publisher = "ms-vscode";
version = "1.23.3";
sha256 = "03gwyrrcc4kw84ss7mh8ksfib1bvmhmr1pa5sg11nzj2hzxnikgd";
}
{
name = "vscode-ltex";
publisher = "valentjn";
version = "13.1.0";
sha256 = "15qm97i9l65v3x0zxl1895ilazz2jk2wmizbj7kmds613jz7d46c";
}
{
name = "markdown-all-in-one";
publisher = "yzhang";
version = "3.6.2";
sha256 = "1n9d3qh7vypcsfygfr5rif9krhykbmbcgf41mcjwgjrf899f11h4";
}
];
userSettings = { userSettings = {
"prolog.executablePath" = "/etc/profiles/per-user/leonv/bin/swipl"; "prolog.executablePath" = "/etc/profiles/per-user/leonv/bin/swipl";
"agdaMode.connection.agdaLanguageServer" = false; "agdaMode.connection.agdaLanguageServer" = false;

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736277415, "lastModified": 1736508663,
"narHash": "sha256-kPDXF6cIPsVqSK08XF5EC6KM7BdMnM9vtJDzsnf+lLU=", "narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "5c4302313d9207f7ec0886d68f8ff4a3c71209a1", "rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -49,11 +49,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1736012469, "lastModified": 1736701207,
"narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6",
"type": "github" "type": "github"
}, },
"original": { "original": {

92
update_installed_exts.sh Executable file
View file

@ -0,0 +1,92 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p cacert curl jq unzip
# shellcheck shell=bash
set -eu -o pipefail
# SOURCE: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh
# can be added to your configuration with the following command and snippet:
# $ ./pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > extensions.nix
#
# packages = with pkgs;
# (vscode-with-extensions.override {
# vscodeExtensions = map
# (extension: vscode-utils.buildVscodeMarketplaceExtension {
# mktplcRef = {
# inherit (extension) name publisher version sha256;
# };
# })
# (import ./extensions.nix).extensions;
# })
# ]
# Helper to just fail with a message and non-zero exit code.
function fail() {
echo "$1" >&2
exit 1
}
# Helper to clean up after ourselves if we're killed by SIGINT.
function clean_up() {
TDIR="${TMPDIR:-/tmp}"
echo "Script killed, cleaning up tmpdirs: $TDIR/vscode_exts_*" >&2
rm -Rf "$TDIR/vscode_exts_*"
}
function get_vsixpkg() {
N="$1.$2"
# Create a tempdir for the extension download.
EXTTMP=$(mktemp -d -t vscode_exts_XXXXXXXX)
URL="https://$1.gallery.vsassets.io/_apis/public/gallery/publisher/$1/extension/$2/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"
# Quietly but delicately curl down the file, blowing up at the first sign of trouble.
curl --silent --show-error --retry 3 --fail -X GET -o "$EXTTMP/$N.zip" "$URL"
# Unpack the file we need to stdout then pull out the version
VER=$(jq -r '.version' <(unzip -qc "$EXTTMP/$N.zip" "extension/package.json"))
# Calculate the SHA
SHA=$(nix-hash --flat --base32 --type sha256 "$EXTTMP/$N.zip")
# Clean up.
rm -Rf "$EXTTMP"
# I don't like 'rm -Rf' lurking in my scripts but this seems appropriate.
cat <<-EOF
{
name = "$2";
publisher = "$1";
version = "$VER";
sha256 = "$SHA";
}
EOF
}
# See if we can find our `code` binary somewhere.
if [ $# -ne 0 ]; then
CODE=$1
else
CODE=$(command -v code || command -v codium)
fi
if [ -z "$CODE" ]; then
# Not much point continuing.
fail "VSCode executable not found"
fi
# Try to be a good citizen and clean up after ourselves if we're killed.
trap clean_up SIGINT
# Begin the printing of the nix expression that will house the list of extensions.
printf '{ extensions = [\n'
# Note that we are only looking to update extensions that are already installed.
for i in $($CODE --list-extensions)
do
OWNER=$(echo "$i" | cut -d. -f1)
EXT=$(echo "$i" | cut -d. -f2)
get_vsixpkg "$OWNER" "$EXT"
done
# Close off the nix expression.
printf '];\n}'