feat: devShell, package as flake etc

Signed-off-by: Christina Sørensen <ces@fem.gg>
This commit is contained in:
Christina Sørensen 2025-01-27 14:47:58 +01:00
parent ec5c4e2bc7
commit 196aeaf6f5
Signed by: cafkafk
GPG key ID: F67767BE4545A600
10 changed files with 2127 additions and 0 deletions

19
.direnv/bin/nix-direnv-reload Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/ces/org/src/git/qcode-drills" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/ces/org/src/git/qcode-drills")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/ces/org/src/git/qcode-drills" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/ces/org/src/git/qcode-drills/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/ces/org/src/git/qcode-drills/.envrc" "/home/ces/org/src/git/qcode-drills/.direnv"/*.rc

View file

@ -0,0 +1 @@
/nix/store/80figiaxaxbij9dvaapawdpscd9bcgpd-source

View file

@ -0,0 +1 @@
/nix/store/bzhc7rpaymqkzrpbpczyzhwvdbgh7cf1-source

View file

@ -0,0 +1 @@
/nix/store/wshnc0kqk1qz7iffb1yqri8a5cy6v7w5-source

View file

@ -0,0 +1 @@
/nix/store/y082x32a6ylpai5lp1x4vcpj39gya83h-source

View file

@ -0,0 +1 @@
/nix/store/qwmvgrk86nbz091kf2nyswdbrb22jf15-nix-shell-env

File diff suppressed because it is too large Load diff

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

58
flake.lock generated Normal file
View file

@ -0,0 +1,58 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1736143030,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1737885589,
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1735774519,
"narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

38
flake.nix Normal file
View file

@ -0,0 +1,38 @@
{
description = "Q-CODE Training Script, for the hammies";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{
self',
pkgs,
...
}:
{
packages.default = pkgs.writeShellApplication {
name = "qcode-trainer";
runtimeInputs = with pkgs; [
jq
figlet
];
text = ./bin/qcode.bash;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ self'.packages.default ];
};
};
};
}