From 0de0a3898a1791b7e3518e9ed20a950e9d496f83 Mon Sep 17 00:00:00 2001 From: atagen Date: Tue, 20 Aug 2024 13:11:37 +1000 Subject: [PATCH] real meat hours --- flake.lock | 72 +++++++++++---------- flake.nix | 8 ++- flakes/meat/flake.lock | 138 ++++++++++++++++++++++++++++++++++++++--- flakes/meat/flake.nix | 34 ++++++---- flakes/meat/meat.nix | 4 +- flakes/meat/src/meat | 37 ++++++----- util/overlay.nix | 2 +- 7 files changed, 217 insertions(+), 78 deletions(-) diff --git a/flake.lock b/flake.lock index 9785049..95849a3 100644 --- a/flake.lock +++ b/flake.lock @@ -320,12 +320,23 @@ }, "meat": { "inputs": { - "nixpkgs": "nixpkgs_2", + "lix": [ + "lix" + ], + "lix-module": [ + "lix-module" + ], + "nh": [ + "nh" + ], + "nixpkgs": [ + "nixpkgs" + ], "src": "src" }, "locked": { "lastModified": 1, - "narHash": "sha256-rSDpVXibiY1VWt3n0drGhf7G19PbeCoShnzadNLhGLE=", + "narHash": "sha256-T4MMXt0Cz5j6HeOnFroHCB6zllhUWb+0/6OUXhNJEIA=", "path": "flakes/meat", "type": "path" }, @@ -336,7 +347,7 @@ }, "nh": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1723994268, @@ -354,7 +365,7 @@ }, "nix-index-database": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1723950649, @@ -396,7 +407,7 @@ "inputs": { "flake-parts": "flake-parts", "flake-root": "flake-root", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -416,16 +427,16 @@ "nixos-cosmic": { "inputs": { "flake-compat": "flake-compat_3", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "nixpkgs-stable": "nixpkgs-stable_2", "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1724031331, - "narHash": "sha256-X1SK0Xrty5yo5DyihYtM7NFyOoO+dnkz9uhywjntiqY=", + "lastModified": 1724118408, + "narHash": "sha256-nSKfqpr8RZDWkWi0FfvVrabOmnryVxYDayMa3Hz847c=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "1c1b4a675c4c1b5ccf04f2112ad34a7622cfca7d", + "rev": "04a0f18cf0a4f1499d8abec419bd92e87cb05157", "type": "github" }, "original": { @@ -516,19 +527,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1723637854, - "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", - "path": "/nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source", - "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1722519197, "narHash": "sha256-VEdJmVU2eLFtLqCjTYJd1J7+Go8idAcZoT11IewFiRg=", @@ -544,7 +542,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1723637854, "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", @@ -560,7 +558,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1681303793, "narHash": "sha256-JEdQHsYuCfRL2PICHlOiH/2ue3DwoxUX7DJ6zZxZXFk=", @@ -576,7 +574,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1714562304, "narHash": "sha256-Mr3U37Rh6tH0FbaDFu0aZDwk9mPAe7ASaqDOGgLqqLU=", @@ -592,13 +590,13 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { - "lastModified": 1723637854, - "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", + "lastModified": 1723991338, + "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", + "rev": "8a3354191c0d7144db9756a74755672387b702ba", "type": "github" }, "original": { @@ -610,11 +608,11 @@ }, "nur": { "locked": { - "lastModified": 1724103901, - "narHash": "sha256-yupLp7tv5yu3KvrWQ9mLpCKyVks8RyEvNQVCFToyxdw=", + "lastModified": 1724122553, + "narHash": "sha256-Rmznjo2DXZySnG9jcK6afMdMsXGw/tTKSdZOfXUuDYw=", "owner": "nix-community", "repo": "NUR", - "rev": "7d49736b4409f42a795a9129f66e1fc02983221b", + "rev": "69851a9766d82a7c238c6f02951595298b2be03a", "type": "github" }, "original": { @@ -631,7 +629,7 @@ "flake-utils" ], "gitignore": "gitignore", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -706,11 +704,11 @@ ] }, "locked": { - "lastModified": 1723947704, - "narHash": "sha256-TcVf66N2NgGhxORFytzgqWcg0XJ+kk8uNLNsTRI5sYM=", + "lastModified": 1724034091, + "narHash": "sha256-b1g7w0sw+MDAhUAeCoX1vlTghsqcDZkxr+k9OZmxPa8=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "456e78a55feade2c3bc6d7bc0bf5e710c9d86120", + "rev": "c7d36e0947826e0751a5214ffe82533fbc909bc0", "type": "github" }, "original": { @@ -723,7 +721,7 @@ "flake": false, "locked": { "lastModified": 1, - "narHash": "sha256-5ERbpb0KT/FE7MEk0l6cdcoMVN+8w31tCHWzCnRjlZQ=", + "narHash": "sha256-umGkS7ykeYKQYf5D1Eixm7mq/8BJ3QFqyL8RS0Ab+DY=", "path": "src", "type": "path" }, diff --git a/flake.nix b/flake.nix index 872f582..ce0f4fe 100644 --- a/flake.nix +++ b/flake.nix @@ -46,7 +46,13 @@ inputs.lix.follows = "lix"; }; - meat.url = "path:flakes/meat"; + meat = { + url = "path:flakes/meat"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.lix.follows = "lix"; + inputs.lix-module.follows = "lix-module"; + inputs.nh.follows = "nh"; + }; }; outputs = { diff --git a/flakes/meat/flake.lock b/flakes/meat/flake.lock index 4a78fda..da38d03 100644 --- a/flakes/meat/flake.lock +++ b/flakes/meat/flake.lock @@ -1,21 +1,130 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "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" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1724058824, + "narHash": "sha256-WkRs8plqBYxIgrcz1jenmxbcLVVpo9Z9Waot9qIlqmI=", + "rev": "e727dbc3a3d59d7742a24a2b394b63a04ecb4d24", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e727dbc3a3d59d7742a24a2b394b63a04ecb4d24.tar.gz?rev=e727dbc3a3d59d7742a24a2b394b63a04ecb4d24" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/lix/archive/main.tar.gz" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils", + "flakey-profile": "flakey-profile", + "lix": [ + "lix" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723511483, + "narHash": "sha256-rT/OkVXKkns2YvyF1nFvl+8Gc3sld1c1sXPtGkbqaDY=", + "rev": "cecf70b77539c1a593f60ec9d0305b5e537ab6a9", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cecf70b77539c1a593f60ec9d0305b5e537ab6a9.tar.gz?rev=cecf70b77539c1a593f60ec9d0305b5e537ab6a9" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz" + } + }, + "nh": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1723994268, + "narHash": "sha256-3nHuGGBTqUxy1g7sm+1zTNLxbz9fnMr1ZX9etCWlFG8=", + "owner": "viperML", + "repo": "nh", + "rev": "dd8bdc83cfd7d3a8c7167589a03577c21ea015d2", + "type": "github" + }, + "original": { + "owner": "viperML", + "repo": "nh", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1723637854, - "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", - "path": "/nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source", - "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", - "type": "path" + "lastModified": 1722519197, + "narHash": "sha256-VEdJmVU2eLFtLqCjTYJd1J7+Go8idAcZoT11IewFiRg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "05405724efa137a0b899cce5ab4dde463b4fd30b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1723991338, + "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8a3354191c0d7144db9756a74755672387b702ba", + "type": "github" }, "original": { "id": "nixpkgs", + "ref": "nixos-unstable", "type": "indirect" } }, "root": { "inputs": { - "nixpkgs": "nixpkgs", + "lix": "lix", + "lix-module": "lix-module", + "nh": "nh", + "nixpkgs": "nixpkgs_2", "src": "src" } }, @@ -23,7 +132,7 @@ "flake": false, "locked": { "lastModified": 1, - "narHash": "sha256-5ERbpb0KT/FE7MEk0l6cdcoMVN+8w31tCHWzCnRjlZQ=", + "narHash": "sha256-umGkS7ykeYKQYf5D1Eixm7mq/8BJ3QFqyL8RS0Ab+DY=", "path": "src", "type": "path" }, @@ -31,6 +140,21 @@ "path": "src", "type": "path" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flakes/meat/flake.nix b/flakes/meat/flake.nix index 0eff001..689ad1a 100644 --- a/flakes/meat/flake.nix +++ b/flakes/meat/flake.nix @@ -2,8 +2,20 @@ description = "the meat (package) manager"; inputs = { - # use registry nixpkgs - # nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs.url = "nixpkgs/nixos-unstable"; + + nh.url = "github:viperML/nh"; + + lix = { + url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz"; + flake = false; + }; + + lix-module = { + url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.lix.follows = "lix"; + }; src = { url = "path:src"; @@ -14,22 +26,24 @@ outputs = { self, nixpkgs, + lix-module, + lix, + nh, src, }: let - # System types to support. supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; - # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - # Nixpkgs instantiated for supported system types. nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; - # overlays = [self.overlay]; + overlays = [ + lix-module.overlays.default + nh.overlays.default + ]; }); in { - # Provide some binary packages for selected system types. packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in { @@ -38,12 +52,8 @@ }; }); - # The default package for 'nix build'. This makes sense if the - # flake provides only one package or there is a clear "main" - # package. defaultPackage = forAllSystems (system: self.packages.${system}.meat); - # A NixOS module, if applicable (e.g. if the package provides a system service). nixosModules.meat = { pkgs, config, @@ -68,7 +78,5 @@ }; }; }; - - # Tests run by 'nix flake check' and by Hydra. }; } diff --git a/flakes/meat/meat.nix b/flakes/meat/meat.nix index 371d8f7..9923b2c 100644 --- a/flakes/meat/meat.nix +++ b/flakes/meat/meat.nix @@ -3,14 +3,14 @@ src, stdenvNoCC, bash, - nix, + lix, # how to override this to use latest? nh, git, makeWrapper, }: let deps = [ bash - nix + lix nh git ]; diff --git a/flakes/meat/src/meat b/flakes/meat/src/meat index 306588f..becd4aa 100755 --- a/flakes/meat/src/meat +++ b/flakes/meat/src/meat @@ -1,43 +1,44 @@ #!/usr/bin/env bash - cmd=${1:help} shift - -call_nix() { - cd $(dirname $0) - nixpkgs_pin=$(nix eval --raw -f npins/default.nix nixpkgs) - nix_path="nixpkgs=${nixpkgs_pin}:nixos-config=${HOME}/.nix/entry.nix" - local cmd=$1 - shift - env NIX_PATH="${nix_path}" nixos-rebuild "$cmd" --fast "$@" -} - - cd $FLAKE + +printf "MEAT v0.0.1\n" + case $cmd in + look) - nix flake show + nix flake info ;; fresh) - nix flake update $@ + if [[ "${#@}" > 0 ]]; then + for f in $@; do + if [ -d "./flakes/$f" ]; then + nix flake update --flake "./flakes/$f" + nix flake update $@ + fi + done + else + for f in ./flakes/*; do + nix flake update --flake "$f" + done + nix flake update + fi ;; yum) nh os switch -- $@ - # call_nix switch "$@" ;; cook) nh os build $@ - # call_nix build "$@" ;; poke) nh os build -- --show-trace $@ - # call_nix build --show-trace "$@" ;; help|*) @@ -52,5 +53,7 @@ case $cmd in ------------------------------------------------------\n" ;; + esac + cd $PWD diff --git a/util/overlay.nix b/util/overlay.nix index ee77e3b..63b8147 100644 --- a/util/overlay.nix +++ b/util/overlay.nix @@ -1,4 +1,4 @@ -{...}: { +{inputs, ...}: { additions = final: _prev: import ../.old/pkgs {pkgs = final;}; rice = import ./rice.nix; }