forked from divnix/flops
-
Notifications
You must be signed in to change notification settings - Fork 0
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
73 changed files
with
4,786 additions
and
303 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,10 @@ | ||
# Disable the automatic menu displaying on every environment reload. | ||
# export DEVSHELL_NO_MOTD=1 | ||
watch_file flakes.nix flake.lock | ||
watch_file local/flake.nix local/flake.lock | ||
# shellcheck disable=SC1090 | ||
source "$(fetchurl "https://raw.githubusercontent.com/gtrunsec/direnv/main/lib" "sha256-tuMA8WGkwcYq9V3MtlN6xdVvKd2YkdEpdK4ZyAN6VDM=")" | ||
|
||
registry="$PRJ_ROOT/local#__std" | ||
|
||
use envreload //repo/devshells/default |
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,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,15 @@ | ||
repository: | ||
allow_merge_commit: false | ||
allow_rebase_merge: true | ||
allow_squash_merge: false | ||
default_branch: main | ||
delete_branch_on_merge: true | ||
description: 'A nix language configuration framework based on POP: Pure Object' | ||
has_downloads: false | ||
has_issues: false | ||
has_projects: false | ||
has_wiki: false | ||
homepage: '' | ||
name: CONFIGURE-ME | ||
private: true | ||
topics: Flops |
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,25 @@ | ||
name: "CI" | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
nix: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: nixbuild/nix-quick-install-action@v25 | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: Run Flake Show | ||
run: nix -Lv flake show --override-input namaka github:nix-community/namaka | ||
|
||
- name: Run Eval check | ||
run: nix -Lv eval ./local#checks --override-input namaka github:nix-community/namaka | ||
|
||
- name: Run Format Check | ||
run: nix develop ./local --command treefmt -- . --fail-on-change --no-cache |
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,6 @@ | ||
/.data | ||
# nixago: ignore-linked-files | ||
/lefthook.yml | ||
/.editorconfig | ||
/.conform.yaml | ||
/treefmt.toml |
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,68 @@ | ||
#+TITLE: README | ||
#+AUTHOR: GuangTao Zhang | ||
#+EMAIL: gtrunsec@hardenedlinux.org | ||
#+DATE: 2023-05-03 Wed 05:53 | ||
|
||
powered by [[https://github.com/divnix/POP/blob/main/POP.md][POP: Pure Object Prototypes]] && [[https://github.com/nix-community/haumea][haumea]] | ||
|
||
~A nix language configuration framework based on POP: Pure Object~ | ||
|
||
if you want to understand this repo how works and use cases easily, just read the tests and expressions directly. For having a human-readable test set, the problem of complexity wouldn't exist anymore. | ||
|
||
- snapshots : https://github.com/GTrunSec/flops/blob/master/tests/_snapshots/haumea | ||
- expr: https://github.com/GTrunSec/flops/blob/master/tests/haumea/expr.nix | ||
|
||
* bye bye, a bloated flake inputs | ||
|
||
We could avoid putting all the inputs in the main flake.nix | ||
|
||
- use the ~flake.pops.default~ to load a subflake. | ||
|
||
#+begin_src nix | ||
callInputs = | ||
(flops.lib.flake.pops.default.setInitInputs ./lib/__lock) | ||
.setSystem | ||
"x86_64-linux"; | ||
#+end_src | ||
|
||
* Merge | ||
|
||
** dmerge | ||
|
||
you can't use the dmerge for the nixosModules | ||
|
||
- David Arnold (blaggacao) said | ||
#+begin_quote | ||
dmerge can only work with json-serializable data on both sides. That's by design. | ||
#+end_quote | ||
|
||
#+begin_src nix :async :exports both :results output | ||
test = with dmerge; | ||
merge { | ||
a.b.c = []; | ||
a.c = lib.mkOption { | ||
type = lib.types.submodule { | ||
freeformType = lib.types.attrs; | ||
options = { | ||
enable = lib.mkEnableOption (lib.mdDoc "Whether to enable git profile"); | ||
}; | ||
}; | ||
}; | ||
} {a.b.c = append ["a" "b" "c"];}; | ||
|
||
testNonMerge = | ||
{ | ||
a.b.c = []; | ||
a.c = lib.mkOption { | ||
type = lib.types.submodule { | ||
freeformType = lib.types.attrs; | ||
options = { | ||
enable = lib.mkEnableOption (lib.mdDoc "Whether to enable git profile"); | ||
}; | ||
}; | ||
}; | ||
} | ||
// {d = "d";}; | ||
#+end_src | ||
|
||
So, we use *withoutMergedOptions* to keep the native options after the action of merged. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.