This commit is contained in:
Amy de Buitléir 2025-09-05 19:33:37 +01:00
parent e4e136a823
commit ffb97b96ff
9 changed files with 965 additions and 1206 deletions

2054
index.html

File diff suppressed because it is too large Load diff

View file

@ -5,3 +5,6 @@ include::nixpkg/main-generated.adoc[leveloffset=+1]
include::flake/main-generated.adoc[leveloffset=+1]
include::haskell-pkg/main-generated.adoc[leveloffset=+1]
include::non-flake/main-generated.adoc[leveloffset=+1]

View file

@ -18,13 +18,29 @@
"type": "github"
}
},
"hello-nix": {
"flake": false,
"locked": {
"lastModified": 1676213208,
"narHash": "sha256-Zds5C+f5sA3w+j85EsAQjte0zeHqubMVPGYn5lGwATo=",
"ref": "refs/heads/main",
"rev": "aa2c87f8b89578b069b09fdb2be30a0c9d8a77d8",
"revCount": 4,
"type": "git",
"url": "https://codeberg.org/mhwombat/hello-nix"
},
"original": {
"type": "git",
"url": "https://codeberg.org/mhwombat/hello-nix"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1757012778,
"narHash": "sha256-TfvMA0TsVj754lmK0VRj3OaoK4k5djo7UWsJDDGYvj0=",
"lastModified": 1757096966,
"narHash": "sha256-nJpPWCFbc5/u0VIoSHT350FEwPS5pwiRfyZBbZA3Kgg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a7a241d389c733eec41ce783696ced2fdf21a3cf",
"rev": "6eb784fb955ab56952e6eeb01f3e64a79933e2b5",
"type": "github"
},
"original": {
@ -36,6 +52,7 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"hello-nix": "hello-nix",
"nixpkgs": "nixpkgs"
}
},

View file

@ -2,18 +2,24 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
hello-nix = {
url = "git+https://codeberg.org/mhwombat/hello-nix";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, hello-nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
customGhc = pkgs.haskellPackages.ghcWithPackages (p: with p; [ containers ]);
in
{
devShells = rec {
default = pkgs.mkShell {
buildInputs = [ customGhc ];
shellHook =
''
PATH=${hello-nix}:$PATH
'';
};
};
}

View file

@ -1,9 +0,0 @@
with (import <nixpkgs> {});
let
customGhc = haskellPackages.ghcWithPackages (pkgs: with pkgs; [ containers ]);
in
mkShell {
buildInputs = [
customGhc
];
}

View file

@ -1,54 +0,0 @@
{
# See https://github.com/mhwombat/nix-for-numbskulls/blob/main/flakes.md
# for a brief overview of what each section in a flake should or can contain.
description = "a sample flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
hello-nix = {
url = "git+https://codeberg.org/mhwombat/hello-nix";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, hello-nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells = rec {
default = pkgs.mkShell {
packages = [ hello-nix ];
};
};
packages = rec {
hello = pkgs.stdenv.mkDerivation rec {
name = "hello-again";
src = ./.;
unpackPhase = "true";
buildPhase = ":";
installPhase =
''
mkdir -p $out/bin
cp $src/hello-again $out/bin/hello-again
chmod +x $out/bin/hello-again
'';
};
default = hello;
};
apps = rec {
hello = flake-utils.lib.mkApp { drv = self.packages.${system}.hello; };
default = hello;
};
}
);
}

View file

@ -1,4 +0,0 @@
#!/usr/bin/env sh
echo "I'm a flake, but I'm running a command defined in a non-flake package."
hello-nix

View file

@ -5,4 +5,12 @@ which is defined in a remote git repo on codeberg.
To use a package from GitHub, GitLab, or any other public platform,
modify the URL.
include::shell/main-generated.adoc[leveloffset=+1]
REMOVE ME
REMOVE ME
REMOVE ME
REMOVE ME
include::flake/main-generated.adoc[leveloffset=+1]

View file

@ -21,6 +21,8 @@ $ nix run ~/codeberg/hello-flake
$ nix run git+https://codeberg.org/mhwombat/hello-flake
....
To use a package from GitHub, GitLab, or any other public platform,
modify the URL accordingly.
To run a specific branch, use the command below.
....