From 805bf79ef621e75c267d08c7bcfe81a8c844c9f5 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 3 Oct 2024 09:45:45 -0500 Subject: [PATCH] Change to flake-parts instead of flake-utils --- flake.lock | 252 ++++++++++++++++++++++++++++++++++++----------------- flake.nix | 81 +++++++++-------- 2 files changed, 209 insertions(+), 124 deletions(-) diff --git a/flake.lock b/flake.lock index ca7d873..d45d4cf 100644 --- a/flake.lock +++ b/flake.lock @@ -193,36 +193,22 @@ } }, "flake-compat": { + "flake": false, "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" } }, "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -236,7 +222,7 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_4": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -252,6 +238,20 @@ "type": "github" } }, + "flake-compat_4": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "flake-compat_5": { "flake": false, "locked": { @@ -269,6 +269,22 @@ } }, "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_7": { "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -284,6 +300,24 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nixvimstable", @@ -304,7 +338,7 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixvimunstable", @@ -347,24 +381,6 @@ "inputs": { "systems": "systems_3" }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_4" - }, "locked": { "lastModified": 1726560853, "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", @@ -379,9 +395,9 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -397,9 +413,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "inputs": { - "systems": "systems_6" + "systems": "systems_5" }, "locked": { "lastModified": 1726560853, @@ -417,8 +433,8 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", "nixpkgs": [ "nixvimstable", "nixpkgs" @@ -448,7 +464,7 @@ "nixvimunstable", "flake-compat" ], - "gitignore": "gitignore_2", + "gitignore": "gitignore_3", "nixpkgs": [ "nixvimunstable", "nixpkgs" @@ -473,6 +489,27 @@ } }, "gitignore": { + "inputs": { + "nixpkgs": [ + "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" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "nixvimstable", @@ -494,7 +531,7 @@ "type": "github" } }, - "gitignore_2": { + "gitignore_3": { "inputs": { "nixpkgs": [ "nixvimunstable", @@ -622,6 +659,27 @@ "type": "github" } }, + "hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1727854478, + "narHash": "sha256-/odH2nUMAwkMgOS2nG2z0exLQNJS4S2LfMW0teqU7co=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "5f58871c9657b5fc0a7f65670fe2ba99c26c1d79", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -696,6 +754,34 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1727825735, + "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1723221148, @@ -713,6 +799,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1719082008, + "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1725001927, "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", @@ -728,7 +830,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1727634051, "narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=", @@ -744,7 +846,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1713805509, "narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=", @@ -760,7 +862,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1726463316, "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", @@ -811,12 +913,12 @@ "nixvimstable": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_2", "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -837,12 +939,12 @@ "nixvimunstable": { "inputs": { "devshell": "devshell_2", - "flake-compat": "flake-compat_3", - "flake-parts": "flake-parts_2", + "flake-compat": "flake-compat_4", + "flake-parts": "flake-parts_3", "git-hooks": "git-hooks_2", "home-manager": "home-manager_3", "nix-darwin": "nix-darwin_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix_2" }, @@ -878,7 +980,7 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixvimunstable", "nixpkgs" @@ -903,9 +1005,10 @@ "agenix": "agenix", "btc": "btc", "darwin": "darwin_2", - "flake-utils": "flake-utils_2", + "flake-parts": "flake-parts", "hm": "hm", "hmunstable": "hmunstable", + "hooks": "hooks", "nix23_05": "nix23_05", "nixstable": "nixstable", "nixunstable": "nixunstable", @@ -1009,21 +1112,6 @@ "type": "github" } }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -1068,9 +1156,9 @@ }, "vsext": { "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_4" + "flake-compat": "flake-compat_5", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1727833615, @@ -1088,8 +1176,8 @@ }, "wsl": { "inputs": { - "flake-compat": "flake-compat_5", - "flake-utils": "flake-utils_5", + "flake-compat": "flake-compat_6", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixunstable" ] @@ -1112,8 +1200,8 @@ "inputs": { "crane": "crane", "fenix": "fenix", - "flake-compat": "flake-compat_6", - "nixpkgs": "nixpkgs_5" + "flake-compat": "flake-compat_7", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1727792524, diff --git a/flake.nix b/flake.nix index 5bf6145..6685ad3 100644 --- a/flake.nix +++ b/flake.nix @@ -16,7 +16,8 @@ url = "github:lnl7/nix-darwin/master"; inputs.nixpkgs.follows = "nixunstable"; }; - flake-utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; + hooks.url = "github:cachix/git-hooks.nix"; hm = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixstable"; @@ -39,26 +40,18 @@ zed.url = "github:zed-industries/zed/v0.154.x"; }; - outputs = { - agenix, - flake-utils, - nixunstable, - nurpkgs, - vsext, - - self, - ...}@inputs: - let + outputs = { self, ...}@inputs: let local_overlay = import ./overlays; overlays = [ - agenix.overlays.default + inputs.agenix.overlays.default local_overlay - nurpkgs.overlay - vsext.overlays.default + inputs.nurpkgs.overlay + inputs.vsext.overlays.default (_: _: { zed-editor = inputs.zed.packages.x86_64-linux.default; } ) ]; - in { + in inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; #checks = { # x86_64-linux = { # unstable = self.nixosConfigurations.jude.config.system.build.toplevel; @@ -69,40 +62,44 @@ # }; #}; - nixosConfigurations = (import ./hosts { inherit inputs overlays; }); + flake = { + nixosConfigurations = (import ./hosts { inherit inputs overlays; }); - darwinConfigurations = (import ./darwin { inherit inputs overlays; }); + darwinConfigurations = (import ./darwin { inherit inputs overlays; }); - homeConfigurations = (import ./home { inherit inputs overlays; }); + homeConfigurations = (import ./home { inherit inputs overlays; }); - devShells = (flake-utils.lib.eachSystemMap flake-utils.lib.allSystems (system: let - pkgs = import nixunstable { inherit system overlays; }; - in { - default = pkgs.mkShell { - buildInputs = with pkgs; [ - bashInteractive - curl - git - gnutar - gzip - inject - inject-darwin - tmux - vim - xonsh - ]; + overlays = { + default = local_overlay; }; - })); - overlays = { - default = local_overlay; + modules = import ./modules; }; - modules = import ./modules; - - packages = { - x86_64-linux = rec { - default = iso-beta; + perSystem = { config, self', pkgs', system, ... }: { + _module.args.pkgs = import inputs.nixpkgs { + inherit system overlays; + }; + + devShells = { + default = pkgs'.mkShell { + buildInputs = with pkgs'; [ + bashInteractive + curl + git + gnutar + gzip + inject + inject-darwin + tmux + vim + xonsh + ]; + }; + }; + + packages = rec { + defaullt = iso; iso = self.nixosConfigurations.iso.config.system.build.isoImage; iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage; };