Skip to content

Commit 5d15941

Browse files
Lord-Valenblaggacao
authored andcommitted
💎 style Format files
1 parent 57c2796 commit 5d15941

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2026
-1928
lines changed

CHANGELOG.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- A quick question. [\#428](https://github.com/divnix/digga/issues/428)
88
- infinite recursion error related to whether a git repo exists \#408 [\#413](https://github.com/divnix/digga/issues/413)
9-
- Support aarch64-darwin [\#335](https://github.com/divnix/digga/issues/335)
9+
- Support aarch64-darwin [\#335](https://github.com/divnix/digga/issues/335)
1010
- pkgs in home-manager profiles [\#309](https://github.com/divnix/digga/issues/309)
1111
- Allow the same user profile to behave differently based on hostname [\#308](https://github.com/divnix/digga/issues/308)
1212
- Home-manager inside ./modules or ./profiles to set user settings in a user agnostic way [\#303](https://github.com/divnix/digga/issues/303)
@@ -126,7 +126,7 @@
126126

127127
**Fixed bugs:**
128128

129-
- My emacsGcc overlay is not working [\#146](https://github.com/divnix/digga/issues/146)
129+
- My emacsGcc overlay is not working [\#146](https://github.com/divnix/digga/issues/146)
130130
- local flake registry freezes branches [\#142](https://github.com/divnix/digga/issues/142)
131131
- nixos-option no longer works after collect garbage [\#138](https://github.com/divnix/digga/issues/138)
132132
- Profiles imports are brittle, causing failure if imported twice [\#136](https://github.com/divnix/digga/issues/136)
@@ -158,6 +158,4 @@
158158

159159
## [07092020](https://github.com/divnix/digga/tree/07092020) (2020-07-09)
160160

161-
162-
163-
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
161+
\* _This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)_

README.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
[![NixOS](https://img.shields.io/badge/NixOS-unstable-blue.svg?style=flat&logo=NixOS&logoColor=white)](https://nixos.org)
33
[![Chat](https://img.shields.io/badge/chat-join%20us-brightgreen.svg?style=flat&logo=matrix&logoColor=white)](https://matrix.to/#/#devos:nixos.org)
44

5-
65
Digga — slangy German for "good friend" — is a flake utility library
76
that helps you declaratively craft and manage all three layers of your system
87
environment within a single [nix flakes][flakes] repository:
@@ -14,28 +13,32 @@ environment within a single [nix flakes][flakes] repository:
1413
This library is based on [flake-utils-plus][].
1514

1615
# Status: Beta
16+
1717
Although this project has already matured quite a bit, a fair amount of api polishing is still
1818
expected. There are unstable versions (0._x_._x_) to help users keep track
1919
of changes and progress.
2020

2121
# Usage
22+
2223
The best way to make use of library is with the [Official template][template].
2324
Check out the [guide](./doc/start/index.md) to get up and running.
2425
Also have a look at devos's [_flake.nix_](./examples/devos/flake.nix).
2526
If anything is not immediately discoverable via our [`mkFlake`][mk-flake], please file a bug report.
2627

2728
# Examples
29+
2830
Make sure to check out all the [examples](./examples) to see the different ways
2931
to make use of the digga api.
3032

3133
## In the Wild
34+
3235
You can also see digga being actually used:
33-
* @Pacman99: [Personal](https://gitlab.com/coffeetables/lower), [Server](https://gitlab.com/coffeetables/myrdd)
34-
* [@danielphan2003](https://github.com/danielphan2003/flk) and make sure to also check out [devos-ext-lib](https://github.com/divnix/devos-ext-lib)
35-
* [PubSolarOS](https://git.sr.ht/~b12f/pub-solar-os)
36-
* @montchr: [Dotfield](https://github.com/montchr/dotfield) – including darwin configurations
37-
* [@sweenu](https://github.com/sweenu/nixfiles): pc, server and RaspberryPi deployment in one repo
3836

37+
- @Pacman99: [Personal](https://gitlab.com/coffeetables/lower), [Server](https://gitlab.com/coffeetables/myrdd)
38+
- [@danielphan2003](https://github.com/danielphan2003/flk) and make sure to also check out [devos-ext-lib](https://github.com/divnix/devos-ext-lib)
39+
- [PubSolarOS](https://git.sr.ht/~b12f/pub-solar-os)
40+
- @montchr: [Dotfield](https://github.com/montchr/dotfield) – including darwin configurations
41+
- [@sweenu](https://github.com/sweenu/nixfiles): pc, server and RaspberryPi deployment in one repo
3942

4043
# Philosophy
4144

@@ -54,17 +57,19 @@ interface comprising four API containers that allow you to:
5457
your projects.
5558

5659
## Modules, Profiles & Suites
60+
5761
For NixOS- & home-manager-modules, _Digga_ allows you to distinguish between
5862
_modules_, _profiles_ and _suites_.
5963

6064
- **Modules** are abstract configurations that, while holding the implementation, do not
61-
set any system state.
65+
set any system state.
6266

6367
- **Profiles** are concrete configurations that set system state within the profile domain.
6468

6569
- **Suites** are a composable, clean and discoverable mechanism for profile aggregation.
6670

6771
## Internal Art vs External Art
72+
6873
Overlays and modules can be defined internally coming from your repo or externally
6974
coming from an upstream flake. This distinction serves the library to only export
7075
your own work as the public flake output.
@@ -73,6 +78,7 @@ Downstream consumers of your flake can now more easily tell your art apart from
7378
other upstream art.
7479

7580
# Contributing
81+
7682
We encourage contributions of any kind. The simplest way to get involved is to
7783
join the [chat][] or report problems and ideas on the [issue thread][issues].
7884

@@ -81,19 +87,23 @@ To craft well thought out APIs we need all the thoughts regarding new ideas.
8187
Pull Requests are just as amazing.
8288

8389
# Why _flakes_?
84-
Flakes are a part of an explicit push to improve [Nix's UX](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/cli-guideline.md), and have become an integral part of that effort.
90+
91+
Flakes are a part of an explicit push to improve [Nix's UX](https://github.com/NixOS/nix/blob/master/doc/manual/src/contributing/cli-guideline.md), and have become an integral part of that effort.
8592

8693
They also make [Nix expressions](https://nixos.org/manual/nix/unstable/expressions/expression-syntax.html) easier to distribute and reuse with convient [flake references](https://github.com/NixOS/nix/blob/master/src/nix/flake.md#flake-references) for building or using packages, modules, and whole systems.
8794

8895
# Shoulders
96+
8997
This work does not reinvent the wheel. It stands on the [shoulders of the
9098
following giants][giants]:
9199

92100
## :onion: — like the layers of an onion
101+
93102
- [`gytis-ivaskevicius/flake-utils-plus`](https://github.com/gytis-ivaskevicius/flake-utils-plus)
94103
- [`numtide/flake-utils`](https://github.com/numtide/flake-utils/)
95104

96105
## :family: — like family
106+
97107
- [`numtide/devshell`](https://github.com/numtide/devshell)
98108
- [`serokell/deploy-rs`](https://github.com/serokell/deploy-rs)
99109
- [`berberman/nvfetcher`](https://github.com/berberman/nvfetcher)
@@ -102,13 +112,15 @@ following giants][giants]:
102112
:heart:
103113

104114
### Inspiration & Art
115+
105116
- [hlissner/dotfiles](https://github.com/hlissner/dotfiles)
106117
- [nix-user-chroot](https://github.com/nix-community/nix-user-chroot)
107118
- [Nickel](https://github.com/tweag/nickel)
108119
- [Awesome Nix](https://github.com/nix-community/awesome-nix)
109120
- [devshell](https://github.com/numtide/devshell)
110121

111122
# Divnix
123+
112124
The divnix org is an open space that spontaneously formed out of "the Nix".
113125
It is really just a place where otherwise unrelated people work
114126
together and get stuff done.
@@ -121,6 +133,7 @@ It might eventually become a non-profit if that's not too complicated or, if tho
121133
goals are sufficiently upstreamed into "the Nix", dissolved.
122134

123135
# License
136+
124137
Digga is licensed under the [MIT License][mit].
125138

126139
[mk-flake]: ./src/mkFlake
@@ -136,4 +149,3 @@ Digga is licensed under the [MIT License][mit].
136149
[nix]: https://nixos.org/manual/nix/stable
137150
[nixpkgs]: https://github.com/nixos/nixpkgs
138151
[template]: ./examples/devos
139-

checks/default.nix

+26-27
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
{ system ? builtins.currentSystem
2-
, inputs ? (import ../.).inputs
3-
}:
4-
let
5-
1+
{
2+
system ? builtins.currentSystem,
3+
inputs ? (import ../.).inputs,
4+
}: let
65
inherit (inputs) digga nixpkgs;
76
lib = nixpkgs.lib // digga.lib;
87
pkgs = nixpkgs.legacyPackages.${system};
9-
10-
in
11-
{
12-
13-
libTests = pkgs.runCommandNoCC "devos-lib-tests"
8+
in {
9+
libTests =
10+
pkgs.runCommandNoCC "devos-lib-tests"
1411
{
1512
buildInputs = [
1613
pkgs.nix
1714
(
18-
let tests = import ./lib { inherit pkgs lib; }; in
19-
if tests == [ ] then null
20-
else throw (builtins.toJSON tests)
15+
let
16+
tests = import ./lib {inherit pkgs lib;};
17+
in
18+
if tests == []
19+
then null
20+
else throw (builtins.toJSON tests)
2121
)
2222
];
2323
} ''
24-
datadir="${pkgs.nix}/share"
25-
export TEST_ROOT=$(pwd)/test-tmp
26-
export NIX_BUILD_HOOK=
27-
export NIX_CONF_DIR=$TEST_ROOT/etc
28-
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
29-
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
30-
export NIX_STATE_DIR=$TEST_ROOT/var/nix
31-
export NIX_STORE_DIR=$TEST_ROOT/store
32-
export PAGER=cat
33-
cacheDir=$TEST_ROOT/binary-cache
34-
nix-store --init
35-
36-
touch $out
37-
'';
24+
datadir="${pkgs.nix}/share"
25+
export TEST_ROOT=$(pwd)/test-tmp
26+
export NIX_BUILD_HOOK=
27+
export NIX_CONF_DIR=$TEST_ROOT/etc
28+
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
29+
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
30+
export NIX_STATE_DIR=$TEST_ROOT/var/nix
31+
export NIX_STORE_DIR=$TEST_ROOT/store
32+
export PAGER=cat
33+
cacheDir=$TEST_ROOT/binary-cache
34+
nix-store --init
3835
36+
touch $out
37+
'';
3938
}

checks/lib/default.nix

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
{ pkgs, lib }:
1+
{
2+
pkgs,
3+
lib,
4+
}:
25
with lib;
3-
lib.runTests {
4-
testRakeLeaves = {
5-
expr = rakeLeaves ./profiles;
6-
expected = {
7-
f = ./profiles/f.nix;
8-
foo = ./profiles/foo;
9-
t = {
10-
bar = ./profiles/t/bar.nix;
6+
lib.runTests {
7+
testRakeLeaves = {
8+
expr = rakeLeaves ./profiles;
9+
expected = {
10+
f = ./profiles/f.nix;
11+
foo = ./profiles/foo;
12+
t = {
13+
bar = ./profiles/t/bar.nix;
14+
};
1115
};
1216
};
13-
};
1417

15-
testFlattenTree = {
16-
expr = flattenTree (rakeLeaves ./profiles);
17-
expected = {
18-
f = ./profiles/f.nix;
19-
foo = ./profiles/foo;
20-
"t.bar" = ./profiles/t/bar.nix;
18+
testFlattenTree = {
19+
expr = flattenTree (rakeLeaves ./profiles);
20+
expected = {
21+
f = ./profiles/f.nix;
22+
foo = ./profiles/foo;
23+
"t.bar" = ./profiles/t/bar.nix;
24+
};
2125
};
22-
};
23-
}
26+
}

checks/lib/profiles/f.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ }
1+
{}

checks/lib/profiles/t/bar.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ }
1+
{}

default.nix

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
let
2-
inherit (import
3-
(
4-
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
5-
fetchTarball {
6-
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
7-
sha256 = lock.nodes.flake-compat.locked.narHash;
8-
}
9-
)
10-
{ src = ./.; }) defaultNix;
2+
inherit
3+
(import
4+
(
5+
let
6+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
7+
in
8+
fetchTarball {
9+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
10+
sha256 = lock.nodes.flake-compat.locked.narHash;
11+
}
12+
)
13+
{src = ./.;})
14+
defaultNix
15+
;
1116
in
12-
# Pass this flake as inputs.digga
13-
defaultNix // {
14-
inputs = defaultNix.inputs // { digga = defaultNix; };
15-
shell = import ./devShell.nix { };
16-
}
17-
17+
# Pass this flake as inputs.digga
18+
defaultNix
19+
// {
20+
inputs = defaultNix.inputs // {digga = defaultNix;};
21+
shell = import ./devShell.nix {};
22+
}

deprecated.nix

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
{ lib, importers }:
1+
{
2+
lib,
3+
importers,
4+
}:
25
lib.warn ''
36
You are accessing a deprecated item of the digga lib.
47
Please update timely, it will be remove soon.
58
''
69
rec {
7-
810
importModules =
911
lib.warn ''
1012
Deprecated Function: lib.importModules.
1113
1214
Use lib.importExportableModules instead to set `exportedModules` option
1315
''
14-
importers.importExportableModules;
15-
16+
importers.importExportableModules;
1617
}

0 commit comments

Comments
 (0)