utils(scripts): add flake and use that instead of nix-shell

Changed files
+77 -1
utils
+59
utils/flake.lock
···
···
+
{
+
"nodes": {
+
"flake-utils": {
+
"inputs": {
+
"systems": "systems"
+
},
+
"locked": {
+
"lastModified": 1692799911,
+
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
+
"nixpkgs": {
+
"locked": {
+
"lastModified": 1693060755,
+
"narHash": "sha256-KNsbfqewEziFJEpPR0qvVz4rx0x6QXxw1CcunRhlFdk=",
+
"owner": "NixOS",
+
"repo": "nixpkgs",
+
"rev": "c66ccfa00c643751da2fd9290e096ceaa30493fc",
+
"type": "github"
+
},
+
"original": {
+
"id": "nixpkgs",
+
"type": "indirect"
+
}
+
},
+
"root": {
+
"inputs": {
+
"flake-utils": "flake-utils",
+
"nixpkgs": "nixpkgs"
+
}
+
},
+
"systems": {
+
"locked": {
+
"lastModified": 1681028828,
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+
"owner": "nix-systems",
+
"repo": "default",
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-systems",
+
"repo": "default",
+
"type": "github"
+
}
+
}
+
},
+
"root": "root",
+
"version": 7
+
}
+16
utils/flake.nix
···
···
+
{
+
inputs = {
+
flake-utils.url = "github:numtide/flake-utils";
+
};
+
+
outputs = { self, nixpkgs, flake-utils }:
+
flake-utils.lib.eachDefaultSystem (system:
+
let
+
pkgs = nixpkgs.legacyPackages.${system};
+
in {
+
packages = rec {
+
python3 = pkgs.python311.withPackages (p: with p; [requests]);
+
default = python3;
+
};
+
});
+
}
+2 -1
utils/justfile
···
list:
just -l
nitter-token:
-
deno run --allow-{env,read,net} nitter-guest-account.js tokens.json
···
+
python_executable := if os() == "android" { "python3" } else { "nix run .#python3 --" }
list:
just -l
nitter-token:
+
{{python_executable}} nitter-guest-account.py tokens.json