mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-01-09 23:32:37 +08:00
initial commit
This commit is contained in:
parent
3f33f10061
commit
78fd4cc737
7 changed files with 76 additions and 0 deletions
7
source/shell-recipes/0100-shell-with-nixpkgs.nix
Normal file
7
source/shell-recipes/0100-shell-with-nixpkgs.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with (import <nixpkgs> {});
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
hello
|
||||
cowsay
|
||||
];
|
||||
}
|
||||
10
source/shell-recipes/0150-shell-with-git-nix-pkg.nix
Normal file
10
source/shell-recipes/0150-shell-with-git-nix-pkg.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
with (import <nixpkgs> {});
|
||||
let
|
||||
hello = import (builtins.fetchGit {
|
||||
url = "https://codeberg.org/mhwombat/hello-nix";
|
||||
rev = "aa2c87f8b89578b069b09fdb2be30a0c9d8a77d8";
|
||||
});
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = [ hello ];
|
||||
}
|
||||
11
source/shell-recipes/0200-shell-with-flake.nix
Normal file
11
source/shell-recipes/0200-shell-with-flake.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
with (import <nixpkgs> {});
|
||||
let
|
||||
hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake).packages.${builtins.currentSystem}.default;
|
||||
# For older flakes, you might need an expression like this...
|
||||
# hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake).defaultPackage.${builtins.currentSystem};
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
hello
|
||||
];
|
||||
}
|
||||
9
source/shell-recipes/0250-shell-with-flake-rev.nix
Normal file
9
source/shell-recipes/0250-shell-with-flake-rev.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
with (import <nixpkgs> {});
|
||||
let
|
||||
hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake?ref=main&rev=3aa43dbe7be878dde7b2bdcbe992fe1705da3150).packages.${builtins.currentSystem}.default;
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
hello
|
||||
];
|
||||
}
|
||||
14
source/shell-recipes/0300-shell-haskell-local.nix
Normal file
14
source/shell-recipes/0300-shell-haskell-local.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
with (import <nixpkgs> {});
|
||||
let
|
||||
pandoc-linear-table = haskellPackages.callCabal2nix "pandoc-linear-table" /home/amy/github/pandoc-linear-table {};
|
||||
pandoc-logic-proof = haskellPackages.callCabal2nix "pandoc-logic-proof" /home/amy/github/pandoc-logic-proof {};
|
||||
pandoc-columns = haskellPackages.callCabal2nix "pandoc-columns" /home/amy/github/pandoc-columns {};
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
pandoc
|
||||
pandoc-linear-table
|
||||
pandoc-logic-proof
|
||||
pandoc-columns
|
||||
];
|
||||
}
|
||||
19
source/shell-recipes/0350-shell-haskell-local-deps.nix
Normal file
19
source/shell-recipes/0350-shell-haskell-local-deps.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
with (import <nixpkgs> {});
|
||||
let
|
||||
pandoc-linear-table = haskellPackages.callCabal2nix "pandoc-linear-table" /home/amy/github/pandoc-linear-table {};
|
||||
pandoc-logic-proof = haskellPackages.callCabal2nix "pandoc-logic-proof" /home/amy/github/pandoc-logic-proof {};
|
||||
pandoc-columns = haskellPackages.callCabal2nix "pandoc-columns" /home/amy/github/pandoc-columns {};
|
||||
pandoc-maths-web = haskellPackages.callCabal2nix "pandoc-maths-web" /home/amy/github/pandoc-maths-web
|
||||
{
|
||||
inherit pandoc-linear-table pandoc-logic-proof pandoc-columns;
|
||||
};
|
||||
in
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
pandoc
|
||||
pandoc-linear-table
|
||||
pandoc-logic-proof
|
||||
pandoc-columns
|
||||
pandoc-maths-web
|
||||
];
|
||||
}
|
||||
6
source/shell-recipes/0400-shell-with-env-var.nix
Normal file
6
source/shell-recipes/0400-shell-with-env-var.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
with (import <nixpkgs> {});
|
||||
mkShell {
|
||||
shellHook = ''
|
||||
export FOO="bar"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue