This commit is contained in:
2025-09-12 01:46:27 +10:00
parent 38bd4239fe
commit 21697be45e
2 changed files with 68 additions and 28 deletions

34
backend/flake.lock generated
View File

@@ -22,6 +22,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"naersk": { "naersk": {
"inputs": { "inputs": {
"fenix": "fenix", "fenix": "fenix",
@@ -75,6 +93,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
} }
@@ -95,6 +114,21 @@
"repo": "rust-analyzer", "repo": "rust-analyzer",
"type": "github" "type": "github"
} }
},
"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", "root": "root",

View File

@@ -4,41 +4,47 @@
inputs = { inputs = {
naersk.url = "github:nix-community/naersk"; naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { outputs = {
self, self,
naersk, naersk,
nixpkgs, nixpkgs,
}: let flake-utils,
system = "x86_64-linux"; }:
pkgs = import nixpkgs {inherit system;}; flake-utils.lib.eachDefaultSystem (
naerskLib = pkgs.callPackage naersk {}; system: let
buildInputs = [pkgs.openssl]; pkgs = import nixpkgs {
nativeBuildInputs = [pkgs.pkg-config]; inherit system;
in { };
packages.${system}.default = naerskLib.buildPackage { naerskLib = pkgs.callPackage naersk {};
src = ./.; buildInputs = [pkgs.openssl];
buildInputs = buildInputs; nativeBuildInputs = [pkgs.pkg-config];
nativeBuildInputs = nativeBuildInputs; in {
}; packages.${system}.default = naerskLib.buildPackage {
src = ./.;
buildInputs = buildInputs;
nativeBuildInputs = nativeBuildInputs;
};
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
inputsFrom = [self.packages.${system}.default]; inputsFrom = [self.packages.${system}.default];
packages = with pkgs; [ packages = with pkgs; [
rustc rustc
cargo cargo
rustfmt rustfmt
rust-analyzer rust-analyzer
zsh zsh
]; ];
shellHook = '' shellHook = ''
export SHELL=${pkgs.zsh}/bin/zsh export SHELL=${pkgs.zsh}/bin/zsh
# jump into zsh if we didn't already start in it # jump into zsh if we didn't already start in it
[ -z "$ZSH_VERSION" ] && exec ${pkgs.zsh}/bin/zsh -l [ -z "$ZSH_VERSION" ] && exec ${pkgs.zsh}/bin/zsh -l
''; '';
}; };
}; }
);
} }