From 4333feb2c07c208f532c0ecb5648b054c0dd4ea1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 12 Jan 2024 19:24:59 +0800 Subject: [PATCH] default.nix: convert to flake-compat config Welp, it is easier to use it so here we are. --- apps/run-workflow-with-vm/configuration.nix | 2 +- default.nix | 24 +++++++++------------ flake.lock | 21 +++++++++++++++--- flake.nix | 3 +++ 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/apps/run-workflow-with-vm/configuration.nix b/apps/run-workflow-with-vm/configuration.nix index ab5e6410..6a69125e 100644 --- a/apps/run-workflow-with-vm/configuration.nix +++ b/apps/run-workflow-with-vm/configuration.nix @@ -5,7 +5,7 @@ let pkgs = import { }; - config' = import { inherit pkgs; }; + config' = import ; lib = pkgs.lib.extend (import ); modules = import { inherit lib; isInternal = true; }; diff --git a/default.nix b/default.nix index 6f9c3bcd..f620865d 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,10 @@ -{ pkgs ? import { } }: - -let - lib = pkgs.lib.extend (import ./lib/extras/extend-lib.nix); -in -{ - lib = import ./lib { lib = pkgs.lib; }; - modules.default.imports = import ./modules/nixos { inherit lib; }; - overlays = import ./overlays // rec { - foo-dogsquared-pkgs = final: prev: import ./pkgs { pkgs = prev; }; - default = foo-dogsquared-pkgs; - }; - hmModules.default.imports = import ./modules/home-manager { inherit lib; }; -} // (import ./pkgs { inherit pkgs; }) +(import + ( + let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in + fetchTarball { + url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } + ) + { src = ./.; } +).defaultNix diff --git a/flake.lock b/flake.lock index 5937768c..264263ae 100644 --- a/flake.lock +++ b/flake.lock @@ -139,6 +139,20 @@ } }, "flake-compat_2": { + "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_3": { "flake": false, "locked": { "lastModified": 1696426674, @@ -154,7 +168,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1696426674, @@ -428,7 +442,7 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-parts": "flake-parts", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", @@ -575,7 +589,7 @@ }, "nixos-wsl": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_6", "nixpkgs": [ "nixpkgs" @@ -711,6 +725,7 @@ "devshell": "devshell", "disko": "disko", "emacs-overlay": "emacs-overlay", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_3", "helix-editor": "helix-editor", "home-manager": [ diff --git a/flake.nix b/flake.nix index 90bf863c..a76b5bcf 100644 --- a/flake.nix +++ b/flake.nix @@ -75,6 +75,9 @@ # Add a bunch of pre-compiled indices since mine are always crashing. nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; + + # Make a default.nix compatible stuff. + flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; }; outputs = inputs@{ self, nixpkgs, ... }: