👷 nix build setings

This commit is contained in:
James Walker 2022-06-27 19:30:40 -04:00
parent 7d92ec00bd
commit b22583edca
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 54 additions and 6 deletions

13
default.nix Normal file
View File

@ -0,0 +1,13 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).defaultNix

23
flake.lock generated
View File

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1653893745,
@ -17,11 +33,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1654641575, "lastModified": 1655319683,
"narHash": "sha256-iifJAJRvhVg7XOPKGgjGN48r4GGSGyQZzkdAj84ocYA=", "narHash": "sha256-oeaucIu0Re7du7AGP1Y+yPqRghO+WyC6DagqaDpI7do=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "93109b6d7905559f3de76522bc1b1749e411354c", "rev": "9e74ccc250321dea913219f9ce4ed2cdbdeecfde",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -33,6 +49,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View File

@ -4,16 +4,21 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-22.05"; nixpkgs.url = "github:nixos/nixpkgs/release-22.05";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
}; };
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; let pkgs = nixpkgs.legacyPackages.${system};
in in
{ {
packages.workon = pkgs.buildGoModule { packages.workon = pkgs.buildGoModule {
name = "workon"; pname = "workon";
src = self; version = "0.2.0";
src = ./.;
vendorSha256 = "sha256-ia0Z9yz2LrRAd9huncFtl/a6R3/gRpqbg6TdnauvEmQ="; vendorSha256 = "sha256-ia0Z9yz2LrRAd9huncFtl/a6R3/gRpqbg6TdnauvEmQ=";
}; };

13
shell.nix Normal file
View File

@ -0,0 +1,13 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).shellNix