mirror of
https://git.gay/pyrox/aux-docs
synced 2024-11-23 00:17:56 +00:00
add nixos-options package
This commit is contained in:
parent
ce454192f9
commit
0d2a9633ff
55
packages/nixos-options/default.nix
Normal file
55
packages/nixos-options/default.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
stdenv,
|
||||
supportedSystems ? [ "x86_64-linux" ],
|
||||
}:
|
||||
|
||||
with import "${inputs.nixpkgs}/pkgs/top-level/release-lib.nix" { inherit supportedSystems; };
|
||||
|
||||
let
|
||||
|
||||
version = "nixos-unstable";
|
||||
versionSuffix = "pre${toString pkgs.revCount}.${pkgs.shortRev}";
|
||||
|
||||
buildFromConfig =
|
||||
module: sel:
|
||||
forAllSystems (
|
||||
system:
|
||||
lib.hydraJob (
|
||||
sel
|
||||
(import "${inputs.nixpkgs}/nixos/lib/eval-config.nix" {
|
||||
inherit system;
|
||||
modules = [
|
||||
module
|
||||
(
|
||||
{ config, ... }:
|
||||
{
|
||||
system.nixos.versionSuffix = versionSuffix;
|
||||
system.nixos.revision = pkgs.rev or pkgs.shortRev;
|
||||
# At creation time we do not have state yet, so just default to latest.
|
||||
system.stateVersion = config.system.nixos.version;
|
||||
fileSystems."/".device = mkDefault "/dev/sda1";
|
||||
boot.loader.grub.device = mkDefault "/dev/sda";
|
||||
}
|
||||
)
|
||||
];
|
||||
}).config
|
||||
)
|
||||
);
|
||||
|
||||
options =
|
||||
(buildFromConfig ({ ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "nixos-options";
|
||||
inherit version;
|
||||
|
||||
src = inputs.nixpkgs;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r ${options} $out/options
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue