Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(import
(fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
})
{ src = ./.; }).defaultNix
(import (fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
}) { src = ./.; }).defaultNix
67 changes: 40 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,35 @@

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

outputs = inputs:
outputs =
{ self, ... }@inputs:
let
nameValuePair = name: value: { inherit name value; };
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];

forAllSystems = f: genAttrs allSystems (system: f {
inherit system;
pkgs = import inputs.nixpkgs { inherit system; };
});
inherit (inputs.nixpkgs) lib;

supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

forEachSupportedSystem =
f:
lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs { inherit system; };
}
);
in
{
devShell = forAllSystems ({ system, pkgs, ... }:
devShell = forEachSupportedSystem (
{ system, pkgs }:
pkgs.mkShell {
name = "bootspec";

buildInputs = with pkgs; [
packages = with pkgs; [
cargo
rustc
clippy
Expand All @@ -29,21 +41,22 @@
jsonschema # provides the jv tool
json-schema-for-humans # provides the generate-schema-doc tool
];
});

packages = forAllSystems
({ system, pkgs, ... }:
{
package = pkgs.rustPlatform.buildRustPackage rec {
pname = "bootspec";
version = "unreleased";

src = inputs.self;

cargoLock.lockFile = ./Cargo.lock;
};
});

defaultPackage = forAllSystems ({ system, ... }: inputs.self.packages.${system}.package);
}
);

packages = forEachSupportedSystem (
{ system, pkgs }:
{
default = self.packages.${system}.bootspec;
bootspec = pkgs.rustPlatform.buildRustPackage rec {
pname = "bootspec";
version = "unreleased";

src = inputs.self;

cargoLock.lockFile = ./Cargo.lock;
};
}
);
};
}
10 changes: 4 additions & 6 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(import
(fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
})
{ src = ./.; }).shellNix
(import (fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
}) { src = ./.; }).shellNix
13 changes: 8 additions & 5 deletions synthesize/integration-test-cases/21.11-specialisations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ in
configuration = {
imports = [
"${src}/nixos/modules/virtualisation/qemu-vm.nix"
({ pkgs, ... }: {
specialisation.example.configuration = {
environment.systemPackages = [ pkgs.hello ];
};
})
(
{ pkgs, ... }:
{
specialisation.example.configuration = {
environment.systemPackages = [ pkgs.hello ];
};
}
)
];
};
}).config.system.build.toplevel
Loading