Add Nix flake for development

This commit is contained in:
PopeRigby
2025-01-20 21:12:14 -08:00
parent c8a3bb5339
commit a4f8c2f62a
4 changed files with 155 additions and 0 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

6
.gitignore vendored
View File

@@ -90,3 +90,9 @@ fp-build
# scripts used locally before pushing
local_scripts
# direnv
.direnv
# Nix
result

93
flake.lock generated Normal file
View File

@@ -0,0 +1,93 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"make-shell": {
"inputs": {
"flake-compat": "flake-compat"
},
"locked": {
"lastModified": 1733933815,
"narHash": "sha256-9JjM7eT66W4NJAXpGUsdyAFXhBxFWR2Z9LZwUa7Hli0=",
"owner": "nicknovitski",
"repo": "make-shell",
"rev": "ffeceae9956df03571ea8e96ef77c2924f13a63c",
"type": "github"
},
"original": {
"owner": "nicknovitski",
"repo": "make-shell",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1735291276,
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1733096140,
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"make-shell": "make-shell",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

55
flake.nix Normal file
View File

@@ -0,0 +1,55 @@
{
description = "A flake providing a development environment for Limo";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
make-shell.url = "github:nicknovitski/make-shell";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = with inputs; [
make-shell.flakeModules.default
];
perSystem =
{
config,
pkgs,
system,
...
}:
{
# Required for unrar
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
packages.default = pkgs.limo.overrideAttrs {
src = ./.;
meta.mainProgram = "limo";
};
make-shells.default = {
packages =
with pkgs;
[
clang-tools
gcc
gdb
git
]
++ config.packages.default.nativeBuildInputs
++ config.packages.default.buildInputs;
};
};
};
}