Skip to content

Pxe boot #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
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
98 changes: 98 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nixos-anywhere-pxe"
description = "Install NixOS with PXE"
dynamic = ["version"]
scripts = { nixos-anywhere-pxe = "nixos_anywhere_pxe:main"}

[tool.pytest.ini_options]
addopts = "--cov . --cov-report term --cov-fail-under=100 --no-cov-on-fail"

[tool.mypy]
python_version = "3.12"
warn_redundant_casts = true
disallow_untyped_calls = true
disallow_untyped_defs = true
no_implicit_optional = true

[[tool.mypy.overrides]]
module = "setuptools.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true

[tool.ruff]
line-length = 88

lint.select = ["ALL"]
lint.ignore = [
# pydocstyle
"D",
# todo comments
"TD",
# fixmes
"FIX",
# line length
"E501",
"T201", # `print` found
"PLR2004", # Magic value used in comparison
# Too many statements
"PLR0915",
# Too many arguments in function definition
"PLR0913",
"PLR0912", # Too many branches
# $X is too complex
"C901",
# Unused function argument
"ARG001",

# Dynamically typed expressions (typing.Any)
"ANN401",
# Trailing comma missing
"COM812",
# Unnecessary `dict` call (rewrite as a literal)
"C408",
# Found commented-out code
"ERA001",
# Boolean-typed positional argument in function definition
"FBT001",
# Logging statement uses f-string
"G004",
# disabled on ruff's recommendation as causes problems with the formatter
"ISC001",
# Use of `assert` detected
"S101",
# `subprocess` call: check for execution of untrusted input
"S603",
# Starting a process with a partial executable path
"S607",
# Boolean default positional argument in function definition
"FBT002",
]

[tool.black]
line-length = 88
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
# The following are specific to Black, you probably don't want those.
| blib2to3
| tests/data
| profiling
)/
'''
16 changes: 15 additions & 1 deletion src/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
, lib
, makeWrapper
, mkShellNoCC
, mypy
, pixiecore
, dnsmasq
, python3
, qemu_kvm
, OVMF
}:
let
runtimeDeps = [
Expand Down Expand Up @@ -47,7 +53,15 @@ stdenv.mkDerivation {

# Dependencies for our devshell
passthru.devShell = mkShellNoCC {
packages = runtimeDeps ++ [ openssh terraform-docs ];
OVMF = "${OVMF.fd}/FV/OVMF.fd";
packages = runtimeDeps ++ [
openssh
terraform-docs
mypy
pixiecore
dnsmasq
qemu_kvm
];
};

meta = with lib; {
Expand Down
3 changes: 2 additions & 1 deletion src/flake-module.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
perSystem = { config, pkgs, ... }: {
packages = {
packages = rec {
nixos-anywhere = pkgs.callPackage ./. { };
nixos-anywhere-pxe = pkgs.callPackage ./nixos_anywhere_pxe { inherit nixos-anywhere; };
default = config.packages.nixos-anywhere;
};
devShells.default = config.packages.nixos-anywhere.devShell;
Expand Down
Loading