Merge branch 'core' into teutat3s-develop

This commit is contained in:
teutat3s 2021-07-17 15:49:07 +02:00
commit 021c8774fa
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1
32 changed files with 570 additions and 404 deletions

10
.gitignore vendored
View file

@ -1,14 +1,12 @@
result result
up
hosts/up-*
.direnv .direnv
doc/index.html doc/index.html
<<<<<<< HEAD
tags
=======
# Result of flk commands # Result of flk commands
vm vm
iso iso
doi doi
>>>>>>> devos/core
pkgs/_sources/.shake*
tags

View file

@ -22,14 +22,18 @@ Also, have a look at [_flake.nix_][toc]. If anything is not immediately
discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake], discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake],
please file a bug report. please file a bug report.
### Status: Beta ## Motivation
Although this project has already matured quite a bit, especially through NixOS provides an amazing abstraction to manage our environment, but that new
recent outfactoring of [`digga`][digga], a fair amount of api polishing is still power can sometimes bring feelings of overwhelm and confusion. Having a turing
expected. There are unstable versions (0._x_._x_) to help users keep track complete system can easily lead to unlimited complexity if we do it wrong.
of changes and progress, and a [`develop`](https://github.com/divnix/devos/tree/develop) branch for the brave 😜 Instead, we should have a community consensus on how to manage a NixOS system
and its satellite projects, from which best practices can evolve.
## In the Wild ___The future is declarative! 🎉___
* The original [authors][please]
## Examples in the Wild
The author maintains his own branch, so you can take inspiration, direction, or
make critical comments about the [code][please]. 😜
## Shoulders ## Shoulders
This work does not reinvent the wheel. It stands on the [shoulders of the This work does not reinvent the wheel. It stands on the [shoulders of the
@ -43,6 +47,7 @@ following giants][giants]:
### :family: &mdash; like family ### :family: &mdash; like family
- [`numtide/devshell`][devshell] - [`numtide/devshell`][devshell]
- [`serokell/deploy-rs`][deploy] - [`serokell/deploy-rs`][deploy]
- [`berberman/nvfetcher`][nvfetcher]
- [`NixOS/nixpkgs`][nixpkgs] - [`NixOS/nixpkgs`][nixpkgs]
:heart: :heart:
@ -68,23 +73,23 @@ goals are sufficiently upstreamed into "the Nix", dissolved.
# License # License
DevOS is licensed under the [MIT License][mit]. DevOS is licensed under the [MIT License][mit].
[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake
[nixpkgs]: https://github.com/NixOS/nixpkgs
[deploy]: https://github.com/serokell/deploy-rs
[toc]: https://github.com/divnix/devos/blob/core/flake.nix
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
[digga]: https://github.com/divnix/digga
[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus
[fu]: https://github.com/numtide/flake-utils
[devshell]: https://github.com/numtide/devshell
[nix]: https://nixos.org/manual/nix/stable
[mit]: https://mit-license.org
[nixos]: https://nixos.org/manual/nixos/stable
[home-manager]: https://nix-community.github.io/home-manager
[flakes]: https://nixos.wiki/wiki/Flakes
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
[core]: https://github.com/divnix/devos
[community]: https://github.com/divnix/devos/tree/community [community]: https://github.com/divnix/devos/tree/community
[core]: https://github.com/divnix/devos
[deploy]: https://github.com/serokell/deploy-rs
[devshell]: https://github.com/numtide/devshell
[digga]: https://github.com/divnix/digga
[dotfiles]: https://github.com/hlissner/dotfiles [dotfiles]: https://github.com/hlissner/dotfiles
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
[flakes]: https://nixos.wiki/wiki/Flakes
[fu]: https://github.com/numtide/flake-utils
[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
[home-manager]: https://nix-community.github.io/home-manager
[mit]: https://mit-license.org
[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake
[nix]: https://nixos.org/manual/nix/stable
[nixos]: https://nixos.org/manual/nixos/stable
[nixpkgs]: https://github.com/NixOS/nixpkgs
[nvfetcher]: https://github.com/berberman/nvfetcher
[please]: https://github.com/nrdxp/devos/tree/nrd [please]: https://github.com/nrdxp/devos/tree/nrd
[matrix]: https://matrix.to/#/#devos:nixos.org [toc]: https://github.com/divnix/devos/blob/core/flake.nix

View file

@ -10,12 +10,6 @@ rendered on every change, so the docs should always be up to date.
We also use [BORS](https://bors.tech) to ensure that all pull requests pass the We also use [BORS](https://bors.tech) to ensure that all pull requests pass the
test suite once at least one review is completed. test suite once at least one review is completed.
## Community PRs
While much of your work in this template may be idiosyncratic in nature. Anything
that might be generally useful to the broader NixOS community can be synced to
the `community` branch to provide a host of useful NixOS configurations available
"out of the box".
# Style # Style
If you wish to contribute please follow these guidelines: If you wish to contribute please follow these guidelines:

View file

@ -31,5 +31,6 @@
- [Integrations](./integrations/index.md) - [Integrations](./integrations/index.md)
- [Cachix](./integrations/cachix.md) - [Cachix](./integrations/cachix.md)
- [Deploy RS](./integrations/deploy.md) - [Deploy RS](./integrations/deploy.md)
- [NvFetcher](./integrations/nvfetcher.md)
- [Hercules CI](./integrations/hercules.md) - [Hercules CI](./integrations/hercules.md)
- [Contributing](./CONTRIBUTING.md) - [Contributing](./CONTRIBUTING.md)

View file

@ -5,9 +5,6 @@ Profiles are a convenient shorthand for the [_definition_][definition] of
built into the NixOS module system for a reason: to elegantly provide a clear built into the NixOS module system for a reason: to elegantly provide a clear
separation of concerns. separation of concerns.
If you need guidance, a community [branch](https://github.com/divnix/devos/tree/community/profiles)
is maintained to help get up to speed on their usage.
## Creation ## Creation
Profiles are created with the `rakeLeaves` function which recursively collects Profiles are created with the `rakeLeaves` function which recursively collects
`.nix` files from within a folder. The recursion stops at folders with a `default.nix` `.nix` files from within a folder. The recursion stops at folders with a `default.nix`

View file

@ -1,6 +1,6 @@
# Suites # Suites
Suites provide a mechanism for users to easily combine and name collecitons of Suites provide a mechanism for users to easily combine and name collecitons of
profiles. For good examples, check out the suites defined in the community branch. profiles.
`suites` are defined in the `importables` argument in either the `home` or `nixos` `suites` are defined in the `importables` argument in either the `home` or `nixos`
namespace. They are a special case of an `importable` which get passed as a special namespace. They are a special case of an `importable` which get passed as a special

View file

@ -1,10 +1,10 @@
# get # get
The `get` subcommand is useful for getting a bare copy of devos without the The `get` subcommand is useful for getting a bare copy of devos without the
git history. You can pull either the core or community branches. git history.
## Usage ## Usage
```sh ```sh
flk get BRANCH DEST-DIR flk get DEST-DIR
``` ```
If DEST-DIR is ommitted, it defaults to _./flk_. If DEST-DIR is ommitted, it defaults to _./devos_.

View file

@ -0,0 +1,43 @@
# nvfetcher
[NvFetcher][nvf] is a workflow companion for updating nix sources.
You can specify an origin source and an update configuration, and
nvfetcher can for example track updates to a specific branch and
automatically update your nix sources configuration on each run
to the tip of that branch.
All package source declaration is done in [sources.toml][sources.toml].
From within the devshell of this repo, run `nvfetcher`, a wrapped
version of `nvfetcher` that knows where to find and place its files
and commit the results.
## Usage
Statically fetching (not tracking) a particular tag from a github repo:
```toml
[manix]
src.manual = "v0.6.3"
fetch.github = "mlvzk/manix"
```
Tracking the latest github _release_ from a github repo:
```toml
[manix]
src.github = "mlvzk/manix" # responsible for tracking
fetch.github = "mlvzk/manix" # responsible for fetching
```
Tracking the latest commit of a git repository and fetch from a git repo:
```toml
[manix]
src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking
fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching
```
> ##### _Note:_
> Please refer to the [NvFetcher Readme][nvf-readme] for more options.
[nvf: https://github.com/berberman/nvfetcher
[nvf-readme]: https://github.com/berberman/nvfetcher#readme
[sources.toml]: https://github.com/divnix/devos/tree/core/pkgs/sources.toml

View file

@ -25,8 +25,6 @@ version required.
In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment. In addition, the [binary cache](../integrations/cachix.md) is added for faster deployment.
> ##### _Notes:_ > ##### _Notes:_
> - You can change `core` to [`community`](../../index.md#community-profiles)
> in the call to `flk get`
> - Flakes ignore files that have not been added to git, so be sure to stage new > - Flakes ignore files that have not been added to git, so be sure to stage new
> files before building the system. > files before building the system.
> - You can choose to simply clone the repo with git if you want to follow > - You can choose to simply clone the repo with git if you want to follow

View file

@ -20,9 +20,52 @@
"type": "github" "type": "github"
} }
}, },
"blank": {
"locked": {
"lastModified": 1625557891,
"narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=",
"owner": "divnix",
"repo": "blank",
"rev": "5a5d2684073d9f563072ed07c871d577a6c614a8",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "blank",
"type": "github"
}
},
"bud": {
"inputs": {
"devshell": [
"digga",
"devshell"
],
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1626456025,
"narHash": "sha256-TrKfxVir+TilnqSNYokxJKx2ugEem7Khv4YmSwqj9JQ=",
"owner": "divnix",
"repo": "bud",
"rev": "59c10c3879b11371944ab664462fe2e9366cfb44",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "bud",
"type": "github"
}
},
"ci-agent": { "ci-agent": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": [
"digga",
"deploy",
"flake-compat"
],
"nix-darwin": [ "nix-darwin": [
"darwin" "darwin"
], ],
@ -70,17 +113,21 @@
}, },
"deploy": { "deploy": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs", "nixpkgs": [
"utils": "utils" "nixpkgs"
],
"utils": [
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1616406726, "lastModified": 1625729093,
"narHash": "sha256-n9zmgxR03QNrvs9/fHewqE0j3SjL7Y+cglBCFu3U3rg=", "narHash": "sha256-hpo8T7mlVEpHpZIYqhxqt5i/XY8eu4p66MrAg/MCuVY=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "9e405fbc5ab5bacbd271fd78c6b6b6877c4d9f8d", "rev": "587cbcfe8d3ea05c5bb153764d3617012ef28c86",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -91,11 +138,11 @@
}, },
"devshell": { "devshell": {
"locked": { "locked": {
"lastModified": 1622013274, "lastModified": 1625086391,
"narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=", "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2", "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -106,23 +153,33 @@
}, },
"digga": { "digga": {
"inputs": { "inputs": {
"blank": "blank",
"deploy": "deploy", "deploy": "deploy",
"devshell": "devshell", "devshell": "devshell",
"nixlib": "nixlib", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2", "home-manager": [
"utils": "utils_2" "home"
],
"nixlib": [
"nixos"
],
"nixos-generators": "nixos-generators",
"nixpkgs": [
"nixos"
],
"utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1623197477, "lastModified": 1626470112,
"narHash": "sha256-2Qk/uIHb1nXre2rRlGonAJmpuamBs7RRfgXhMmS5JkU=", "narHash": "sha256-hC5I3A1HxfGi45avpYBf8zXi1hQkHYWgRgUM4sF9byI=",
"owner": "divnix", "owner": "divnix",
"repo": "digga", "repo": "digga",
"rev": "f69703abc33f221b676966a8435c4f09ef70ff49", "rev": "f25928ed0bf05ab20af5a8231d264ae01b42ab34",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "divnix", "owner": "divnix",
"ref": "master", "ref": "develop",
"repo": "digga", "repo": "digga",
"type": "github" "type": "github"
} }
@ -143,29 +200,13 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1606424373,
"narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1620759905, "lastModified": 1623875721,
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -196,26 +237,27 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1626073055, "lastModified": 1624228557,
"narHash": "sha256-vocByfpVu6m9zvtJugDvmd6/9iT2HJuG4tmDICKd0lI=", "narHash": "sha256-wwOqe73BsrXfRv1PhyXQFNC8iTET50KvE/HitdkRgxs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "775cb20bd4af7781fbf336fb201df02ee3d544bb", "rev": "35a24648d155843a4d162de98c17b1afd5db51e4",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-21.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"latest": { "latest": {
"locked": { "locked": {
"lastModified": 1626192309, "lastModified": 1626529037,
"narHash": "sha256-uMl42Cn1Zb3qe8Iw0Rz7x62DUEG1JPCtJNU3ZK5gEFQ=", "narHash": "sha256-Q1vbk2fgE43JgjvTBdghZ70ParF2ek/jTn62ACkU8Fw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4036bb94c78329292ef44c233bb42da40b8bd4d2", "rev": "5f069e17541ac5cd240fced18687cef190080be3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -230,11 +272,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1610392286, "lastModified": 1622810282,
"narHash": "sha256-3wFl5y+4YZO4SgRYK8WE7JIS3p0sxbgrGaQ6RMw+d98=", "narHash": "sha256-4wmvM3/xfD0hCdNDIXVzRMfL4yB1J+DjH6Zte2xbAxk=",
"owner": "nmattia", "owner": "nmattia",
"repo": "naersk", "repo": "naersk",
"rev": "d7bfbad3304fd768c0f93a4c3b50976275e6d4be", "rev": "e8061169e1495871b56be97c5c51d310fae01374",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -267,7 +309,7 @@
"nix-dram": { "nix-dram": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1620663773, "lastModified": 1620663773,
@ -283,36 +325,44 @@
"type": "github" "type": "github"
} }
}, },
"nixlib": {
"locked": {
"lastModified": 1620519687,
"narHash": "sha256-+6Dd72b2CASuXm2W7KRxZIE7AOy/dj4mU28vaF+zxcs=",
"owner": "divnix",
"repo": "nixpkgs.lib",
"rev": "c7b6169809c5f74dd0c34f3d69e9d12ba4d448de",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos": { "nixos": {
"locked": { "locked": {
"lastModified": 1626046891, "lastModified": 1626527571,
"narHash": "sha256-Zt8saH+hAehXskW0iFAzk+iMillYoFBxvLReYNqGT9E=", "narHash": "sha256-+X2GhKfkuLUYs8wVQPUKZULX3OvaNn2KwrvhoxQk9SA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d8f8f31af9d77a48220e4e8a301d1e79774cb7d2", "rev": "0a96dbc8b6bd4874ef0f55ce30ec7bdf1cb09452",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-unstable", "ref": "release-21.05",
"type": "indirect" "type": "indirect"
} }
}, },
"nixos-generators": {
"inputs": {
"nixlib": [
"nixlib"
],
"nixpkgs": [
"blank"
]
},
"locked": {
"lastModified": 1624973746,
"narHash": "sha256-11JbJRduNwyf556gndGErR5/12ceyHOHBfEuha5Vws4=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "022ef440af8dc237ab1f59fa363cb1e25783ec3e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1625333638, "lastModified": 1625333638,
@ -329,37 +379,6 @@
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1610942247,
"narHash": "sha256-PKo1ATAlC6BmfYSRmX0TVmNoFbrec+A5OKcabGEu2yU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7d71001b796340b219d1bfa8552c81995017544a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1620962350,
"narHash": "sha256-9ASW4d4/Z8HmRvuJI8rxbEOTbXTBpQ8y+CmFYBwtXzE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5d4a430472cafada97888cc80672fab255231f57",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1620340338, "lastModified": 1620340338,
"narHash": "sha256-Op/4K0+Z9Sp5jtFH0s/zMM4H7VFZxrekcAmjQ6JpQ4w=", "narHash": "sha256-Op/4K0+Z9Sp5jtFH0s/zMM4H7VFZxrekcAmjQ6JpQ4w=",
@ -377,10 +396,10 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1626188191, "lastModified": 1626202371,
"narHash": "sha256-63A/IjYpfKb/R+AiWZE6YHsaxkDnYIVSUgPw7QEQnA8=", "narHash": "sha256-thj8msabJEeAfuC/6Zb4jZnnJ7SfcLUZEY0TjXhFQNs=",
"path": "/nix/store/hjc7qr7xsbvx32092bpfsjyi6vk29fg4-source", "path": "/nix/store/z9h5jj2b9ls0q3mkvhdz5s05ly7m20k7-source",
"rev": "5caa4740529326001714f4c49a5e9f7b2c40f737", "rev": "c10216f94e7e99a05f515a8bdc87d5b460164f1a",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -388,20 +407,34 @@
"type": "indirect" "type": "indirect"
} }
}, },
"pkgs": { "nvfetcher": {
"inputs": { "inputs": {
"flake-compat": [
"digga",
"deploy",
"flake-compat"
],
"flake-utils": [
"digga",
"utils",
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixos" "latest"
] ]
}, },
"locked": { "locked": {
"narHash": "sha256-G+qmA0vMRMgEd0Wp+jMjbOe5Yz+5/Imh+wn6mTWit1o=", "lastModified": 1626443440,
"path": "./pkgs", "narHash": "sha256-9xDWqVcLxAiRC/g/JnSfsj+s/Ont0fZjczAH9pqqBdg=",
"type": "path" "owner": "berberman",
"repo": "nvfetcher",
"rev": "ba3366421ff66a06f4176780dff5e8373512bfba",
"type": "github"
}, },
"original": { "original": {
"path": "./pkgs", "owner": "berberman",
"type": "path" "repo": "nvfetcher",
"type": "github"
} }
}, },
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
@ -423,44 +456,55 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"blank": [
"digga",
"blank"
],
"bud": "bud",
"ci-agent": "ci-agent", "ci-agent": "ci-agent",
"darwin": "darwin", "darwin": "darwin",
"deploy": [
"digga",
"deploy"
],
"digga": "digga", "digga": "digga",
"flake-utils": [
"digga",
"flake-utils"
],
"home": "home", "home": "home",
"latest": "latest", "latest": "latest",
"naersk": "naersk_2", "naersk": "naersk_2",
"nix-dram": "nix-dram", "nix-dram": "nix-dram",
"nixlib": [
"digga",
"nixlib"
],
"nixos": "nixos", "nixos": "nixos",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": [
"nixos"
],
"nur": "nur", "nur": "nur",
"pkgs": "pkgs" "nvfetcher": "nvfetcher",
"utils": [
"digga",
"utils"
]
} }
}, },
"utils": { "utils": {
"locked": {
"lastModified": 1610051610,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils" "flake-utils": [
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1622583383, "lastModified": 1626288344,
"narHash": "sha256-2DFx619SNfjzYwqx1ryae8zHnTh+N7VsZkbtAbrYIIA=", "narHash": "sha256-TioHDqWJkw37jjx4DVrH6LCzwrUfAqXbWl4rKR91fpA=",
"owner": "gytis-ivaskevicius", "owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus", "repo": "flake-utils-plus",
"rev": "6b2ea4b02cad77fac581c6a9ec4f822ba87dce5c", "rev": "5c6ee69f6957afc2fe22c094717d6d78516418b5",
"type": "github" "type": "github"
}, },
"original": { "original": {

101
flake.nix
View file

@ -1,48 +1,84 @@
{ {
description = "A highly structured configuration database."; description = "A highly structured configuration database.";
nixConfig.extra-experimental-features = "nix-command flakes ca-references";
nixConfig.extra-substituters = "https://nrdxp.cachix.org https://nix-community.cachix.org";
nixConfig.extra-trusted-public-keys = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
inputs = inputs =
{ {
nixos.url = "nixpkgs/nixos-unstable"; nixos.url = "nixpkgs/release-21.05";
latest.url = "nixpkgs"; latest.url = "nixpkgs";
digga.url = "github:divnix/digga/master";
ci-agent = { digga.url = "github:divnix/digga/develop";
url = "github:hercules-ci/hercules-ci-agent"; digga.inputs.nixpkgs.follows = "nixos";
inputs = { nix-darwin.follows = "darwin"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "latest"; }; digga.inputs.nixlib.follows = "nixos";
}; digga.inputs.home-manager.follows = "home";
bud.url = "github:divnix/bud";
bud.inputs.nixpkgs.follows = "nixos";
bud.inputs.devshell.follows = "digga/devshell";
home.url = "github:nix-community/home-manager/release-21.05";
home.inputs.nixpkgs.follows = "nixos";
darwin.url = "github:LnL7/nix-darwin"; darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "latest"; darwin.inputs.nixpkgs.follows = "latest";
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos"; deploy.follows = "digga/deploy";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "latest";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "latest"; agenix.inputs.nixpkgs.follows = "latest";
nvfetcher.url = "github:berberman/nvfetcher";
nvfetcher.inputs.nixpkgs.follows = "latest";
nvfetcher.inputs.flake-compat.follows = "digga/deploy/flake-compat";
nvfetcher.inputs.flake-utils.follows = "digga/utils/flake-utils";
ci-agent.url = "github:hercules-ci/hercules-ci-agent";
ci-agent.inputs.nix-darwin.follows = "darwin";
ci-agent.inputs.nixos-20_09.follows = "nixos";
ci-agent.inputs.nixos-unstable.follows = "latest";
ci-agent.inputs.flake-compat.follows = "digga/deploy/flake-compat";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
pkgs.url = "path:./pkgs"; # start ANTI CORRUPTION LAYER
pkgs.inputs.nixpkgs.follows = "nixos"; # remove after https://github.com/NixOS/nix/pull/4641
nixpkgs.follows = "nixos";
nixlib.follows = "digga/nixlib";
blank.follows = "digga/blank";
utils.follows = "digga/utils";
flake-utils.follows = "digga/flake-utils";
# end ANTI CORRUPTION LAYER
# PubSolarOS additions # PubSolarOS additions
nix-dram.url = "github:dramforever/nix-dram"; nix-dram.url = "github:dramforever/nix-dram";
}; };
outputs = outputs =
{ self { self
, pkgs
, digga , digga
, bud
, nixos , nixos
, ci-agent , ci-agent
, home , home
, nixos-hardware , nixos-hardware
, nur , nur
, agenix , agenix
, nvfetcher
, deploy
, nix-dram , nix-dram
, ... , ...
} @ inputs: } @ inputs:
digga.lib.mkFlake { let
bud' = bud self; # rebind to access self.budModules
in
digga.lib.mkFlake
{
inherit self inputs; inherit self inputs;
channelsConfig = { allowUnfree = true; }; channelsConfig = { allowUnfree = true; };
@ -51,11 +87,13 @@
nixos = { nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ]; imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [ overlays = [
./pkgs/default.nix digga.overlays.patchedNix
pkgs.overlay # for `srcs`
nur.overlay nur.overlay
agenix.overlay agenix.overlay
nvfetcher.overlay
deploy.overlay
nix-dram.overlay nix-dram.overlay
./pkgs/default.nix
]; ];
}; };
latest = { }; latest = { };
@ -65,6 +103,7 @@
sharedOverlays = [ sharedOverlays = [
(final: prev: { (final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: { lib = prev.lib.extend (lfinal: lprev: {
our = self.lib; our = self.lib;
}); });
@ -75,13 +114,14 @@
hostDefaults = { hostDefaults = {
system = "x86_64-linux"; system = "x86_64-linux";
channelName = "nixos"; channelName = "nixos";
modules = ./modules/module-list.nix; imports = [ (digga.lib.importers.modules ./modules) ];
externalModules = [ externalModules = [
{ _module.args.ourLib = self.lib; } { lib.our = self.lib; }
digga.nixosModules.nixConfig
ci-agent.nixosModules.agent-profile ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager home.nixosModules.home-manager
agenix.nixosModules.age agenix.nixosModules.age
./modules/customBuilds.nix (bud.nixosModules.bud bud')
]; ];
}; };
@ -97,7 +137,7 @@
suites = with profiles; rec { suites = with profiles; rec {
base = [ core users.nixos users.root ]; base = [ core users.nixos users.root ];
pubsolaros = [ core base-user users.root ]; pubsolaros = [ core base-user users.root ];
anonymous = pubsolaros ++ [ users.nixos ]; anonymous = [ pubsolaros users.nixos ];
teutat3s = pubsolaros ++ [ users.teutat3s ]; teutat3s = pubsolaros ++ [ users.teutat3s ];
con = teutat3s ++ [ graphical ]; con = teutat3s ++ [ graphical ];
dumpyourvms = teutat3s ++ [ graphical ]; dumpyourvms = teutat3s ++ [ graphical ];
@ -107,7 +147,7 @@
}; };
home = { home = {
modules = ./users/modules/module-list.nix; imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ]; externalModules = [ ];
importables = rec { importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles; profiles = digga.lib.importers.rakeLeaves ./users/profiles;
@ -115,20 +155,25 @@
base = [ direnv git ]; base = [ direnv git ];
}; };
}; };
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
}; };
devshell.externalModules = { pkgs, ... }: { devshell.modules = [ (import ./shell bud') ];
packages = [ pkgs.agenix ];
};
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
defaultTemplate = self.templates.flk; defaultTemplate = self.templates.bud;
templates.flk.path = ./.; templates.bud.path = ./.;
templates.flk.description = "flk template"; templates.bud.description = "bud template";
} }
//
{
budModules = { devos = import ./pkgs/bud; };
}
; ;
} }

View file

@ -1,33 +1,11 @@
{ lib, self, diggaLib, config, modules, channel, ... }: { lib, pkgs, self, config, modules, channel, ... }:
let
mkBuild = buildModule:
# TODO: get specialArgs as a module argument and drop builderArgs usage
channel.input.lib.nixosSystem (diggaLib.mergeAny config.lib.builderArgs {
modules = [ buildModule ];
});
in
{ {
system.build = { system.build = {
iso = (mkBuild (diggaLib.modules.isoConfig { iso = (config.lib.digga.mkBuild
(config.lib.digga.modules.isoConfig {
inherit self; inherit self;
fullHostConfig = config; fullHostConfig = config;
})).config.system.build.isoImage; })
).config.system.build.isoImage;
homes = (mkBuild ({ config, ... }: {
home-manager.useUserPackages = lib.mkForce false;
home-manager.sharedModules = [
{
home.sessionVariables = {
inherit (config.environment.sessionVariables) NIX_PATH;
};
xdg.configFile."nix/registry.json".text =
config.environment.etc."nix/registry.json".text;
}
];
})).config.home-manager.users;
digitalOcean = (mkBuild ({ modulesPath, ... }: {
imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ];
})).config.system.build.digitalOceanImage;
}; };
} }

View file

@ -0,0 +1,11 @@
{ config, ... }: {
home-manager.sharedModules = [
{
home.sessionVariables = {
inherit (config.environment.sessionVariables) NIX_PATH;
};
xdg.configFile."nix/registry.json".text =
config.environment.etc."nix/registry.json".text;
}
];
}

View file

@ -1,21 +0,0 @@
[
./compat
./user
./x-os
./sway
./graphical
./docker
./audio
./email
./crypto
./nextcloud
./gaming
./virtualisation
./social
./devops
./terminal-life
./server
./printing
./office
./uhk
]

7
modules/nix-path.nix Normal file
View file

@ -0,0 +1,7 @@
{ channel, inputs, ... }: {
nix.nixPath = [
"nixpkgs=${channel.input}"
"nixos-config=${../lib/compat/nixos}"
"home-manager=${inputs.home}"
];
}

5
overlays/manix.nix Normal file
View file

@ -0,0 +1,5 @@
final: prev: {
manix = prev.manix.overrideAttrs (o: rec{
inherit (prev.sources.manix) pname version src;
});
}

View file

@ -7,7 +7,6 @@ channels: final: prev: {
dhall dhall
discord discord
element-desktop element-desktop
manix
rage rage
neovim-unwrapped neovim-unwrapped
nixpkgs-fmt nixpkgs-fmt
@ -16,15 +15,15 @@ channels: final: prev: {
starship; starship;
haskellPackages = prev.haskellPackages.override { haskellPackages = prev.haskellPackages.override
overrides = hfinal: hprev: (old: {
overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev:
let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version;
in in
{ {
# same for haskell packages, matching ghc versions # same for haskell packages, matching ghc versions
inherit (channels.latest.haskell.packages."ghc${version}") inherit (channels.latest.haskell.packages."ghc${version}")
haskell-language-server; haskell-language-server;
}; });
}; });
} }

View file

@ -0,0 +1,11 @@
final: prev: {
# Since: https://github.com/NixOS/nixpkgs/pull/126137
nix-direnv =
if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs
then
prev.nix-direnv.override
{
enableFlakes = true;
}
else prev.nix-direnv;
}

View file

@ -0,0 +1,17 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl }:
{
manix = {
pname = "manix";
version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
src = fetchgit {
url = "https://github.com/mlvzk/manix";
rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs";
};
};
}

10
pkgs/bud/default.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, lib, budUtils, ... }: {
bud.cmds = with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ];
synopsis = "get [DEST]";
help = "Copy the desired template to DEST";
script = ./get.bash;
};
};
}

1
pkgs/bud/get.bash Normal file
View file

@ -0,0 +1 @@
nix flake new -t "github:divnix/devos/core" "${2:-devos}"

View file

@ -1,5 +1,8 @@
final: prev: final: prev:
with final; { with final; {
# keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage`
import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final); import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final);
mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final); mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final);
mopidy-jellyfin = import ./mopidy-jellyfin.nix final; mopidy-jellyfin = import ./mopidy-jellyfin.nix final;

View file

@ -1,25 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1615926763,
"narHash": "sha256-yeq8A3EPNuQVlsxlEQrIRsklfJwJK0Us6jtcG/u8wNs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b702a56d417647de4090ac56c0f18bdc7e646610",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,52 +0,0 @@
{
description = "Package Sources";
inputs = { };
outputs = { self, nixpkgs, ... }: {
overlay = final: prev: {
inherit (self) srcs;
};
srcs =
let
inherit (nixpkgs) lib;
mkVersion = name: input:
let
inputs = (builtins.fromJSON
(builtins.readFile ./flake.lock)).nodes;
ref =
if lib.hasAttrByPath [ name "original" "ref" ] inputs
then inputs.${name}.original.ref
else "";
version =
let version' = builtins.match
"[[:alpha:]]*[-._]?([0-9]+(\.[0-9]+)*)+"
ref;
in
if lib.isList version'
then lib.head version'
else if input ? lastModifiedDate && input ? shortRev
then "${lib.substring 0 8 input.lastModifiedDate}_${input.shortRev}"
else null;
in
version;
in
lib.mapAttrs
(pname: input:
let
version = mkVersion pname input;
in
input // { inherit pname; }
// lib.optionalAttrs (! isNull version)
{
inherit version;
}
)
(lib.filterAttrs (n: _: n != "nixpkgs")
self.inputs);
};
}

4
pkgs/sources.toml Normal file
View file

@ -0,0 +1,4 @@
# nvfetcher.toml
[manix]
src.git = "https://github.com/mlvzk/manix"
fetch.github = "mlvzk/manix"

63
shell/default.nix Normal file
View file

@ -0,0 +1,63 @@
bud:
{ pkgs, extraModulesPath, ... }:
let
hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; };
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in
{
_file = toString ./.;
imports = [ "${extraModulesPath}/git/hooks.nix" ];
git = { inherit hooks; };
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
# PATH is devshell's exorbitant privilige:
# fence against its pollution
_PATH=''${PATH}
# Load installed profiles
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
# If that folder doesn't exist, bash loves to return the whole glob
[[ -f "$file" ]] && source "$file"
done
# Exert exorbitant privilige and leave no trace
export PATH=''${_PATH}
unset _PATH
'');
packages = with pkgs; [
git-crypt
];
commands = with pkgs; [
(devos (bud { inherit pkgs; }))
(devos nixUnstable)
(devos agenix)
{
category = "devos";
name = pkgs.nvfetcher-bin.pname;
help = pkgs.nvfetcher-bin.meta.description;
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/";
}
(linter nixpkgs-fmt)
(linter editorconfig-checker)
# (docs python3Packages.grip) too many deps
(docs mdbook)
]
++ lib.optional
(pkgs ? deploy-rs)
(devos deploy-rs.deploy-rs)
++ lib.optional
(system != "i686-linux")
(devos cachix)
;
}

4
shell/hooks/default.nix Normal file
View file

@ -0,0 +1,4 @@
{
enable = true;
pre-commit.text = builtins.readFile ./pre-commit.sh;
}

29
shell/hooks/pre-commit.sh Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(${git}/bin/git hash-object -t tree /dev/null)
fi
diff="git diff-index --name-only --cached $against --diff-filter d"
nix_files=($($diff -- '*.nix'))
all_files=($($diff))
# Format staged nix files.
if [[ -n "${nix_files[@]}" ]]; then
nixpkgs-fmt "${nix_files[@]}" \
&& git add "${nix_files[@]}"
fi
# check editorconfig
editorconfig-checker -- "${all_files[@]}"
if [[ $? != '0' ]]; then
printf "%b\n" \
"\nCode is not aligned with .editorconfig" \
"Review the output and commit your fixes" >&2
exit 1
fi

View file

View file

@ -1 +0,0 @@
[ ]

View file

@ -1,8 +1,6 @@
{ ... }: { hmUsers, ... }:
{ {
home-manager.users.nixos = { suites, ... }: { home-manager.users = { inherit (hmUsers) nixos; };
imports = suites.base;
};
users.users.nixos = { users.users.nixos = {
uid = 1000; uid = 1000;

View file

@ -1,6 +1,6 @@
{ {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
enableNixDirenvIntegration = true; nix-direnv.enable = true;
}; };
} }