Add docker derivation
This commit is contained in:
parent
69704a38ae
commit
36421a25d0
@ -3,7 +3,8 @@
|
|||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [x] Use timeout for fetching departures
|
- [x] Use timeout for fetching departures
|
||||||
- [ ] Write ESP8266 client
|
|
||||||
- [x] Add basic auth
|
- [x] Add basic auth
|
||||||
- [ ] Create Nix package
|
- [x] Create Nix package
|
||||||
- [ ] Create container
|
- [x] Create container
|
||||||
|
- [ ] Write ESP8266 client
|
||||||
|
- [ ] Make port configurable
|
||||||
|
21
flake.lock
generated
21
flake.lock
generated
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720957393,
|
"lastModified": 1720957393,
|
||||||
@ -18,6 +38,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
36
flake.nix
36
flake.nix
@ -3,17 +3,51 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
gitignore = {
|
||||||
|
url = "github:hercules-ci/gitignore.nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs, gitignore }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
vrnp-static = pkgs.buildGoModule {
|
||||||
|
pname = "vrnp";
|
||||||
|
version = "0.0.0";
|
||||||
|
vendorHash = null;
|
||||||
|
|
||||||
|
# For building the package, we use only the files not ignored by Git as inputs.
|
||||||
|
# Also, flake.nix and flake.lock are not included to avoid annoying rebuilds when
|
||||||
|
# working on them.
|
||||||
|
src = pkgs.lib.cleanSourceWith {
|
||||||
|
src = gitignore.lib.gitignoreSource ./.;
|
||||||
|
filter = path: type: builtins.baseNameOf path != "flake.nix" && builtins.baseNameOf path != "flake.lock";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Avoid linking against libc
|
||||||
|
CGO_ENABLED = 0;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
devShell.${system} = pkgs.mkShellNoCC {
|
devShell.${system} = pkgs.mkShellNoCC {
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.go
|
pkgs.go
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
packages.${system} = {
|
||||||
|
default = vrnp-static;
|
||||||
|
docker = pkgs.dockerTools.buildImage {
|
||||||
|
name = "git.pbrinkmeier.de/paul/vrnp";
|
||||||
|
tag = vrnp-static.version;
|
||||||
|
copyToRoot = pkgs.buildEnv {
|
||||||
|
name = "vrnp-root";
|
||||||
|
paths = [ vrnp-static pkgs.cacert ];
|
||||||
|
pathsToLink = [ "/bin" "/etc" ];
|
||||||
|
};
|
||||||
|
config.Cmd = [ "${vrnp-static}/bin/vrnp" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user