mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
Merge cb0830e907
into ef2e95a294
This commit is contained in:
commit
18a2d33e2e
2 changed files with 68 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,3 +12,5 @@ deb/usr
|
||||||
*.prof
|
*.prof
|
||||||
*.db*
|
*.db*
|
||||||
*.log
|
*.log
|
||||||
|
.direnv
|
||||||
|
result
|
||||||
|
|
72
flake.nix
72
flake.nix
|
@ -1,19 +1,78 @@
|
||||||
{
|
{
|
||||||
description = "Gomuks development environment";
|
description = "Gomuks development environment & packages";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs =
|
||||||
(flake-utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.permittedInsecurePackages = [ "olm-3.2.16" ];
|
config = {
|
||||||
|
permittedInsecurePackages = [ "olm-3.2.16" ];
|
||||||
};
|
};
|
||||||
in {
|
};
|
||||||
|
|
||||||
|
outPackages = self.outputs.packages.${system};
|
||||||
|
|
||||||
|
# Extract version from version.go
|
||||||
|
versionContent = builtins.readFile ./version/version.go;
|
||||||
|
versionMatch = builtins.match ''^.*const StaticVersion = "([0-9\.]+)".*$'' versionContent;
|
||||||
|
version = builtins.elemAt versionMatch 0;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = {
|
||||||
|
gomuks = pkgs.buildGoModule {
|
||||||
|
pname = "gomuks";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
# Go dependency hash (should be updated when dependencies are)
|
||||||
|
vendorHash = "sha256-hQ8/kPS+XAMPLreIS84DOcCxOw5CNFFFTrVbkpntsMY=";
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
outPackages.gomuks-web
|
||||||
|
olm
|
||||||
|
];
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
cp -r ${outPackages.gomuks-web}/dist web/dist
|
||||||
|
'';
|
||||||
|
|
||||||
|
# skip non-existant & broken pytest tests
|
||||||
|
pytestCheckPhase = '':'';
|
||||||
|
|
||||||
|
subPackages = [ "cmd/gomuks" ];
|
||||||
|
};
|
||||||
|
# Package for building web dist
|
||||||
|
gomuks-web = pkgs.buildNpmPackage rec {
|
||||||
|
pname = "gomuks-web";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = ./web;
|
||||||
|
|
||||||
|
# Same as the Go dependency hash but for NPM packages
|
||||||
|
npmDepsHash = "sha256-anidtDhINPAX+o6M16ob7yu7tqyTlrB0l8gtkfFdIjw=";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/dist
|
||||||
|
cp -r dist/* $out/dist/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
default = outPackages.gomuks;
|
||||||
|
};
|
||||||
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
@ -36,5 +95,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}));
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue