Set the nixpkgs platform as a module option.
This commit is contained in:
parent
36b67321c0
commit
6f74507684
4 changed files with 15 additions and 11 deletions
|
|
@ -8,8 +8,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
makeSystemConfig =
|
makeSystemConfig =
|
||||||
{ system
|
{ modules
|
||||||
, modules
|
|
||||||
, extraSpecialArgs ? { }
|
, extraSpecialArgs ? { }
|
||||||
,
|
,
|
||||||
}:
|
}:
|
||||||
|
|
@ -34,6 +33,8 @@ in
|
||||||
] ++ modules;
|
] ++ modules;
|
||||||
}).config;
|
}).config;
|
||||||
|
|
||||||
|
system = config.nixpkgs.hostPlatform;
|
||||||
|
|
||||||
returnIfNoAssertions = drv:
|
returnIfNoAssertions = drv:
|
||||||
let
|
let
|
||||||
failedAssertions = map (x: x.message) (lib.filter (x: !x.assertion) config.assertions);
|
failedAssertions = map (x: x.message) (lib.filter (x: !x.assertion) config.assertions);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,15 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
nixpkgs = {
|
||||||
|
# TODO: switch to lib.systems.parsedPlatform
|
||||||
|
hostPlatform = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
example = "x86_64-linux";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
assertions = lib.mkOption {
|
assertions = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.unspecified;
|
type = lib.types.listOf lib.types.unspecified;
|
||||||
internal = true;
|
internal = true;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,16 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
|
|
||||||
system-manager = {
|
system-manager = {
|
||||||
url = "github:numtide/system-manager";
|
url = "github:numtide/system-manager";
|
||||||
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { system-manager, ... }:
|
||||||
{ flake-utils
|
|
||||||
, system-manager
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
systemConfigs.default = system-manager.lib.makeSystemConfig {
|
systemConfigs.default = system-manager.lib.makeSystemConfig {
|
||||||
system = flake-utils.lib.system.x86_64-linux;
|
|
||||||
modules = [
|
modules = [
|
||||||
./modules
|
./modules
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
foo = {
|
foo = {
|
||||||
text = ''
|
text = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue