-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
39 lines (36 loc) · 1.11 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
nuenv.url = "github:DeterminateSystems/nuenv";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { pkgs, lib, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.nuenv.overlays.nuenv ];
};
packages.default = pkgs.nuenv.mkScript {
name = "current-system";
script = ''
let system = $"($nu.os-info.arch)-($nu.os-info.name | str replace macos darwin)"
def current-system [] {
$system
}
# Return the Nix system for current system architecture.
def main [
--json # Whether to return json
] {
if $json {
current-system | to json
} else {
current-system
}
}
'';
};
};
};
}