From 2242f128a9bb8b250bf2f845da614204a145b179 Mon Sep 17 00:00:00 2001 From: Fabrice Bellamy <12b@distrilab.fr> Date: Thu, 19 Dec 2024 11:07:32 +0100 Subject: [PATCH] pre-fetch nixpkgs revision hash --- README.md | 9 ++++++--- krops.nix | 5 +++-- nixpkgs.json | 12 ++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 nixpkgs.json diff --git a/README.md b/README.md index d3d78e9..67d815a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ # Nixin krops POC This is a proof of concept of using krops to deploy nixos configuration generated by nixin -## How to deploy -To deploy configuration of only one server : +## Tips +Deploy configuration of only one server : nix-build ./krops.nix -A arachnide && ./result -To deploy configration of all servers +Deploy configration of all servers : nix-build ./krops.nix -A all && ./result +Update th revision of nixpkgs that is used : +nix-prefetch-git --url https://github.com/NixOS/nixpkgs --rev "refs/heads/nixos-24.11" > nixpkgs.json + ## References - krops : https://github.com/krebs/krops diff --git a/krops.nix b/krops.nix index cc13975..b81d214 100644 --- a/krops.nix +++ b/krops.nix @@ -4,6 +4,7 @@ let }; lib = import "${krops}/lib"; pkgs = import "${krops}/pkgs" {}; + importJson = (import {}).lib.importJSON; source = name: lib.evalSource [ { @@ -15,8 +16,8 @@ let name = "${name}"; }; nixpkgs.git = { - ref = "nixos-24.11"; - url = https://github.com/NixOS/nixpkgs-channels; + ref = (importJson ./nixpkgs.json).rev; + url = https://github.com/NixOS/nixpkgs; }; } ]; diff --git a/nixpkgs.json b/nixpkgs.json new file mode 100644 index 0000000..5242af5 --- /dev/null +++ b/nixpkgs.json @@ -0,0 +1,12 @@ +{ + "url": "https://github.com/NixOS/nixpkgs", + "rev": "394571358ce82dff7411395829aa6a3aad45b907", + "date": "2024-12-15T20:39:46-08:00", + "path": "/nix/store/avy6z2v675lfxax5idvz67hn7yf32cd4-nixpkgs", + "sha256": "1cb6dmpfsz4zyk41b6z07nhrf20c8b6ryb103kc6088c2vm63ycv", + "hash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +}