abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorpatrick-scho2025-04-11 15:03:43 +0200
committerpatrick-scho2025-04-11 15:03:43 +0200
commit905636122af78773898162129182c7663a72a9d4 (patch)
treea23f1e2b5b9600523f6342a6a2a50936e42f91e1
parentd068d89a794d8ee0fe49ad84bb05dcb2f1f2a5fd (diff)
downloadchirp-905636122af78773898162129182c7663a72a9d4.tar.gz
chirp-905636122af78773898162129182c7663a72a9d4.zip
Update flake
-rw-r--r--flake.lock33
-rw-r--r--flake.nix47
2 files changed, 37 insertions, 43 deletions
diff --git a/flake.lock b/flake.lock
index 68aab57..169458f 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,22 +20,24 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1743125403,
- "narHash": "sha256-ax5yY7IA9XaO+qHiu2XNs7oivWlD4+YG+G8+VaAl8bE=",
- "owner": "nixos",
+ "lastModified": 1744232761,
+ "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
+ "owner": "NixOS",
"repo": "nixpkgs",
- "rev": "b25d37292b5b6a56a6a508d4632feceb52266333",
+ "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14",
"type": "github"
},
"original": {
- "owner": "nixos",
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
- "zig2nix": "zig2nix"
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
}
},
"systems": {
@@ -52,25 +54,6 @@
"repo": "default",
"type": "github"
}
- },
- "zig2nix": {
- "inputs": {
- "flake-utils": "flake-utils",
- "nixpkgs": "nixpkgs"
- },
- "locked": {
- "lastModified": 1743144458,
- "narHash": "sha256-0vS/7AWx4O7vI7kJ156tk+nahxQb+HXd/CiFx6ZPBQE=",
- "owner": "Cloudef",
- "repo": "zig2nix",
- "rev": "de3fa1e6475471ca6c76ba9a88dfa4df2befe13c",
- "type": "github"
- },
- "original": {
- "owner": "Cloudef",
- "repo": "zig2nix",
- "type": "github"
- }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 3c33dce..3444d10 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,24 +1,35 @@
{
- description = "Zig project flake";
+ description = "Chirp Flake";
- inputs = {
- self.submodules = true;
- zig2nix.url = "github:Cloudef/zig2nix";
- };
+ inputs.self.submodules = true;
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+ inputs.flake-utils.url = "github:numtide/flake-utils";
- outputs = { zig2nix, ... }: let
- flake-utils = zig2nix.inputs.flake-utils;
- in (flake-utils.lib.eachDefaultSystem (system: let
- env = zig2nix.outputs.zig-env.${system} {};
- in with builtins; with env.pkgs.lib; rec {
- apps.default = env.app [] "zig build run -- \"$@\"";
- packages.default = env.package {
- src = cleanSource ./.;
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ in {
+ packages.default = pkgs.stdenv.mkDerivation {
+ pname = "chirp";
+ version = "0.0.0";
+ src = ./.;
- nativeBuildInputs = with env.pkgs; [];
- buildInputs = with env.pkgs; [];
+ buildPhase = ''
+ mkdir -p .zig-cache-global/zig
+ ${pkgs.zig}/bin/zig build --verbose --global-cache-dir .zig-cache-global
+ '';
- zigPreferMusl = false;
- };
- }));
+ installPhase = ''
+ mkdir -p $out/bin
+ cp zig-out/bin/chirp $out/bin
+ '';
+ };
+
+ apps.default = {
+ type = "app";
+ program = "${self.packages.${system}.default}/bin/chirp";
+ };
+ });
}
+