use blueprint for flake setup

This commit is contained in:
cato-001 2025-08-18 07:44:19 +02:00
parent 30826707cd
commit 0d7461fa92
6 changed files with 34 additions and 69 deletions

View file

@ -1,21 +0,0 @@
{ pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
in
import (fetchTree nixpkgs.locked) {
overlays = [
(import "${fetchTree gomod2nix.locked}/overlay.nix")
];
}
)
, buildGoApplication ? pkgs.buildGoApplication
}:
buildGoApplication {
pname = "awl-ntfy";
version = "0.1";
pwd = ./.;
src = ./.;
modules = ./gomod2nix.toml;
}

8
devshell.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs }:
pkgs.mkShell {
packages = [
pkgs.mkGoEnv { pwd = ./.; }
pkgs.gomod2nix
];
}

View file

@ -1,31 +1,23 @@
{ {
description = "A basic gomod2nix flake"; description = "Send notification for your local awl trash collection to your phone";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs = {
inputs.flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
inputs.gomod2nix = { gomod2nix = {
url = "github:nix-community/gomod2nix"; url = "github:nix-community/gomod2nix";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs"; nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils"; flake-utils.follows = "flake-utils";
};
};
blueprint = {
url = "github:numtide/blueprint";
inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, flake-utils, gomod2nix }: outputs = inputs: inputs.blueprint inputs;
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
callPackage = pkgs.callPackage;
in
{
packages.default = callPackage ./. {
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
devShells.default = callPackage ./shell.nix {
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
};
})
);
} }

9
package.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs }:
pkgs.buildGoApplication {
pname = "awl-ntfy";
version = "0.1";
pwd = ./.;
src = ./.;
modules = ./gomod2nix.toml;
}

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/zd7pa71h9lihln596dzpdg081kcn9g90-awl-ntfy-0.1

View file

@ -1,24 +0,0 @@
{ pkgs ? (
let
inherit (builtins) fetchTree fromJSON readFile;
inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
in
import (fetchTree nixpkgs.locked) {
overlays = [
(import "${fetchTree gomod2nix.locked}/overlay.nix")
];
}
)
, mkGoEnv ? pkgs.mkGoEnv
, gomod2nix ? pkgs.gomod2nix
}:
let
goEnv = mkGoEnv { pwd = ./.; };
in
pkgs.mkShell {
packages = [
goEnv
gomod2nix
];
}