-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
69 lines (59 loc) · 2 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "Determinate";
inputs = {
nix.url = "https://flakehub.com/f/DeterminateSystems/nix/2.0";
nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1.tar.gz";
determinate-nixd-aarch64-linux = {
url = "https://install.determinate.systems/determinate-nixd/tag/v0.3.0/aarch64-linux";
flake = false;
};
determinate-nixd-x86_64-linux = {
url = "https://install.determinate.systems/determinate-nixd/tag/v0.3.0/x86_64-linux";
flake = false;
};
determinate-nixd-aarch64-darwin = {
url = "https://install.determinate.systems/determinate-nixd/tag/v0.3.0/macOS";
flake = false;
};
determinate-nixd-x86_64-darwin.follows = "determinate-nixd-aarch64-darwin";
};
outputs = { self, nixpkgs, ... } @ inputs:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
pkgsFor = system: import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
inherit system;
pkgs = pkgsFor system;
});
in
{
packages = forAllSystems ({ system, pkgs, ... }: {
default = pkgs.runCommand "determinate-nixd" { } ''
mkdir -p $out/bin
cp ${inputs."determinate-nixd-${system}"} $out/bin/determinate-nixd
chmod +x $out/bin/determinate-nixd
$out/bin/determinate-nixd --help
'';
});
devShells = forAllSystems ({ system, pkgs, ... }:
{
default = pkgs.mkShell {
name = "determinate-dev";
packages = with pkgs; [
lychee
nixpkgs-fmt
(writeScriptBin "check-readme-links" ''
lychee README.md
'')
];
};
});
darwinModules.default = import ./modules/nix-darwin.nix inputs;
nixosModules.default = import ./modules/nixos.nix inputs;
};
}