Add nix flake and supporting cast

This commit is contained in:
Nicholas R. Smith 2025-06-09 23:24:26 -07:00
parent 0bf574a343
commit 608f032fc6
No known key found for this signature in database
GPG key ID: 2A603AA9D0619A75
4 changed files with 144 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

3
.gitignore vendored
View file

@ -20,3 +20,6 @@ libcairo.2.dylib
# node
node_modules
# envrc
.direnv/

91
flake.lock generated Normal file
View file

@ -0,0 +1,91 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay",
"wild": "wild"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1749523120,
"narHash": "sha256-lEhEK8qE8xto2Wnj4f7R+VRSg7M6tgTTkJVTZ2QxXOI=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d0727dbab79c5a28289f3c03e4fac7d5b95bafb3",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"wild",
"nixpkgs"
]
},
"locked": {
"lastModified": 1749177458,
"narHash": "sha256-9HNq3EHZIvvxXQyEn0sYOywcESF1Xqw2Q8J1ZewcXuk=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d58933b88cef7a05e9677e94352fd6fedba402cd",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"wild": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1749506444,
"narHash": "sha256-5CCo/kWxNjr9jbhB642oc69r3+0Zn+jAl9u6hDkfEEk=",
"owner": "davidlattimore",
"repo": "wild",
"rev": "154544358675316bf82d800cbf843764ebaa9271",
"type": "github"
},
"original": {
"owner": "davidlattimore",
"repo": "wild",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

49
flake.nix Normal file
View file

@ -0,0 +1,49 @@
{
description = "Nix-flake development environment for my personal website";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
wild = {
url = "github:davidlattimore/wild";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
rust-overlay,
wild,
}:
let
system = "x86_64-linux";
overlays = [
(import rust-overlay)
wild.overlays.default
];
pkgs = import nixpkgs {
inherit system overlays;
};
wildStdenv = pkgs.useWildLinker pkgs.stdenv;
in
with pkgs;
{
devShells.${system}.default = mkShell.override { stdenv = wildStdenv; } {
buildInputs = [
(pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
clang
openssl
pkg-config
];
};
};
}