Commit graph

245 commits

Author SHA1 Message Date
Timothy DeHerrera 9537daee32
flake: nixos -> nixos-unstable
20.09 is getting stale as we move toward a new release so track
unstable for now.
2021-03-22 23:20:40 -06:00
Pacman99 3c8d22a528 flake/tests: improve multi arch support for flake checks 2021-03-19 12:23:23 -07:00
Pacman99 aec7c92cc7 hosts: set nixpkgs.pkgs based on nixpkgs.system 2021-03-19 12:23:23 -07:00
Pacman99 4034659350
lib: pass inputs to ./lib
library functions now can access inputs (and their sources!)
directly, for example in order to copy their closure into
the iso registry so that evaluating the flake does not need
to fetch inputs again
2021-03-16 16:38:36 -05:00
David Arnold 3d324e7533 lib/devos: bake devos repo into live cd (#168)
fix #167 

This worked for me to bootstrap another machine.
2021-03-16 19:50:38 +00:00
Timothy DeHerrera d51cd34fb7
subflakes: make first class citizens
Subflakes should provide their wares as outputs, so wire up the pkgs
flake to reflect that.

Due to the unstable nature of flakes, updating the root flake doesn't
currently update the subflake lock file. Therefore, add additional
logic to flk update script in order to do this behind the scenes.

Nix is now pulled in from the "nix" registry flake in order for users
to take advantage of improvements to the UI since its last update in
nixpkgs.
2021-03-14 21:27:58 -06:00
Timothy DeHerrera c012f2f4ed treewide cleanups and refactoring for initial tests (#157)
- [x] refactor lib into separate files, similar to NixOS/nixpkgs/lib.
- [x] refactor ci to automatically generate derivations from flake outputs
- [x] remove cluttered indirection statements throughout the codebase
- [x] refactor hosts to allow for upcoming integration tests
- [x] improve ambiguity in the existing docs 
- [x] add [BORS](https://bors.tech) support
- [x] add initial integration test
- [x] write tests documentation
- [x] test lib
- [x] improve version string generation, and do so automatically for pkgs/flake.nix sources

Clean up the codebase as best we can in preparation for #152 and add tests. From now on, all PRs will be merged with BORS.
2021-03-14 07:10:51 +00:00
Timothy DeHerrera 5bd8876b74
Merge pull request #147 from blaggacao/da/lib-with-dep-on-pkgs
lib: can depend on pkgs (a la nixpkgs#pkgs/pkgs-lib)
2021-03-05 12:16:38 -07:00
Timothy DeHerrera 5bce44b1bd
flake.lock: update 2021-03-01 20:30:47 -07:00
David Arnold bca532ab42
lib: can depend on pkgs (a la nixpkgs#pkgs/pkgs-lib) 2021-03-01 14:01:17 -05:00
Timothy DeHerrera e5ddc3127b
pkgs#flake: fix flake-compat support
https://github.com/edolstra/flake-compat/pull/18
2021-02-26 00:15:46 -07:00
Timothy DeHerrera 25180a5e6e
pkgs: use subflake to manage package sources
* Resolves #118
* Leverage flakes to manage package sources & hashes
* Update documentation with an example.
* Add `mkVersion` function to autogenerate a version string.
* Add srcs package via overlay containing all sources defined in
  _pkgs/flake.nix_
* Extend `flk update` with the ability to only update the given input
2021-02-26 00:15:45 -07:00
Timothy DeHerrera 77296ff433
deploy: move logic to lib 2021-02-15 11:24:43 -07:00
Timothy DeHerrera caba5fd756
deploy-rs: init support
Managing servers remotely is a big usecase, and deploy-rs is a flake
first deployment tool. By default, all nixosConfigurations are also
setup as deploy-rs nodes.

You'll still need to do some manual ssh setup, but other than that, the
system is ready to deploy.
2021-02-14 22:17:24 -07:00
Timothy DeHerrera cf23b8e64d
flake: rename flake-utils input 2021-02-14 22:11:49 -07:00
Timothy DeHerrera b42f7b514d
flake: manage flake-compate as input 2021-02-14 22:08:24 -07:00
Timothy DeHerrera 1b12c78c0e
flake: nixpkgs points to master by default
No need to explicitly specify it.
2021-02-14 19:43:11 -07:00
Timothy DeHerrera bf34d2071f
doc: new mdbook documentation 2021-02-14 02:46:05 -07:00
Timothy DeHerrera 933fb8fee9
shell: cleanup devshell
* Add update command to flk
* Add cleaner usage to flk command
* Factor out scripts to be more readable
2021-02-14 02:29:17 -07:00
Timothy DeHerrera 850cb21124
flake: use same nixos versions for inputs 2021-02-07 14:25:18 -07:00
Timothy DeHerrera 0ec0c25238
various refactors
* Move extern lists to their own folder
* Move unstable package and module imports to their own folder
* Create a genPkgs function to avoid using legacyPackages for the whole
  package set
* Move hmActivationPackages to legacyPackages
2021-02-03 23:44:58 -07:00
Timothy DeHerrera 4ae99af29d
Merge pull request #102 from blaggacao/da/iso-sd-netboot
host: add deault implementation for system.build.isoImage target (per…
2021-02-01 19:51:44 -07:00
Timothy DeHerrera 8d0119d8e4
home: move hmActivationPackages to own output
Fixes `nix flake check` failure.
2021-02-01 19:48:59 -07:00
Timothy DeHerrera 17621d6b14
iso-cd: style cleanup (#2) 2021-02-01 20:57:19 -05:00
David Arnold 8cb82a307f
iso: move iso target to ./lib 2021-01-27 21:17:59 -05:00
Pacman99 88eecddab5
users: home-manager only configurations
for non-root users or non-nixos systems
2021-01-27 10:16:08 -07:00
Timothy DeHerrera b1c42e4ed4
flake: format fix 2021-01-25 09:21:27 -07:00
Timothy DeHerrera a173bd4165
profiles#ci-agent: init 2021-01-25 09:20:40 -07:00
Timothy DeHerrera 82463ffdc9
flake: apply overrides first
Fixes other overlays not applying when pulling package from master.
2021-01-24 11:05:37 -07:00
Timothy DeHerrera 1b80806516
compat: fixes
* fix nixos-option
* use flake-compat for all backward compat concerns
* rebuild devshell after any nix file changes
* reexport system pkgs as legacyPackages
* provide lib flake output
* provide flake lib to nixos configs via `lib.flk`
* clean up flake.nix
2021-01-23 16:45:10 -07:00
Timothy DeHerrera 47963432c4
Revert "Add nrdxp cachix to substituter flake list" 2021-01-23 16:36:21 -07:00
Timothy DeHerrera 8ce3db6326
Merge pull request #71 from blaggacao/da-substituters
Add nrdxp cachix to substituter flake list
2021-01-18 10:20:33 -07:00
Timothy DeHerrera 58b0f1ae65
Merge branch 'template' into template 2021-01-18 10:03:57 -07:00
Timothy DeHerrera f8f67d2dcb
packages: apply overlays to output packages
Apply overlays to output packages so we can easily use a modified
package.
2021-01-18 02:23:49 -07:00
Benedikt Tissot a9f11b3dca flake/host: add nixos-hardware
- add nixos-hardware flake.
- configuration in hosts/default.nix to be able to include hardware
specifics per host.
- add corresponding documentation in readme
2021-01-18 08:37:11 +01:00
Timothy DeHerrera 25293a7ea8
flake: remove apps to reduce complexity
As pointed out here numtide/flake-utils#17, apps are somewhat redundant
and, for the sake of simplicity, should be removed for now.
2021-01-11 18:10:48 -07:00
Timothy DeHerrera ade0ca4e3a
Merge pull request #77 from blaggacao/patch-3
Evaluate exported pkgs against repo baseline nixos
2021-01-11 17:59:22 -07:00
David Arnold a45df43106
Update flake.nix 2021-01-11 14:26:25 -05:00
David Arnold bb3f6ac13e
Little hint 2021-01-11 14:14:48 -05:00
David Arnold c1b04a3aa1
Evaluate exported pkgs against repo baseline nixos
The baseline pkgs for own consumption is nixos, only pkgs/override.nix
provides a mechanism to "backport" packages from unstable.

Therefore, we should expose our packages to others in the same
context as we use them ourselves.
2021-01-10 20:02:08 -05:00
David Arnold 99c537e10e
Add nrdxp cachix to substituter flake list
courtesy of: 343239fc8a
2021-01-09 20:39:12 -05:00
Timothy DeHerrera 41e3de0eab
flake: simply packages with flattenTreeSystem
Based on https://github.com/numtide/flake-utils/pull/13.
2021-01-03 00:05:39 -07:00
Timothy DeHerrera 00b35136c3
flake: add pkgs back to overlays
Packages from `pkgs/default.nix` are meant to be exposed to all nixos
configurations. However, #61 removed a redundancy in the output api
which was  relied up to do so.
2020-12-31 14:02:19 -07:00
Timothy DeHerrera 893e09278b
shell: switch to using mkDevShell 2020-12-28 23:12:27 -07:00
Timothy DeHerrera 11f085e78c
shell: pull in more dependencies
* Pull recent enough versions on nixos-(rebuild|install) to ensure
  compatibility with flakes.
* Add grip for viewing changes to README.md locally
2020-12-28 21:58:23 -07:00
Timothy DeHerrera da685a0fb1
flake: add apps output
Packages that contain an "$out/bin" dir are exported as `apps` as well.
2020-12-28 20:33:26 -07:00
Timothy DeHerrera bdfdc4da54
flake: add externModules list
Fixes #44. Easily add external modules from other flakes by dropping
them in the list.
2020-12-28 15:07:15 -07:00
Timothy DeHerrera 7a6e725b53
flake: initial multiarch support 2020-12-27 21:19:45 -07:00
Diogo Xavier 15003e3de9 Add NUR support 2020-12-26 12:40:20 +00:00
Timothy DeHerrera 3300b5d582
flake: clean up by moving implementation to utils
Fixes #28 by adding an `externOverlays` list to easily import overlays
from external flakes.
2020-12-25 12:53:57 -07:00
codygman dc81753790 update to 20.09
Also fixes #24 by using recommended home-manager
2020-12-01 21:18:24 -06:00
Timothy DeHerrera 219975f9cc
packages: export overlays as packages 2020-08-02 21:26:00 -06:00
Timothy DeHerrera 39c1a48674
flake: add template output 2020-08-01 23:10:22 -06:00
Timothy DeHerrera 5e0ca31d02
flake: rename flake inputs and add overrides
Now you can add packages to the list in pkgs/override.nix and they will
be pulled in from nixpkgs master instead of the default NixOS flake
when installed.
2020-08-01 22:08:41 -06:00
Timothy DeHerrera 068be3f5bf
lint: remove //, replace with recursiveUpdate 2020-07-30 23:32:53 -06:00
Timothy DeHerrera 2369f43398
format: apply nixpkgs-fmt 2020-07-30 22:17:28 -06:00
Timothy DeHerrera 7e93ef7ccf
flake: move pathsToImportedAttrs to utils 2020-07-30 15:29:58 -06:00
Timothy DeHerrera 1373380a91
flake#nixosModules: add binary cache as module 2020-07-26 16:03:51 -06:00
Timothy DeHerrera c9495ea881
direnv: use nix print-dev-env
In order to increase determinism in the build environment, we are
having direnv load the shell environment from the flake's `devShell`
output, instead of the traditional `nix-shell` approach. Of course,
one can still enter a `nix-shell` manually on a system without flake
support installed.
2020-07-13 20:00:47 -06:00
Timothy DeHerrera e9be8e5f5e
flake: base unstable on master 2020-07-09 00:04:42 -06:00
Timothy DeHerrera d1c0b0f6ec
pkgs: add metadata and standardize 2020-06-19 14:55:30 -06:00
Timothy DeHerrera 05a798a56e
flake: add option to install packages from nixos-unstable 2020-06-12 19:18:27 -06:00
Timothy DeHerrera df88ef7bb0
Merge pull request #15 from jtojnar/check-fixes
flake: Fix `nix flake check`
2020-06-09 13:11:42 -06:00
Timothy DeHerrera ad9f0d70e8
flake: update lockfile 2020-06-09 10:37:23 -06:00
Jan Tojnar a7749005bc
flake: Fix overlays for nix flake check
It complains that:

	value is a list while a set was expected, at /nix/store/0qdcc831rj27wz07lrri6bnfmhvm4wrm-source/flake.nix:26:7

But nixpkgs still expects a list, so we need to pass it just the values.
2020-06-02 01:18:40 +02:00
Jan Tojnar 0b14dbbc2d
flake: Refactor nixosModules collection
We will want to reuse the prep method for overlays so let's move it higher and simplify it a bit.
2020-06-02 01:14:33 +02:00
Jan Tojnar f3e52ede3c
flake: remove epoch
It was renamed to edition:

cc5d0a2497

leading to the following error:

error: flake 'git+file:///home/jtojnar/Projects/nixflk?ref=template&rev=31c2b767ca7cb901040e388794b34942807719e0' has an unsupported attribute 'epoch', at /nix/store/yndrc91vlh5vm0k4nngx303q1cjm77z9-source/flake.nix:4:3

but that itself has been deprecated:

warning: flake 'git+file:///home/jtojnar/Projects/nixflk' has deprecated attribute 'edition'
2020-06-02 01:03:23 +02:00
Timothy DeHerrera 9af46a3dca
flake: update to upstream 2020-04-23 12:03:55 -06:00
Timothy DeHerrera d5ba9f6173
flake.nix: define pkgs in flake
Set the global package set via `hosts/default.nix` passed in from its
definition in `flake.nix`.
2020-01-29 08:50:07 -07:00
Timothy DeHerrera 9b64b50ee8
flake.nix: consistent default.nix semantics 2020-01-10 22:39:42 -07:00
Timothy DeHerrera cef548d232
Revert "Merge branch 'nur' into template"
This reverts commit 48afb873c1, reversing
changes made to 7e58e0457e.
2020-01-10 21:55:09 -07:00
Timothy DeHerrera 506e810b9f
flake: initial NUR support 2020-01-10 00:10:59 -07:00
Timothy DeHerrera ef5d61af76
pkgs#pure: init at 0e87bd8 2020-01-07 13:05:38 -07:00
Timothy DeHerrera c914a607da
flake: changed by mistake; revert 2020-01-06 00:26:48 -07:00
Timothy DeHerrera 4cf8048807
overlays: init overlays directory
Overlays now live globally in the overlays directory. They will be
pulled into the flake and the rest of your configuration automatically
from there.
2020-01-06 00:01:00 -07:00
Timothy DeHerrera 9670fa4b0f
Revert "utils: now lives in lib.utils globally"
This reverts commit c9944b411e.
Causes infinite recursion, revert for now while exploring possible
solutions.
2020-01-05 15:39:59 -07:00
Timothy DeHerrera c9944b411e
utils: now lives in lib.utils globally 2020-01-05 03:45:59 -07:00
Timothy DeHerrera a3dcc4f6bc
profiles: convert to list same as modules 2020-01-04 16:23:15 -07:00
Timothy DeHerrera ae303b39fd
modules: convert to list to match nixpkg sematics 2020-01-04 16:08:49 -07:00
Timothy DeHerrera 16b8136f50
change formatter to nixfmt 2020-01-03 22:06:31 -07:00
Timothy DeHerrera 425f7894a4
export profiles via flake outputs
Export those listed in `profiles/default.nix` to be included in the
flake output `nixosModules` for easy use in other flakes.
2020-01-03 20:01:22 -07:00
Timothy DeHerrera e93ac2f790
flake.nix: name flake inputs
The flake inputs can now be arbitrarily referenced from
hosts/default.nix as they are all passed into it. Any input not
declared at the top of hosts/default.nix can still be referenced
as args.<input>.
2020-01-03 18:27:52 -07:00
Timothy DeHerrera 1493f43ba7
flake: add packages to outputs 2020-01-01 19:24:09 -07:00
Timothy DeHerrera 5f05e9e809
flake: provide overlay and overlays 2019-12-30 18:05:27 -07:00
Timothy DeHerrera cd25fdf37c
flake: move modules to outputs 2019-12-30 18:00:09 -07:00
Timothy DeHerrera ac5e184666
flake: move overlays to flake outputs 2019-12-30 17:45:30 -07:00
Timothy DeHerrera 1f55960518
rename configurations to hosts 2019-12-21 18:39:19 -07:00
Timothy DeHerrera 2bad76157e
flake: nix flake is broken, use pkgs.nixFlakes 2019-12-17 15:56:02 -07:00
Timothy DeHerrera c900537587
home-manager: init 2019-12-15 01:35:12 -07:00
Timothy DeHerrera 6c51d2761a
utils: import from configurations 2019-12-15 01:23:19 -07:00
Timothy DeHerrera 10522aac59
use my fork of nixpkgs until flakes stabilize 2019-12-13 21:39:25 -07:00
Timothy DeHerrera ae0746a5a4
utils: create utility functions to ease repetition
`reqImport` in particular, is useful for easily importing an entire
directory of nix files into an attribute set.
2019-12-13 21:30:43 -07:00
Timothy DeHerrera c2d1230a00
succinct description and README.md 2019-12-05 02:15:30 -07:00
Timothy DeHerrera 79181e103f
setup configurations API
NixOS file, configurations/<name>.nix, will be easily installable
via `nixos-rebuild --flake ".#<name>"`.
2019-12-05 01:58:40 -07:00
Timothy DeHerrera 17713c22d0
init 2019-12-02 22:18:30 -07:00