Improve flake situation
This commit is contained in:
parent
7d7f628175
commit
11ed38d364
40
flake.lock
generated
40
flake.lock
generated
@ -1,12 +1,30 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731533236,
|
||||||
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1740243248,
|
"lastModified": 1751290243,
|
||||||
"narHash": "sha256-GJ/fV5AE+4i38/eXmAgBZs4lKYXfScpxPYviUV8ujlk=",
|
"narHash": "sha256-kNf+obkpJZWar7HZymXZbW+Rlk3HTEIMlpc6FCNz0Ds=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a6c4bfe37c51686c042b4bdb4e650a9414e96680",
|
"rev": "5ab036a8d97cb9476fbe81b09076e6e91d15e1b6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -18,8 +36,24 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
84
flake.nix
84
flake.nix
@ -2,44 +2,62 @@
|
|||||||
description = "Unicode toy";
|
description = "Unicode toy";
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/release-24.11";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
let
|
flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-darwin"] (system:
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
|
||||||
utoy = pkgs.haskellPackages.developPackage {
|
inherit (pkgs.haskell.lib) compose;
|
||||||
root = ./.;
|
|
||||||
overrides = self: super: {
|
# Fix broken unicode-data-names by overriding the version of the unicode-data package.
|
||||||
|
haskellPackagesOverrides = self: super: {
|
||||||
unicode-data = super.unicode-data_0_6_0;
|
unicode-data = super.unicode-data_0_6_0;
|
||||||
unicode-data-names = pkgs.haskell.lib.markUnbroken super.unicode-data-names;
|
unicode-data-names = pkgs.haskell.lib.markUnbroken super.unicode-data-names;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in {
|
|
||||||
packages.x86_64-linux = rec {
|
|
||||||
docker =
|
|
||||||
pkgs.dockerTools.buildImage {
|
|
||||||
name = "git.pbrinkmeier.de/paul/utoy";
|
|
||||||
tag = utoy.version;
|
|
||||||
config.Cmd = [ "${pkgs.haskell.lib.justStaticExecutables utoy}/bin/utoy" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
default = utoy;
|
utoy = pkgs.lib.pipe
|
||||||
};
|
# The basic package
|
||||||
|
(pkgs.haskellPackages.developPackage {
|
||||||
|
root = ./.;
|
||||||
|
overrides = haskellPackagesOverrides;
|
||||||
|
})
|
||||||
|
# And some build configuration.
|
||||||
|
# See https://nixos.org/manual/nixpkgs/unstable/#haskell-packaging-helpers.
|
||||||
|
[
|
||||||
|
# Remove warp which pulls GHC into the runtime deps for some reason.
|
||||||
|
(compose.overrideCabal (drv: {
|
||||||
|
postInstall = ''
|
||||||
|
remove-references-to -t ${pkgs.haskellPackages.warp} $out/bin/utoy
|
||||||
|
'';
|
||||||
|
}))
|
||||||
|
# Return only the bin folder to curb image size
|
||||||
|
compose.justStaticExecutables
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
packages = rec {
|
||||||
|
docker =
|
||||||
|
pkgs.dockerTools.buildImage {
|
||||||
|
name = "git.pbrinkmeier.de/paul/utoy";
|
||||||
|
tag = utoy.version;
|
||||||
|
config.Cmd = [ "${utoy}/bin/utoy" ];
|
||||||
|
};
|
||||||
|
|
||||||
devShells.x86_64-linux.default =
|
default = utoy;
|
||||||
(pkgs.haskellPackages.developPackage {
|
};
|
||||||
root = ./.;
|
|
||||||
overrides = self: super: {
|
devShells.default =
|
||||||
unicode-data = super.unicode-data_0_6_0;
|
(pkgs.haskellPackages.developPackage {
|
||||||
unicode-data-names = pkgs.haskell.lib.markUnbroken super.unicode-data-names;
|
root = ./.;
|
||||||
};
|
overrides = haskellPackagesOverrides;
|
||||||
modifier = drv:
|
modifier = drv:
|
||||||
pkgs.haskell.lib.addBuildTools drv [
|
pkgs.haskell.lib.addBuildTools drv [
|
||||||
pkgs.cabal-install
|
pkgs.cabal-install
|
||||||
pkgs.haskellPackages.implicit-hie
|
pkgs.haskellPackages.implicit-hie
|
||||||
pkgs.haskell-language-server
|
pkgs.haskell-language-server
|
||||||
];
|
];
|
||||||
cabal2nixOptions = "--benchmark";
|
cabal2nixOptions = "--benchmark";
|
||||||
}).env;
|
}).env;
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user