Skip to content

Commit

Permalink
Use nixos-unified to scaffold toplevel flake
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Oct 20, 2024
1 parent 5d302da commit 6e9caa8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 32 deletions.
33 changes: 17 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@
description = "Nix template for Haskell projects";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
nixos-unified.url = "github:srid/nixos-unified/mkFlake";
haskell-flake.url = "github:srid/haskell-flake";
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
fourmolu-nix.url = "github:jedimahdi/fourmolu-nix";
};

outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;

# See ./nix/modules/*.nix for the modules that are imported here.
imports = with builtins;
map
(fn: ./nix/modules/${fn})
(attrNames (readDir ./nix/modules));
};
inputs.nixos-unified.lib.mkFlake
{ inherit inputs; root = ./.; };
}
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions nix/modules/haskell.nix → nix/modules/flake-parts/haskell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ inputs, ... }:
{ root, inputs, ... }:
{
imports = [
inputs.haskell-flake.flakeModule
Expand All @@ -11,12 +11,12 @@
# To avoid unnecessary rebuilds, we filter projectRoot:
# https://community.flake.parts/haskell-flake/local#rebuild
projectRoot = builtins.toString (lib.fileset.toSource {
root = ../..;
inherit root;
fileset = lib.fileset.unions [
../../src
../../haskell-template.cabal
../../LICENSE
../../README.md
(root + /src)
(root + /haskell-template.cabal)
(root + /LICENSE)
(root + /README.md)
];
});

Expand Down
File renamed without changes.

0 comments on commit 6e9caa8

Please sign in to comment.