Commit Graph

1363 Commits

Author SHA1 Message Date
Timothy DeHerrera
1cbbb78aba
ci: don't build legacyPackages
`legacyPackages` are not filtered by system and so will contain invalid
derivations. If something in legacyPackages should be explicitly built
add it to the `checks` output.
2021-03-26 18:29:48 -06:00
Timothy DeHerrera
82fe56d5fa
tests: remove nixpkgs patch
Should have been removed in 436fbb08e8
2021-03-26 18:18:16 -06:00
bors[bot]
5a3bae7be5
Merge #220
220: Drop flattenTreeSystem and use custom function for filtering packages r=nrdxp a=Pacman99

I don't think we should flatten the system because if a user doesn't make a package a derivation in pkgs/default.nix we should trust that there is a reason for doing so. So instead this drops the flattenTreeSystem reference(and switches to flake-utils master branch) and replaces its usage with a custom function `filterPackages`. This function filter all packages that match three conditions;
 - is a derivation
 - not broken
 - system is supported

In that order as to not cause errors when trying to reference non-derivation meta attributes.

And then also just dump *all* packages into legacy packages, so everything else is still accessible. I was considering removing the packages that are already in the packages output in legacyPackages, but I don't think its necessary since nix looks to the packages output first.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-27 00:10:58 +00:00
Pacman99
58814fe741 flake: use filterPackages instead of flattenTreeSystem 2021-03-26 17:03:23 -07:00
Pacman99
fb14e20249 lib/filterPackages: filter by flake requirements
returns only non-broken derivations that support the system.
2021-03-26 16:55:27 -07:00
bors[bot]
3c772df5b0
Merge #215
215: lib/pathsToImportedAttrs: discard string context in the names to prevent flake check error r=nrdxp a=Pacman99

So I learned about this myself while working on it. Nix has a thing called string context, where strings refer to various store paths that they used to contain. This is normally a good thing to guarantee purity, but flake outputs cannot contain store paths. So when `pathsToImportedAttrs` is passed a list of store paths, and is then used for a flake output, we get a very confusing error that the string refers to a store path - even though it doesn't look like it does! 
I think its good to review this as a separate Pr, since it requires calling an unsafe nix builtin.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-26 21:30:04 +00:00
bors[bot]
00759997ab
Merge #211
211: home-manager fixes r=nrdxp a=nrdxp

- [x] integrate nix-community/home-manager#1880 (to avoid duplicate commits, we'll wait a bit to see if this gets merged)
- [x] don't use all of `systemPackages` for `flk home` 
- [x] test home-manager `activationPackage` and `flk home` as part of CI

Co-authored-by: Timothy DeHerrera <tim.deh@pm.me>
2021-03-26 21:22:49 +00:00
bors[bot]
205a9d3e03
Merge #219
219: lib/mkPkgs: reorder overlays to get access to devos lib(dev) r=nrdxp a=Pacman99

nixpkgs applies overlays in the order given. This PR moves the lib extension overlay to be first so all subsequent overlays can access `dev` which is the devos lib.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-26 21:07:51 +00:00
Pacman99
d344fc2ea6 lib/mkPkgs: reorder overlays to get access to devos lib(dev) 2021-03-26 13:00:38 -07:00
Pacman99
68a5a2eecf lib/pathsToImportedAttrs: discard string context in the names to prevent flake check error 2021-03-26 08:10:56 -07:00
Timothy DeHerrera
397d2bab5e
home-manager: simple test 2021-03-26 00:31:45 -06:00
Timothy DeHerrera
b39bd973da
home-manager: update to fix sharedModules args
incooperate nix-community/home-manager#1880.
2021-03-25 23:46:58 -06:00
bors[bot]
908ba1633d
Merge #213
213: readme typo r=Pacman99 a=jackmac92

hopefully I can make a more meaningful contribution in the future, but this is all I got for now

Co-authored-by: Jack McCown <jackmac79@gmail.com>
2021-03-26 00:58:32 +00:00
Jack McCown
93032755db
readme typo
hopefully I can make a more meaningful contribution in the future, but this is all I got for now
2021-03-25 19:05:52 -04:00
bors[bot]
d5c5ff5a70
Merge #212
212: lib/pathsIn: don't error if path doesn't exist r=Pacman99 a=Pacman99

Really simple, just don't error if path passed to pathsIn doesn't exist. This doesn't affect much, since the majority of folders in devos end up getting referenced in some way or another outside of a pathsIn call. But it will  help for users of mkDevos, so they can safely delete folders they don't want to use. 
Can test with current overlays folder in deovs, that only gets imported through a pathsIn call.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-25 23:01:35 +00:00
Pacman99
61fc640f10 lib/pathsIn: don't error if path doesn't exist 2021-03-25 15:21:10 -07:00
Timothy DeHerrera
e767f7066e
devosSystem#hmConfig: don't pass systemPackages
The intentions are good, but for users with many profiles, this is
overkill. Proper solution will come when #127 is resolved.
2021-03-25 00:17:50 -06:00
Timothy DeHerrera
4f38a88191
changelog: only on release
To remove the opportunity for junk to enter into the changelog, and to
reduce the commit history, the changlog generation will only happen
on release, and only based on merged PRs.

Fixes #205
2021-03-23 22:59:01 -06:00
bors[bot]
01f25807e4 Update Changelog for PR 2021-03-23 20:50:56 +00:00
bors[bot]
4dcf191d1d
Merge #210
210: hosts: add cachix r=nrdxp a=Pacman99

fixes #208 

I think it was dropped during #157. It used to be added to nixosModules, but I think its better added to hosts, I don't see a reason to export the cachix module as an output.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-23 20:48:04 +00:00
Pacman99
25a2431ff7 hosts: add cachix 2021-03-23 10:25:42 -07:00
bors[bot]
54d0c8d5d7 Update Changelog for PR 2021-03-23 17:21:06 +00:00
bors[bot]
74c23ce9c1
Merge #156
156: Improve Home Manager support: profiles/suites, modules, extern, flake outputs r=Pacman99 a=Pacman99

A really simple method of implementing #119. 

This relies on a feature that I added in home-manager master for module options of extraSpecialArgs and sharedModules, nix-community/home-manager#1793. I could try and get that backported to 20.09. But I thought I'd get some feedback on these changes first.

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-23 17:18:43 +00:00
Pacman99
6d51ed0266 users: add Home Manager section to doc 2021-03-23 09:43:37 -07:00
Pacman99
dc9d9877b8 export homeConfigurations for all user@host pairs and add better home-manager only defaults 2021-03-23 09:43:37 -07:00
Pacman99
cc52cd9fa2 users: wire up all user profiles to userSuites and pass to home-manager 2021-03-23 09:43:37 -07:00
Pacman99
416a52fcd3 users: add and export user modules and import them in hosts 2021-03-23 09:43:37 -07:00
Pacman99
0e5aa6568e flake/home: release -> master 2021-03-23 09:43:37 -07:00
bors[bot]
6134c31ece Update Changelog for PR 2021-03-23 06:12:06 +00:00
bors[bot]
c667cc5097
Merge #192
192: flake: nixos -> nixos-unstable r=nrdxp a=nrdxp

20.09 is getting stale as we move toward a new release so track unstable for now.

Co-authored-by: Timothy DeHerrera <tim.deh@pm.me>
2021-03-23 06:10:34 +00:00
Timothy DeHerrera
44623b5979
nix: don't use nix flake
I originally wanted to use the nix flake to allow users to take
advantage of the latest changes. Just so happened that nixpkgs was
recently updated with a new version around the same time, and this
just adds complexity for no real gain.
2021-03-22 23:29:31 -06:00
Timothy DeHerrera
9ba1e7f9bc
nix: remove patch for default unstable features 2021-03-22 23:29:30 -06:00
Timothy DeHerrera
436fbb08e8
tests: patched nixpkgs no longer needed 2021-03-22 23:20:42 -06:00
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
bors[bot]
b7cb975486 Update Changelog for PR 2021-03-22 22:02:13 +00:00
bors[bot]
870897a3e9
Merge #202
202: iso: avoid systemd service startup r=nrdxp a=blaggacao

fixes #194
alternative to #197

# Manual Tests


<details>
<summary>was unrelated</summary>

- [ ] `flk install NixOS --impure` correctly onto `/mnt`  (looks like no profile is present)

Issue: https://github.com/divnix/devos/issues/204
Upstream Issue: https://github.com/NixOS/nixpkgs/issues/116938

</details>

- [x] acceptable build time / closure size ca 850MB (for a simple base OS) ✔️ 
- [x] local profile with `cage` service is disabled, that is: boots into terminal ✔️ 
- [x] success: air gapped / offline devshell enter ✔️ 
- [ ] failure: aire gapped target install: &larr; non blocking bonus item  
```console
$ flk install POS
warning: you don't have internet access; disabling some network-dependent features
building the flake in path:/iso/devos?narHash=sha265-...
warning: you don't have internet access; disabling some network-dependent features
error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/df8e3...': Couldn't resolve host name (6)
```

&rarr; detailed rationale in the commit messages

❤️ @Pacman99 for the excellent and detailed discussions in #197 and the may ideas, suggestions and code.

Co-authored-by: David Arnold <dar@xoe.solutions>
2021-03-22 21:59:12 +00:00
bors[bot]
b1924a21cd Update Changelog for PR 2021-03-19 19:55:27 +00:00
bors[bot]
c050027171
Merge #161
161: Multi-arch support for hosts(nixosConfigurations) r=nrdxp a=Pacman99

fixes #72 

also related, #125 

This allows users to set `nixpkgs.system` to any architecture exported by the nixpkgs flake and nixpkgs.pkgs will be set to that system.

I also added `multiPkgs` as a special arg and made `nixpkgs.pkgs` a default. So if someone wanted to do crossSystem builds or anything else with pkgs, that is also an option(eg. mobile-nixos!!).

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-19 19:33:31 +00: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
David Arnold
49b1ad8227
iso: ensure tools of deactivated profiles are still available
This is just for convenience, since the closuers are already in the
store. It might be helpful to be able to test out some things
of those deactivated profiles een on the iso isntaller.
2021-03-18 23:46:47 -05:00
David Arnold
007447652b
iso: add back complete host profile to the nix store
This ensures that all builds of activated profiles are included into
the iso cache and don't require rebuilding within the live installer
environment.
2021-03-18 23:46:47 -05:00
David Arnold
435847823f
style / organization 2021-03-18 23:46:47 -05:00
David Arnold
15cf15b3ed
iso: filter out al profiles (except core)
IN order to avoid random startup of systemd services, filter out all
profiles, except for core and user profiles.

This works becasue of a fundamental devos contract, that modules
only define configuration, but don't implement them and profiles
only implement confguration but don't define them. So only ever an
activated profile is expected to effectively start up a systemd service.

closes: #194
2021-03-18 23:46:47 -05:00
David Arnold
db716d1921
lib: ensure path type in mkProfileAttrs
This is required so that filtering via lib.remove works against 
modules.core and similar which are of path type.

It is also a prerequisite for disabledModules to match by module.key
instead of path string relative to nixpkgs' modulePath.
2021-03-18 23:46:47 -05:00
bors[bot]
2961c1ea52 Update Changelog for PR 2021-03-18 03:38:02 +00:00
bors[bot]
1b4edf3333
Merge #198
198: hosts/devosSystem: pass modules as attrset r=nrdxp a=Pacman99

This is a fairly simple change that only changes the lib api for devosSystem. But doesn't add any features by itself. Hosts now pass modules to devosSystem as an attrset. And devosSystem just grabs all modules in the set and passes it to nixosSystem. 

I plan to use this in #197 to selectively import modules. And I think it could help with nix-darwin - and other config systems - support, since not all profiles and modules are config system agnostic. This could be a workaround to add rudimentary support for other config systems by only importing the necessary modules.

Overall I think its a useful change and extends the abilities of `devosSystem`

Co-authored-by: Pacman99 <pachum99@gmail.com>
2021-03-18 03:36:12 +00:00
Pacman99
dd494facc3 hosts/devosSystem: pass modules as attrset 2021-03-17 17:28:49 -07:00
bors[bot]
8ee334277a Update Changelog for PR 2021-03-17 00:32:59 +00:00
bors[bot]
f3a0fc9cc0
Merge #196
196: doc: enact bootstrapping section r=nrdxp a=blaggacao

closes: #193

Co-authored-by: David Arnold <dar@xoe.solutions>
2021-03-17 00:30:21 +00:00