From ad21aba50c867d5d3386c77e3f58b706ab45ccac Mon Sep 17 00:00:00 2001 From: Yuto Nishida Date: Fri, 29 Aug 2025 20:04:35 -0700 Subject: [PATCH] Add everything-parts --- experimental/everything-parts/flake.lock | 241 +++++++++++++++++++++++ experimental/everything-parts/flake.nix | 80 ++++++++ flake-profiles/outputs.nix | 5 + 3 files changed, 326 insertions(+) create mode 100644 experimental/everything-parts/flake.lock create mode 100644 experimental/everything-parts/flake.nix diff --git a/experimental/everything-parts/flake.lock b/experimental/everything-parts/flake.lock new file mode 100644 index 0000000..c50ce5a --- /dev/null +++ b/experimental/everything-parts/flake.lock @@ -0,0 +1,241 @@ +{ + "nodes": { + "cachix": { + "inputs": { + "devenv": [ + "devenv" + ], + "flake-compat": [ + "devenv" + ], + "git-hooks": [ + "devenv", + "git-hooks" + ], + "nixpkgs": [ + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748883665, + "narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=", + "owner": "cachix", + "repo": "cachix", + "rev": "f707778d902af4d62d8dd92c269f8e70de09acbe", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "latest", + "repo": "cachix", + "type": "github" + } + }, + "devenv": { + "inputs": { + "cachix": "cachix", + "flake-compat": "flake-compat", + "git-hooks": "git-hooks", + "nix": "nix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756415044, + "narHash": "sha256-Oj4Tvk1Za5CqGxZ43IoGWBySgfN0/JK+rfb1Tmk59QQ=", + "owner": "cachix", + "repo": "devenv", + "rev": "c570189b38b549141179647da3ddde249ac50fec", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "devenv", + "nix", + "nixpkgs" + ] + }, + "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" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "devenv", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "flake-parts": "flake-parts", + "git-hooks-nix": [ + "devenv", + "git-hooks" + ], + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-23-11": [ + "devenv" + ], + "nixpkgs-regression": [ + "devenv" + ] + }, + "locked": { + "lastModified": 1755029779, + "narHash": "sha256-3+GHIYGg4U9XKUN4rg473frIVNn8YD06bjwxKS1IPrU=", + "owner": "cachix", + "repo": "nix", + "rev": "b0972b0eee6726081d10b1199f54de6d2917f861", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "devenv-2.30", + "repo": "nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1756381814, + "narHash": "sha256-tzo7YvAsGlzo4WiIHT0ooR59VHu+aKRQdHk7sIyoia4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aca2499b79170038df0dbaec8bf2f689b506ad32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1753579242, + "narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/experimental/everything-parts/flake.nix b/experimental/everything-parts/flake.nix new file mode 100644 index 0000000..9aa885a --- /dev/null +++ b/experimental/everything-parts/flake.nix @@ -0,0 +1,80 @@ +# Testing flake-parts +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + devenv.url = "github:cachix/devenv"; + devenv.inputs.nixpkgs.follows = "nixpkgs"; + }; + nixConfig = { + extra-trusted-public-keys = [ + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + extra-substituters = [ + "https://devenv.cachix.org" + "https://nix-community.cachix.org" + ]; + }; + outputs = inputs@{ flake-parts, ... }: + # https://flake.parts/module-arguments.html + flake-parts.lib.mkFlake { inherit inputs; } (top@{ config, withSystem, moduleWithSystem, ... }: { + imports = [ + # Optional: use external flake logic, e.g. + inputs.devenv.flakeModule + ]; + flake = { + # Put your original flake attributes here. + }; + systems = [ + # systems for which you want to build the `perSystem` attributes + "x86_64-linux" + "aarch64-darwin" + ]; + perSystem = { config, pkgs, ... }: { + # Recommended: move all package definitions here. + # e.g. (assuming you have a nixpkgs input) + # packages.foo = pkgs.callPackage ./foo/package.nix { }; + # packages.bar = pkgs.callPackage ./bar/package.nix { + # foo = config.packages.foo; + # }; + packages = { + hello = pkgs.hello; + sops = pkgs.sops; + ssh-to-age = pkgs.ssh-to-age; + pulumi-bin = pkgs.pulumi-bin; + }; + + devenv.shells = { + everything-dev = { + packages = [ + config.packages.hello + config.packages.sops + config.packages.ssh-to-age + ]; + + enterShell = '' + hello + echo "Reminder: Do not use git in this repo. Use jujutsu instead." + echo "Don't forget to run `jj new` before making a new change." + ''; + + processes.hello.exec = "hello"; + + languages.nix.enable = true; + }; + jupiter = { + packages = [ + config.packages.hello + config.packages.pulumi-bin + ]; + enterShell = '' + hello + ''; + }; + }; + + devShells.default = config.devShells.everything-dev; + }; + }); +} \ No newline at end of file diff --git a/flake-profiles/outputs.nix b/flake-profiles/outputs.nix index 6c0d43b..b4ff564 100644 --- a/flake-profiles/outputs.nix +++ b/flake-profiles/outputs.nix @@ -1,3 +1,8 @@ +# This file is ... not a good idea, actually +# Instead of centralizing all outputs, we should have each flake-profile +# be its own flake-parts style flake. +# Projects that want to use other flake-profiles can implement their package +# logic in the flake-profile's flake.nix. { self, ... -- 2.54.0