factor meat into own repo

This commit is contained in:
atagen 2024-09-03 10:52:29 +10:00
parent 8003d9b2a6
commit ad421cea84
9 changed files with 89 additions and 515 deletions

210
flakes/meat/flake.lock generated
View file

@ -1,210 +0,0 @@
{
"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": 1724816427,
"narHash": "sha256-j/ma58x680RD8k9YGDGgj6qx/3b2qaZOBdyr0My7ik0=",
"rev": "5d31e889d7f3310cb030e85adcfd3ce64846457d",
"type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/5d31e889d7f3310cb030e85adcfd3ce64846457d.tar.gz?rev=5d31e889d7f3310cb030e85adcfd3ce64846457d"
},
"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": 1724689275,
"narHash": "sha256-wpxC7XiZ9maYZA4BSLKGXc+pn2fwaiq2Ybu5kNjl1ao=",
"owner": "viperML",
"repo": "nh",
"rev": "a922eada049854019c5d1bbc82383f7095773e5c",
"type": "github"
},
"original": {
"owner": "viperML",
"repo": "nh",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"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": 1724479785,
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1724224976,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
"path": "/nix/store/j8pbrsb3nybdap3hhg9kw0ffqd4rlbx6-source",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"lix": "lix",
"lix-module": "lix-module",
"nh": "nh",
"nixpkgs": "nixpkgs_2",
"src": "src"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1724466314,
"narHash": "sha256-ltKuK6shQ64uej1mYNtBsDYxttUNFiv9AcHqk0+0NQM=",
"path": "/nix/store/gsif96m93kai5bx7qi0v9f9451q1b1ai-source",
"rev": "2b5b3edd96ef336b00622dcabc13788fdef9e3ca",
"type": "path"
},
"original": {
"id": "rust-overlay",
"type": "indirect"
}
},
"src": {
"inputs": {
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1724817482,
"narHash": "sha256-ZVu7hWi8u8roZkHOeRAkDMkXlyIHvoQgb6UTUfP+xyk=",
"path": "/home/bolt/code/meat",
"type": "path"
},
"original": {
"path": "/home/bolt/code/meat",
"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",
"version": 7
}

View file

@ -1,54 +0,0 @@
{
description = "the meat (package) manager";
inputs = {
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:/home/bolt/code/meat";
};
outputs = {
self,
nixpkgs,
lix-module,
nh,
src,
...
}: let
pkgs = import nixpkgs {
overlays = [
lix-module.overlays.default
nh.overlays.default
];
system = "x86_64-linux";
};
in {
# packages.meat = pkgs.callPackage ./meat.nix {
# inherit src;
# };
packages.meat = src.packages.x86_64-linux.default;
defaultPackage = self.packages.meat;
overlays.meat = final: prev: {
meat = self.defaultPackage;
};
nixosModules.meat = import ./module.nix {
meatOverlay = self.overlays.meat;
};
};
}

View file

@ -1,28 +0,0 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.programs.meat;
in {
options.programs.meat = {
enable = mkEnableOption "meat";
flake = mkOption {
type = with types; nullOr (either path str);
default = null;
description = "path to your system flake";
};
};
config =
lib.mkIf
cfg.enable
{
environment.systemPackages = [pkgs.meat];
environment.sessionVariables.FLAKE =
if (cfg.flake == null)
then abort "Please set the programs.meat.flake option to your system flake."
else config.programs.meat.flake;
};
}

View file

@ -1,37 +0,0 @@
{
lib,
src,
stdenvNoCC,
bash,
lix,
nh,
git,
makeWrapper,
}: let
deps = [
bash
lix
nh
git
];
in
stdenvNoCC.mkDerivation {
inherit src;
name = "meat";
version = "0.0.1";
nativeBuildInputs = [
makeWrapper
];
buildInputs = deps;
installPhase = ''
mkdir -p $out/bin
cp meat $out/bin
'';
postFixup = ''
wrapProgram $out/bin/meat \
--set PATH /run/wrappers/bin:${lib.makeBinPath deps}
'';
meta = {
mainProgram = "meat";
};
}

View file

@ -1,4 +0,0 @@
{meatOverlay}: {
imports = [./meat-module.nix];
nixpkgs.overlays = [meatOverlay];
}

View file

@ -1,69 +0,0 @@
#!/usr/bin/env bash
cmd=${1:help}
shift
cd $FLAKE
printf "\n----- MEAT -------------------------------------------\n\n"
case $cmd in
look)
nix flake info
;;
fresh)
if [[ "$1" == "-a" ]]; then
shift
all=true
else
all=false
fi
if [[ "${#@}" > 0 ]]; then
for f in $@; do
if [ -d "./flakes/$f" ]; then
printf "subflake: $f\n"
nix flake update --flake "./flakes/$f"
fi
done
elif $all; then
printf "updating all\n"
for f in ./flakes/*; do
printf "subflake: $f\n"
nix flake update --flake "$f"
done
fi
printf "updating system\n"
nix flake update
;;
gut)
nh clean all $@
;;
yum)
nh os switch -- $@
;;
cook)
nh os build $@
;;
poke)
nh os build -- --show-trace $@
;;
help|*)
printf "\tFRESH \t\t| GET LATEST MEAT
\tYUM \t\t| CONSUME DELICIOUS MEAT
\tCOOK \t\t| ONLY PREPARE MEAT
\tPOKE \t\t| TRY COOK SUSPICIOUS MEAT
\tGUT \t\t| CLEAN MEAT
\tLOOK \t\t| INSPECT MEATS\n"
;;
esac
printf "\n------------------------------------------------------\n\n"
cd $PWD