-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathflake.nix
More file actions
97 lines (83 loc) · 2.51 KB
/
flake.nix
File metadata and controls
97 lines (83 loc) · 2.51 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
description = "Determinate";
inputs = {
nix.url = "https://flakehub.com/f/DeterminateSystems/nix-src/*";
nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/0.1";
determinate-nixd-aarch64-linux = {
url = "https://install.determinate.systems/determinate-nixd/tag/v3.18.0/aarch64-linux";
flake = false;
};
determinate-nixd-x86_64-linux = {
url = "https://install.determinate.systems/determinate-nixd/tag/v3.18.0/x86_64-linux";
flake = false;
};
determinate-nixd-aarch64-darwin = {
url = "https://install.determinate.systems/determinate-nixd/tag/v3.18.0/macOS";
flake = false;
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
}
);
in
{
packages = forEachSupportedSystem (
{ system, pkgs, ... }:
{
default = pkgs.stdenvNoCC.mkDerivation {
pname = "determinate-nixd";
inherit (inputs.nix.packages.${system}.default) version;
src = inputs."determinate-nixd-${system}";
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/determinate-nixd
chmod +x $out/bin/determinate-nixd
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/determinate-nixd --help
'';
};
}
);
devShells = forEachSupportedSystem (
{ system, pkgs, ... }:
{
default = pkgs.mkShell {
name = "determinate-dev";
packages = with pkgs; [
self.formatter.${system}
];
};
}
);
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt);
darwinModules = {
default = ./modules/nix-darwin/default.nix;
# In case we come across anyone who still needs to migrate
migration = ./modules/nix-darwin/migration.nix;
};
homeManagerModules.default = ./modules/home-manager/default.nix;
nixosModules.default = import ./modules/nixos.nix inputs;
};
}