-
Notifications
You must be signed in to change notification settings - Fork 5
flake: initial support #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Cool, thanks! I'll test it as soon as I get back from vacation. Much appreciated. Edit: Or not, because life 😢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As outputs.packages is meant to be used as pure and plain package set, I would suggest
outputs = {
self
, nixpkgs
, flake-utils
}: let
systems = ...;
inherit (nixpkgs) lib;
instantos = import ./default.nix { pkgs = nixpkgs.legacyPackages.${system}; };
in
{
nixosModules = import ./modules;
} // flake-utils.lib.eachSystem systems (system: {
packages = lib.filterAttrs (n: v: lib.isDerivation v) instantos;
legacyPackages = {
inherit instantos;
};
});
Also, as this package is meant to be used by people on both the stable channel and the unstable channel, we probably should avoid providing the flake.lock, but have it in .gitignore instead. That's what Home Manager people do.
The point of providing the lock file is to have a version of the dependencies that is tested against and known to work. So I think we should include it. |
|
instantNIX/pkgs/instantUtils/default.nix Lines 118 to 122 in 81dad6e
Without the deleted lock file nix build fails on unstable since disper was removed. This would also be the case for the NixOS 22.05 release
|
|
I see. Maybe we should add it back. Users can still override it with |
outputs.nixosModules = import ./modules.nix;is only valid when I think we should either change {
instantlock = ./instantlock.nix;
instantwm = ./insntantwm.nix;
}or change the corresponding flake output to nixosModules = (import ./modules.nix).modules; |
|
Thank you for all your work!
Should we specify the "officially supported" channel (Nixpkgs branch) then? It could be implemented by specifying the flake inputs: {
# ...
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
outputs = ... ;
}After that, just run nix flake lockand nix will modify |
|
Just for the record, I'm very happy that you two nix-savy people are on board here. ❤️ |
|
Happy to help! |
ShamrockLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last changes:
Otherwise, LGTM.
|
Thanks a lot for your time and effort! AFAIK, most people would squash those PR modifications into one commit to make the history cleaner. To squash the extra 7 commits into the first one, you can run the following commands: git checkout flake
# Base----A----B----C----D----E----F----G----H
# ^--dev ^--HEAD
git reset --soft flake~7
# Base----A----Staged changes (contains changes in B, ..., H)
# ^--dev ^--HEAD
git commit --amend --no-edit
# Base----A'
# ^--dev ^--HEAD
# ^ (contains changes in A, ..., H)and then force-push to your fork repository. |
|
Done. Thanks for all the tips! |
Based on https://github.com/nix-community/nur-packages-template Could also use https://github.com/numtide/flake-utils#eachsystem---system---system---attrs Locking `inputs.nixpkgs` at nixos-21.11 should remove the need for the lock file Co-authored-by: Shamrock Lee <44064051+ShamrockLee@users.noreply.github.com>
test with
nix build .#packages.instantnix