nvfetcher

This commit is contained in:
xunuwu 2024-09-09 12:02:12 +02:00
parent 013fc0e2d0
commit 1f35c4fe1c
No known key found for this signature in database
9 changed files with 159 additions and 50 deletions

23
_sources/generated.json Normal file
View file

@ -0,0 +1,23 @@
{
"sobercookie": {
"cargoLocks": null,
"date": "2024-09-08",
"extract": null,
"name": "sobercookie",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "xunuwu",
"repo": "sobercookie",
"rev": "0e082ab538a2eed206ab228ed50c5251323abdf2",
"sha256": "sha256-hdW/MqzphyAy6bcN3LDFFRV0t9ZHOx2b96hu9acZ7+E=",
"sparseCheckout": [],
"type": "github"
},
"version": "0e082ab538a2eed206ab228ed50c5251323abdf2"
}
}

16
_sources/generated.nix Normal file
View file

@ -0,0 +1,16 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
sobercookie = {
pname = "sobercookie";
version = "0e082ab538a2eed206ab228ed50c5251323abdf2";
src = fetchFromGitHub {
owner = "xunuwu";
repo = "sobercookie";
rev = "0e082ab538a2eed206ab228ed50c5251323abdf2";
fetchSubmodules = false;
sha256 = "sha256-hdW/MqzphyAy6bcN3LDFFRV0t9ZHOx2b96hu9acZ7+E=";
};
date = "2024-09-08";
};
}

78
flake.lock generated
View file

@ -64,6 +64,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -164,9 +180,27 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_5",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"small-nvim", "small-nvim",
@ -276,7 +310,7 @@
}, },
"neovim-nightly-overlay": { "neovim-nightly-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects", "hercules-ci-effects": "hercules-ci-effects",
@ -426,6 +460,28 @@
"type": "github" "type": "github"
} }
}, },
"nvfetcher": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1718252448,
"narHash": "sha256-xZZBdKqe1ByITzvx65pVgGQ5jeb73MybjgrcfI84lEo=",
"owner": "berberman",
"repo": "nvfetcher",
"rev": "fa7609950023462c6f91c425de7610c0bb6b86ba",
"type": "github"
},
"original": {
"owner": "berberman",
"repo": "nvfetcher",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -436,6 +492,7 @@
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nur": "nur", "nur": "nur",
"nvfetcher": "nvfetcher",
"small-nvim": "small-nvim", "small-nvim": "small-nvim",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
@ -530,9 +587,24 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": { "utils": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,

View file

@ -23,6 +23,7 @@
home-manager home-manager
sops sops
colmena colmena
inputs.nvfetcher.packages.${pkgs.system}.default
]; ];
name = "dots"; name = "dots";
}; };
@ -47,21 +48,18 @@
nix-index-database.url = "github:Mic92/nix-index-database"; nix-index-database.url = "github:Mic92/nix-index-database";
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
nvfetcher.url = "github:berberman/nvfetcher";
## deduplication ## deduplication
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
small-nvim.inputs.nixpkgs.follows = "nixpkgs"; small-nvim.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs = { sops-nix.inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs";
}; };
nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs"; nix-vscode-extensions.inputs.nixpkgs.follows = "nixpkgs";
nvfetcher.inputs.nixpkgs.follows = "nixpkgs";
}; };
} }

View file

@ -17,6 +17,7 @@
in { in {
flake.colmena = { flake.colmena = {
meta = { meta = {
# machinesFile = TODO
nixpkgs = import inputs.nixpkgs { nixpkgs = import inputs.nixpkgs {
system = "x86_64-linux"; system = "x86_64-linux";
config.allowUnfree = true; config.allowUnfree = true;

3
nvfetcher.toml Normal file
View file

@ -0,0 +1,3 @@
[sobercookie]
src.git = "https://github.com/xunuwu/sobercookie"
fetch.github = "xunuwu/sobercookie"

View file

@ -1,8 +1,10 @@
{pkgs, ...}: { {pkgs, ...}: let
nv_generated = pkgs.callPackage ../_sources/generated.nix {};
in {
jdnbtexplorer = pkgs.qt6Packages.callPackage ./jdnbtexplorer {}; jdnbtexplorer = pkgs.qt6Packages.callPackage ./jdnbtexplorer {};
gamesand = pkgs.callPackage ./gamesand {}; gamesand = pkgs.callPackage ./gamesand {};
pince = pkgs.callPackage ./pince {}; pince = pkgs.callPackage ./pince {};
binaryninja-personal = pkgs.qt6Packages.callPackage ./binaryninja-personal {}; binaryninja-personal = pkgs.qt6Packages.callPackage ./binaryninja-personal {};
sobercookie = pkgs.callPackage ./sobercookie {}; sobercookie = pkgs.callPackage ./sobercookie {inherit nv_generated;};
krunker = pkgs.callPackage ./krunker {}; krunker = pkgs.callPackage ./krunker {};
} }

View file

@ -3,6 +3,7 @@
fetchurl, fetchurl,
imagemagick, imagemagick,
}: let }: let
# TODO: use https://github.com/KraXen72/crankshaft, can be tracked with nvfetcher
pname = "krunker"; pname = "krunker";
version = "0.0.1"; version = "0.0.1";
src = fetchurl { src = fetchurl {

View file

@ -1,7 +1,6 @@
{ {
stdenv, stdenv,
lib, lib,
fetchFromGitHub,
pkg-config, pkg-config,
bash, bash,
makeWrapper, makeWrapper,
@ -10,51 +9,45 @@
gtk3, gtk3,
wrapGAppsHook, wrapGAppsHook,
luajit, luajit,
nv_generated,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (nv_generated.sobercookie
pname = "sobercookie"; // (let
src = fetchFromGitHub { lgi = luajitPackages.lgi;
owner = "xunuwu"; in {
repo = "sobercookie"; buildInputs = [bash luajit];
rev = "0e082ab538a2eed206ab228ed50c5251323abdf2";
sha256 = "sha256-hdW/MqzphyAy6bcN3LDFFRV0t9ZHOx2b96hu9acZ7+E=";
};
version = "0.0.1";
buildInputs = [bash luajit]; nativeBuildInputs = [
makeWrapper
pkg-config
wrapGAppsHook
gobject-introspection
];
nativeBuildInputs = [ propagatedBuildInputs = [gtk3];
makeWrapper
pkg-config
wrapGAppsHook
gobject-introspection
];
propagatedBuildInputs = [gtk3]; installPhase = ''
lgi = luajitPackages.lgi; runHook preInstall
installPhase = '' mkdir -p $out/bin
runHook preInstall cp sobercookie $out/bin/sobercookie
cp launcher.lua $out/bin/sobercookie-launcher
mkdir -p $out/bin mkdir -p $out/share/applications
cp sobercookie $out/bin/sobercookie cp sobercookie-launcher.desktop $out/share/applications
cp launcher.lua $out/bin/sobercookie-launcher
mkdir -p $out/share/applications runHook postInstall
cp sobercookie-launcher.desktop $out/share/applications '';
runHook postInstall preFixup = ''
''; gappsWrapperArgs+=(
--prefix LUA_PATH : "./?.lua;${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua"
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so"
)
'';
preFixup = '' postFixup = ''
gappsWrapperArgs+=( wrapProgram $out/bin/sobercookie \
--prefix LUA_PATH : "./?.lua;${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua" --prefix PATH : ${lib.makeBinPath [bash]}
--prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so" '';
) }))
'';
postFixup = ''
wrapProgram $out/bin/sobercookie \
--prefix PATH : ${lib.makeBinPath [bash]}
'';
}