Skip to content

Commit

Permalink
relocking flake when inputs change.
Browse files Browse the repository at this point in the history
This fixes a 'path dependency' bug, where you'd get into hard-to-reproduce state that wasn't driven by
anysnake2.toml, but by a *series* of anysnake2.tomls.
  • Loading branch information
TyberiusPrime committed Nov 18, 2024
1 parent fa0b651 commit f5ccf3e
Show file tree
Hide file tree
Showing 43 changed files with 1,601 additions and 24 deletions.
5 changes: 5 additions & 0 deletions examples/flake_subdependency/after/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
result
run_scripts/
.*.json
.gc_roots

213 changes: 213 additions & 0 deletions examples/flake_subdependency/after/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions examples/flake_subdependency/after/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
description = "Anysnake2 generated flake";
inputs = rec {

flake-utils = {
url =
"github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a";

};
nixpkgs = {
url = "github:NixOS/nixpkgs/24.05";

};
rust-overlay = {
url =
"github:oxalica/rust-overlay/0be641045af6d8666c11c2c40e45ffc9667839b5";
inputs.nixpkgs.follows = "nixpkgs";

};
test = {
url =
"github:nix-community/poetry2nix/f554d27c1544d9c56e5f1f8e2b8aff399803674e";

};
};

outputs = { self, flake-utils, nixpkgs, rust-overlay, test }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system overlays;
config = { allowUnfree = false; };
};
R_tracked = null;
overlays = [ (import rust-overlay) ];
rust = pkgs.rust-bin.stable."1.55.0".minimal.override {
extensions = [ "rustfmt" "clippy" ];
};
_args = with pkgs; {
name = "anysnake2_container";
#later entries beat earlier entries in terms of /bin symlinks
script = ''
${coreutils}
${bashInteractive_5}
${bash}
${cacert}
${fish}
${rust}
${stdenv.cc}
'';
};
helpers = import ./functions.nix { inherit pkgs; };
in rec {
defaultPackage = (helpers.buildSymlinkImage _args).derivation;
oci_image = helpers.buildOCIimage _args;
devShell = pkgs.stdenv.mkDerivation {
name = "anysnake2-devshell";
shellHook = ''
export PATH=${defaultPackage}/rootfs/bin:$PATH;
if test -f "develop_python_path.bash"; then
source "develop_python_path.bash"
fi
'' + (if R_tracked != null then ''
export R_LIBS_SITE=${R_tracked}/lib/R/library/
'' else
"");
nativeBuildInputs = with pkgs;
[
#%DEVSHELL_INPUTS%
];
};
});
}
Loading

0 comments on commit f5ccf3e

Please sign in to comment.