generated from Patagia/template-nix
61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
|
{
|
||
|
description = "My Project";
|
||
|
|
||
|
inputs = {
|
||
|
flake-utils.url = "github:numtide/flake-utils";
|
||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||
|
};
|
||
|
|
||
|
outputs =
|
||
|
{
|
||
|
self,
|
||
|
flake-utils,
|
||
|
nixpkgs,
|
||
|
...
|
||
|
}:
|
||
|
flake-utils.lib.eachDefaultSystem (
|
||
|
system:
|
||
|
let
|
||
|
pkgs = import nixpkgs { inherit system; };
|
||
|
in
|
||
|
{
|
||
|
# Formatter for the Nix code
|
||
|
formatter = pkgs.nixpkgs-fmt;
|
||
|
|
||
|
# Checks/tests for the project
|
||
|
checks = {
|
||
|
# FIXME: Add actual tests
|
||
|
simple-test = pkgs.runCommand "simple-test" { } ''
|
||
|
${self.packages.${system}.default}/bin/my-program
|
||
|
touch $out
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
# Packages
|
||
|
packages = {
|
||
|
my-program = pkgs.writeShellScriptBin "my-program" ''
|
||
|
${pkgs.ddate}/bin/ddate +'Hello, world! Today is the %e of %B%, %Y' |
|
||
|
${pkgs.cowsay}/bin/cowsay
|
||
|
'';
|
||
|
|
||
|
default = self.packages.${system}.my-program;
|
||
|
};
|
||
|
|
||
|
# Development shell
|
||
|
devShells.default = pkgs.mkShell {
|
||
|
buildInputs = with pkgs; [
|
||
|
just
|
||
|
watchexec
|
||
|
];
|
||
|
shellHook = ''
|
||
|
echo
|
||
|
echo "✨ Welcome to the My Project development environment! ✨"
|
||
|
echo "Run 'just' to see available commands."
|
||
|
echo
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
}
|
||
|
);
|
||
|
}
|