generated from Patagia/template-nix
Initial commit
This commit is contained in:
commit
7b273c7245
10 changed files with 207 additions and 0 deletions
60
flake.nix
Normal file
60
flake.nix
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue