use blueprint for flake setup
This commit is contained in:
parent
30826707cd
commit
0d7461fa92
6 changed files with 34 additions and 69 deletions
21
default.nix
21
default.nix
|
|
@ -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
8
devshell.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ pkgs }:
|
||||
|
||||
pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.mkGoEnv { pwd = ./.; }
|
||||
pkgs.gomod2nix
|
||||
];
|
||||
}
|
||||
40
flake.nix
40
flake.nix
|
|
@ -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.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
inputs.gomod2nix = {
|
||||
url = "github:nix-community/gomod2nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-utils.follows = "flake-utils";
|
||||
gomod2nix = {
|
||||
url = "github:nix-community/gomod2nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
flake-utils.follows = "flake-utils";
|
||||
};
|
||||
};
|
||||
|
||||
blueprint = {
|
||||
url = "github:numtide/blueprint";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
|
||||
(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;
|
||||
};
|
||||
})
|
||||
);
|
||||
outputs = inputs: inputs.blueprint inputs;
|
||||
}
|
||||
|
|
|
|||
9
package.nix
Normal file
9
package.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ pkgs }:
|
||||
|
||||
pkgs.buildGoApplication {
|
||||
pname = "awl-ntfy";
|
||||
version = "0.1";
|
||||
pwd = ./.;
|
||||
src = ./.;
|
||||
modules = ./gomod2nix.toml;
|
||||
}
|
||||
1
result
Symbolic link
1
result
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
/nix/store/zd7pa71h9lihln596dzpdg081kcn9g90-awl-ntfy-0.1
|
||||
24
shell.nix
24
shell.nix
|
|
@ -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
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue