-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
562 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ lib }: | ||
list: | ||
lib.filter (pair: lib.elem pair.name list) [ | ||
{ | ||
name = "nixpkgs"; | ||
url = "github:nixpkgs/nixpkgs-unstable"; | ||
} | ||
{ | ||
name = "makes"; | ||
url = "github:fluidattacks/makes"; | ||
} | ||
{ | ||
name = "home-manager"; | ||
url = "github:github:nix-community/home-manager"; | ||
} | ||
{ | ||
name = "microvm"; | ||
url = "github:astro/microvm.nix"; | ||
} | ||
{ | ||
name = "topiary"; | ||
url = "github:github:tweag/topiary"; | ||
} | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
lib, | ||
inputs, | ||
super, | ||
}: | ||
inputs': listNames: | ||
let | ||
fondInputs = | ||
if | ||
(lib.length ( | ||
lib.filter (pair: pair == true) (map (v: lib.hasAttr v inputs) listNames) | ||
)) > 0 | ||
then | ||
true | ||
else | ||
false | ||
; | ||
msg = | ||
(lib.concatMapStringsSep "\n " | ||
( | ||
{ name, url }: | ||
'' | ||
# add `${name}.url = "${url}"` to your flake | ||
${name} = inputs.${name}; | ||
'' | ||
) | ||
(super.inputsSource listNames) | ||
); | ||
|
||
noSysNixpkgs = | ||
if (lib.elem "nixpkgs" listNames) then | ||
if (lib.hasAttr "path" inputs'.nixpkgs) then true else false | ||
else | ||
true | ||
; | ||
in | ||
assert lib.assertMsg fondInputs '' | ||
please, add the these inputs into | ||
omnibus.lib.addLoadExtender { | ||
load.inputs = { | ||
${msg} | ||
# you can also see the full inputs list at | ||
# https://github.com/GTrunSec/omnibus/blob/main/local/lock/flake.nix#L1 | ||
}; | ||
}; | ||
} | ||
''; | ||
assert lib.assertMsg noSysNixpkgs '' | ||
please, add the following inputs into | ||
omnibus.lib.addLoadExtender { | ||
load.inputs = { | ||
nixpkgs = inputs.nixpkgs.legacyPackages.''${system} or (import inputs.nixpkgs.path); | ||
}; | ||
}; | ||
} | ||
''; | ||
inputs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
inputs, | ||
lib, | ||
root, | ||
}: | ||
let | ||
l = nixpkgs.lib // builtins; | ||
inherit | ||
(root.errors.requiredInputs inputs [ | ||
"nixpkgs" | ||
"makes" | ||
]) | ||
nixpkgs | ||
makes | ||
; | ||
in | ||
l.fix ( | ||
l.extends | ||
(_: _: { | ||
inherit inputs; | ||
inherit (nixpkgs) system; | ||
__nixpkgs__ = nixpkgs; | ||
__nixpkgsSrc__ = nixpkgs.path; | ||
}) | ||
(import (makes + /src/args/agnostic.nix) { inherit (nixpkgs) system; }) | ||
.__unfix__ | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# credit: https://github.com/divnix/std/blob/main/src/lib/ops/mkMicrovm.nix# | ||
{ | ||
inputs, | ||
lib, | ||
root, | ||
}: | ||
let | ||
inherit | ||
(root.errors.requiredInputs inputs [ | ||
"nixpkgs" | ||
"microvm" | ||
]) | ||
nixpkgs | ||
microvm | ||
; | ||
nixosSystem = | ||
args: | ||
import "${nixpkgs.path}/nixos/lib/eval-config.nix" ( | ||
args // { modules = args.modules; } | ||
); | ||
in | ||
module: | ||
nixosSystem { | ||
inherit (nixpkgs) system; | ||
modules = [ | ||
# for declarative MicroVM management | ||
microvm.nixosModules.host | ||
# this runs as a MicroVM that nests MicroVMs | ||
microvm.nixosModules.microvm | ||
# your custom module | ||
module | ||
]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pretty | ||
{ | ||
makeScript = <function, args: {aliases?, entrypoint, globalState?, help?, name, persistState?, replace?, searchPaths?}>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ omnibus, lib }: | ||
let | ||
inherit (omnibus.__inputs__) nixpkgs makes; | ||
makesLib = | ||
(omnibus.pops.lib.addLoadExtender { | ||
load = { | ||
inputs = { | ||
inputs = { | ||
nixpkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
inherit makes; | ||
}; | ||
}; | ||
}; | ||
}).layouts.default.makes; | ||
|
||
inherit (makesLib) makeScript; | ||
in | ||
{ | ||
makeScript = makeScript; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"pretty" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ inputs }: | ||
{ | ||
default = { | ||
output = "cog.toml"; | ||
commands = [ { package = inputs.nixpkgs.cocogitto; } ]; | ||
data = { | ||
tag_prefix = "v"; | ||
branch_whitelist = [ | ||
"main" | ||
"release/**" | ||
]; | ||
ignore_merge_commits = true; | ||
pre_bump_hooks = [ | ||
"echo {{version}} > ./VERSION" | ||
'' | ||
branch="$(echo "release/{{version}}" | sed 's/\.[^.]*$//')" | ||
if [ `git rev-parse --verify $branch 2>/dev/null` ] | ||
then | ||
git switch -m "$branch" || exit 1 | ||
git merge main | ||
else | ||
git switch -c "$branch" || exit 1 | ||
fi | ||
'' | ||
]; | ||
post_bump_hooks = [ | ||
'' | ||
branch="$(echo "release/{{version}}" | sed 's/\.[^.]*$//')" | ||
git push --set-upstream origin "$branch" | ||
git push origin v{{version}} | ||
git switch main | ||
git merge "$branch" --no-commit --no-ff | ||
echo {{version+minor-dev}} > ./VERSION | ||
git add VERSION | ||
git commit -m "chore: sync with release" | ||
git push origin main | ||
'' | ||
"cog -q changelog --at v{{version}}" | ||
]; | ||
changelog = { | ||
path = "CHANGELOG.md"; | ||
template = "remote"; | ||
remote = "github.com"; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
default.data = { | ||
commit = { | ||
header = { | ||
length = 89; | ||
}; | ||
conventional = { | ||
types = [ | ||
"build" | ||
"chore" | ||
"ci" | ||
"docs" | ||
"feat" | ||
"fix" | ||
"perf" | ||
"refactor" | ||
"style" | ||
"test" | ||
]; | ||
scopes = [ ]; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
default.data = { | ||
root = true; | ||
"*" = { | ||
end_of_line = "lf"; | ||
insert_final_newline = true; | ||
trim_trailing_whitespace = true; | ||
charset = "utf-8"; | ||
indent_style = "space"; | ||
indent_size = 2; | ||
}; | ||
|
||
"*.{diff,patch}" = { | ||
end_of_line = "unset"; | ||
insert_final_newline = "unset"; | ||
trim_trailing_whitespace = "unset"; | ||
indent_size = "unset"; | ||
}; | ||
|
||
"*.md" = { | ||
max_line_length = "off"; | ||
trim_trailing_whitespace = false; | ||
}; | ||
"{LICENSES/**,LICENSE}" = { | ||
end_of_line = "unset"; | ||
insert_final_newline = "unset"; | ||
trim_trailing_whitespace = "unset"; | ||
charset = "unset"; | ||
indent_style = "unset"; | ||
indent_size = "unset"; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.