remove the necessity of flake-utils

This commit is contained in:
Guz
2025-03-04 14:46:48 -03:00
parent b83c0b1667
commit deb857f70d
2 changed files with 29 additions and 53 deletions

34
flake.lock generated
View File

@@ -1,23 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1734424634, "lastModified": 1734424634,
@@ -36,24 +18,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"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", "root": "root",

View File

@@ -2,25 +2,35 @@
description = "go-grip - render your markdown files local"; description = "go-grip - render your markdown files local";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, ... }@inputs: inputs.flake-utils.lib.eachDefaultSystem ( outputs = {
system: self,
let nixpkgs,
pkgs = import nixpkgs { inherit system; }; ...
go-grip = pkgs.buildGoModule { }: let
name = "go-grip"; systems = [
src = self; "aarch64-linux"
# Only for updating vendorHas "aarch64-darwin"
# vendorHash = "sha256-RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR="; "x86_64-darwin"
vendorHash = "sha256-aU6vo/uqJzctD7Q8HPFzHXVVJwMmlzQXhAA6LSkRAow="; "x86_64-linux"
}; ];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {inherit system;};
in in
{ f pkgs);
packages.default = go-grip; in {
devShells.default = pkgs.mkShell { packages = forAllSystems (pkgs: {
nativeBuildInputs = [ go-grip ]; default = pkgs.buildGoModule {
}; name = "go-grip";
} src = self;
); # Only for updating vendorHas
# vendorHash = "sha256-RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR=";
vendorHash = "sha256-aU6vo/uqJzctD7Q8HPFzHXVVJwMmlzQXhAA6LSkRAow=";
};
});
devShells = forAllSystems (pkgs: {
default = self.packages.${pkgs.system}.default;
});
};
} }