Skip to content

Commit

Permalink
chore(nix): Add dev sub-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Apr 12, 2024
1 parent e3292f8 commit bd94a58
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
watch_file dev/flake.nix
use flake ./dev
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.direnv

/example/data.sqlite*
/example/result

/test/data.sqlite
/test/result.txt
/test/result.txt
115 changes: 115 additions & 0 deletions dev/flake.lock

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

29 changes: 29 additions & 0 deletions dev/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = { pkgs, lib, config, ... }: {
treefmt = {
projectRoot = inputs.process-compose-flake;
projectRootFile = "flake.nix";
programs = {
nixpkgs-fmt.enable = true;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];
};
};
};
}
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
inherit overrideInputs;
dir = "example";
};
dev = {
inherit overrideInputs;
dir = "dev";
};
};
};
}

0 comments on commit bd94a58

Please sign in to comment.