Resolve cached naming issue; statically link Haskell dependencies

This commit is contained in:
James Eversole 2023-05-04 07:45:02 -05:00
parent 9efdc01828
commit a05d227138
4 changed files with 13 additions and 13 deletions

View File

@ -1,8 +1,8 @@
cabal-version: 1.12
name: purr
name: Purr
version: 0.3.0
description: https://git.eversole.co/purr
description: https://git.eversole.co/Purr
author: James Eversole
maintainer: james@eversole.co
copyright: 2022 James Eversole
@ -65,7 +65,7 @@ library
, wai-middleware-static >=0.5
default-language: Haskell2010
executable Purr-musl
executable Purr
main-is: Main.hs
other-modules:
Paths_Purr

2
README
View File

@ -30,7 +30,7 @@ Build binary and run natively:
nix build && ./result/bin/Purr-musl
Build and add Docker image to local registry:
nix build .#purrImage && docker load < result
nix build .#purr-docker && docker load < result
DEVELOPMENT & SUPPORT

6
flake.lock generated
View File

@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1683067191,
"narHash": "sha256-41nOQDiYytmT6YVfI+X/Qo+rfIJOSuQ7OTAANAFp82o=",
"lastModified": 1683159243,
"narHash": "sha256-Fh41KQcZTswb4NyYfSsbNEhDS/Im0/Id6m3k7qZ6/Xw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a002cddf22e5f6c59c5cdeece1285c7ae9236d7d",
"rev": "3a227d4f883aa6b39b1772041494f38a9a427595",
"type": "github"
},
"original": {

View File

@ -9,14 +9,13 @@
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = nixpkgs.legacyPackages.${system};
packageName = "purr";
dockerPackageName = "${packageName}-docker";
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "purr";
enableSharedExecutables = false;
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {
@ -32,8 +31,9 @@
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};
devShell = self.devShells.${system}.default;
packages.purrImage = pkgs.dockerTools.buildImage {
packages.${dockerPackageName} = pkgs.dockerTools.buildImage {
name = "purr";
copyToRoot = pkgs.buildEnv {
name = "image-root";