From 75e5e524bdc9806e0b51468657d6f31a2c5d5335 Mon Sep 17 00:00:00 2001 From: Sander Date: Tue, 19 Nov 2024 03:26:47 +0400 Subject: [PATCH] dev: dog-food devenv outputs It would've been great to dedupe the inputs by reading the flake, but that naturally results in a loop because our patched nix picks up the devenv.nix. --- devenv.lock | 149 +++++++++++++++++++++++++++++++++++++++++++++------- devenv.nix | 6 +++ devenv.yaml | 7 ++- 3 files changed, 141 insertions(+), 21 deletions(-) diff --git a/devenv.lock b/devenv.lock index 322f63949..cb1cd0e60 100644 --- a/devenv.lock +++ b/devenv.lock @@ -1,14 +1,33 @@ { "nodes": { + "cachix": { + "inputs": { + "devenv": [], + "flake-compat": "flake-compat", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1728672398, + "owner": "cachix", + "repo": "cachix", + "rev": "aac51f698309fd0f381149214b7eee213c66ef0a", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "latest", + "repo": "cachix", + "type": "github" + } + }, "devenv": { "locked": { - "dir": "src/modules", - "path": ".", + "path": "./src/modules", "type": "path" }, "original": { - "dir": "src/modules", - "path": ".", + "path": "./src/modules", "type": "path" }, "parent": [] @@ -43,6 +62,21 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -65,18 +99,22 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": [ + "cachix", + "flake-compat" + ], "gitignore": "gitignore", "nixpkgs": [ + "cachix", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1730302582, + "lastModified": 1731363552, "owner": "cachix", "repo": "git-hooks.nix", - "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", "type": "github" }, "original": { @@ -88,6 +126,7 @@ "gitignore": { "inputs": { "nixpkgs": [ + "cachix", "git-hooks", "nixpkgs" ] @@ -105,6 +144,26 @@ "type": "github" } }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "libgit2": { "flake": false, "locked": { @@ -125,7 +184,7 @@ "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", "libgit2": "libgit2", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-23-11": "nixpkgs-23-11", "nixpkgs-regression": "nixpkgs-regression", "pre-commit-hooks": "pre-commit-hooks" @@ -146,15 +205,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1730665687, + "lastModified": 1731676054, "owner": "NixOS", "repo": "nixpkgs", - "rev": "df9782b6077321330159a0ad8902d879f093d7c1", + "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-24.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -191,10 +250,25 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1730327045, + "lastModified": 1731797254, "owner": "NixOS", "repo": "nixpkgs", - "rev": "080166c15633801df010977d9d7474b4a6c549d7", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1731797254, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", "type": "github" }, "original": { @@ -205,6 +279,21 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1731954261, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ad2c28c6c5cc04e09bed68db46db5718d40b5b9e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1716977621, "owner": "cachix", @@ -237,10 +326,32 @@ ] }, "locked": { - "lastModified": 1730302582, + "lastModified": 1731363552, "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1731363552, + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", "type": "github" }, "original": { @@ -251,13 +362,11 @@ }, "root": { "inputs": { + "cachix": "cachix", "devenv": "devenv", - "git-hooks": "git-hooks", "nix": "nix", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": [ - "git-hooks" - ] + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks_2" } } }, diff --git a/devenv.nix b/devenv.nix index afec0c5ff..f1df9cbf7 100644 --- a/devenv.nix +++ b/devenv.nix @@ -6,6 +6,8 @@ env.RUST_LOG_SPAN_EVENTS = "full"; env.DATABASE_URL = "sqlite:.devenv/nix-eval-cache.db"; + cachix.pull = [ "cachix" ]; + packages = [ pkgs.cairo pkgs.git @@ -38,6 +40,10 @@ devcontainer.settings.customizations.vscode.extensions = [ "jnoortheen.nix-ide" ]; difftastic.enable = true; + outputs = { + devenv = import ./package.nix { inherit inputs pkgs; }; + }; + processes = { docs.exec = "mkdocs serve"; tailwind.exec = "watchexec -e html,css,js devenv-generate-doc-css"; diff --git a/devenv.yaml b/devenv.yaml index 39bd42e7f..aade5dc0f 100644 --- a/devenv.yaml +++ b/devenv.yaml @@ -1,6 +1,11 @@ # yaml-language-server: $schema=./docs/devenv.schema.json inputs: devenv: - url: path:.?dir=src/modules + url: path:./src/modules nix: url: github:domenkozar/nix/devenv-2.24 + cachix: + url: github:cachix/cachix/latest + inputs: + devenv: + follows: ""