Initial commit
This commit is contained in:
19
flake-multi-platform/README.md
Normal file
19
flake-multi-platform/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# flake-multi-platform
|
||||
|
||||
```
|
||||
> nix build
|
||||
...
|
||||
|
||||
> nix flake show
|
||||
warning: Git tree '/home/mycroft/dev/nix-samples' is dirty
|
||||
git+file:///home/mycroft/dev/nix-samples?dir=flake-multi-platform
|
||||
└───packages
|
||||
├───aarch64-darwin
|
||||
│ └───default omitted (use '--all-systems' to show)
|
||||
├───aarch64-linux
|
||||
│ └───default omitted (use '--all-systems' to show)
|
||||
├───x86_64-darwin
|
||||
│ └───default omitted (use '--all-systems' to show)
|
||||
└───x86_64-linux
|
||||
└───default: package 'simple'
|
||||
```
|
61
flake-multi-platform/flake.lock
generated
Normal file
61
flake-multi-platform/flake.lock
generated
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1710631334,
|
||||
"narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
25
flake-multi-platform/flake.nix
Normal file
25
flake-multi-platform/flake.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
# no need to define `system` anymore
|
||||
name = "simple";
|
||||
src = ./.;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
# `eachDefaultSystem` transforms the input, our output set
|
||||
# now simply has `packages.default` which gets turned into
|
||||
# `packages.${system}.default` (for each system)
|
||||
packages.default = derivation {
|
||||
inherit system name src;
|
||||
builder = with pkgs; "${bash}/bin/bash";
|
||||
args = [ "-c" "echo foo > $out" ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user