From aeedc57967ad49fac601b31e313cd7329c8db9c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=A7=E7=80=AC=E7=B4=85=E8=8E=89=E6=A0=96?= Date: Wed, 24 Jul 2024 10:05:03 +0800 Subject: [PATCH] docs: add flake example --- example/flake/.gitignore | 2 ++ example/flake/flake.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 example/flake/.gitignore create mode 100644 example/flake/flake.nix diff --git a/example/flake/.gitignore b/example/flake/.gitignore new file mode 100644 index 0000000..432c2da --- /dev/null +++ b/example/flake/.gitignore @@ -0,0 +1,2 @@ +/flake.lock +/result diff --git a/example/flake/flake.nix b/example/flake/flake.nix new file mode 100644 index 0000000..d40fbf0 --- /dev/null +++ b/example/flake/flake.nix @@ -0,0 +1,28 @@ +{ + description = "dewclaw flake example"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + dewclaw.url = "github:MakiseKurisu/dewclaw"; + }; + + outputs = + inputs@{ self + , nixpkgs + , flake-parts + , dewclaw + , ... + }: flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: { + formatter = pkgs.nixpkgs-fmt; + packages = { + dewclaw-env = pkgs.callPackage dewclaw { + configuration = import ../classic/example.nix; + }; + default = self.packages.x86_64-linux.dewclaw-env; + }; + }; + }; +}