aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-31 16:41:47 +0900
committernsfisis <nsfisis@gmail.com>2025-08-31 16:41:47 +0900
commit54699e921e23a684c711773b123c1bcfecd91ae0 (patch)
tree606ac78296ecc82b6ab215931951073c9188c1c3 /flake.nix
parentc84b5ccd48ca188f439cde3e5cdac95d26ed0be3 (diff)
downloadducc-54699e921e23a684c711773b123c1bcfecd91ae0.tar.gz
ducc-54699e921e23a684c711773b123c1bcfecd91ae0.tar.zst
ducc-54699e921e23a684c711773b123c1bcfecd91ae0.zip
feat: add Nix support
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..385fcc1
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,54 @@
+{
+ description = "Decidedly Unimplemented C compiler, a toy C compiler";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
+
+ systems.url = "github:nix-systems/x86_64-linux";
+
+ flake-utils = {
+ url = "github:numtide/flake-utils";
+ inputs.systems.follows = "systems";
+ };
+
+ treefmt-nix = {
+ url = "github:numtide/treefmt-nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ flake-utils,
+ treefmt-nix,
+ ...
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ treefmt = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
+ in
+ {
+ packages.default = pkgs.stdenv.mkDerivation {
+ pname = "ducc";
+ version = "0.1.0";
+ src = ./.;
+ installPhase = ''
+ mkdir -p $out/bin
+ cp build/ducc $out/bin
+ '';
+ };
+
+ devShells.default = pkgs.mkShell {
+ packages = [
+ pkgs.just
+ ];
+ };
+
+ formatter = treefmt.config.build.wrapper;
+ }
+ );
+}