summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-09-08 14:24:23 -0400
committerLLLL Colonq <llll@colonq>2026-09-08 14:24:23 -0400
commit1dc97459be2fbe2c829d4cce73570396d130dd33 (patch)
tree17cfcd9f907e1a7608ece2f011e96f816e9ecba6 /flake.nix
Initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..0af88e4
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,51 @@
+{
+ inputs = {
+ teleia.url = "github:lcolonq/teleia";
+ nixpkgs.follows = "teleia/nixpkgs";
+ };
+
+ outputs = inputs@{ self, nixpkgs, ... }:
+ let
+ system = "x86_64-linux";
+ pkgs = import nixpkgs { inherit system; };
+ inherit (pkgs) lib;
+ src = ./.;
+ elfland = inputs.teleia.native.build src "elfland";
+ nonnix = pkgs.stdenv.mkDerivation {
+ name = "elfland-nonnix";
+ phases = [ "installPhase" ];
+ installPhase = ''
+ mkdir $out
+ cp -rv ${elfland}/bin/elfland $out
+ chmod +w $out/elfland
+ patchelf --remove-rpath $out/elfland
+ patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $out/elfland
+ strip $out/elfland
+ chmod -w $out/elfland
+ '';
+ };
+ windows = inputs.teleia.windows.build src "elfland";
+ wasm = inputs.teleia.wasm.buildAtUrlInDir src "elfland" "/" "./crates/elfland";
+ in {
+ packages.${system} = {
+ default = elfland;
+ inherit elfland nonnix windows wasm;
+ };
+ applications.${system}.default = {
+ type = "app";
+ program = "${elfland}/bin/elfland";
+ };
+ devShells.${system} = {
+ # default = inputs.teleia.shell;
+ default = inputs.teleia.shell.overrideAttrs (final: prev: {
+ RA_LOG = "rust_analyzer=info";
+ });
+ windows = inputs.teleia.windows.shell;
+ };
+ overlay = self: super: {
+ elfland = {
+ inherit wasm;
+ };
+ };
+ };
+}