mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-01-07 22:37:23 +08:00
initial commit
This commit is contained in:
parent
f22c5e2dee
commit
1ebef7aad2
1 changed files with 42 additions and 0 deletions
42
source/recipes/build/nixpkg/flake.nix
Normal file
42
source/recipes/build/nixpkg/flake.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
description = "a very simple and friendly flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
devShells = rec {
|
||||
default = pkgs.mkShell {
|
||||
packages = [ pkgs.cowsay ];
|
||||
};
|
||||
};
|
||||
|
||||
packages = rec {
|
||||
hello = pkgs.writeShellApplication {
|
||||
name = "hello-cow";
|
||||
|
||||
runtimeInputs = [
|
||||
pkgs.cowsay
|
||||
];
|
||||
|
||||
text = ''
|
||||
cowsay "hello";
|
||||
'';
|
||||
};
|
||||
default = hello;
|
||||
};
|
||||
|
||||
apps = rec {
|
||||
hello = flake-utils.lib.mkApp { drv = self.packages.${system}.hello; };
|
||||
default = hello;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue