nix: create initial flake

This commit is contained in:
2025-10-01 15:57:46 +02:00
parent c21cb47a54
commit 057fe88a21
3 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{
perSystem =
{
pkgs,
...
}:
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.nil
pkgs.nixfmt-rfc-style
pkgs.cargo
pkgs.rust-analyzer
];
};
};
}

77
flake.lock generated Normal file
View File

@@ -0,0 +1,77 @@
{
"nodes": {
"crane": {
"locked": {
"lastModified": 1752946753,
"narHash": "sha256-g5uP3jIj+STUcfTJDKYopxnSijs2agRg13H0SGL5iE4=",
"owner": "ipetkov",
"repo": "crane",
"rev": "544d09fecc8c2338542c57f3f742f1a0c8c71e13",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1752687322,
"narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1751159883,
"narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"crane": "crane",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

48
flake.nix Normal file
View File

@@ -0,0 +1,48 @@
{
description = "Lila language";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
};
outputs =
inputs@{ flake-parts, crane, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./devShells/flake-module.nix
];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem =
{ pkgs, lib, ... }:
let
craneLib = crane.mkLib pkgs;
pestFilter = path: _type: (builtins.match ".*\.pest$" path) != null;
sourceFilter = path: type: (craneLib.filterCargoSources path type) || (pestFilter path type);
lilac-crate = craneLib.buildPackage ({
src = lib.cleanSourceWith {
src = ./.;
filter = sourceFilter;
name = "source";
};
});
in
{
checks = {
inherit lilac-crate;
};
packages.lilac = lilac-crate;
};
};
}