Skip to content
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

Update flake outputs structure in line with current specification #126

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ To install the `agenix` binary:
system = "x86_64-linux";
modules = [
./configuration.nix
agenix.nixosModule
agenix.nixosModules.age
];
};
};
Expand All @@ -187,7 +187,7 @@ but, if you want to (change the system based on your system):

```nix
{
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ];
environment.systemPackages = [ agenix.packages.x86_64-linux.default ];
}
```

Expand Down Expand Up @@ -509,9 +509,14 @@ The agenix CLI uses `rage` by default as its age implemenation, you
can use the reference implementation `age` with Flakes like this:

```nix
{pkgs,agenix,...}:{
{pkgs, self, ...}:
let
inherit (pkgs.stdenv.hostPlatform) system;
inherit (self.inputs.agenix.packages.${system}) agenix;
in
{
environment.systemPackages = [
(agenix.defaultPackage.x86_64-linux.override { ageBin = "${pkgs.age}/bin/age"; })
(agenix.override { ageBin = "${pkgs.age}/bin/age"; })
];
}
```
Expand Down
37 changes: 37 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 32 additions & 29 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,39 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = { self, nixpkgs }:
let
agenix = system: nixpkgs.legacyPackages.${system}.callPackage ./pkgs/agenix.nix {};
in {

nixosModules.age = import ./modules/age.nix;
nixosModule = self.nixosModules.age;

overlay = import ./overlay.nix;

packages."aarch64-linux".agenix = agenix "aarch64-linux";
defaultPackage."aarch64-linux" = self.packages."aarch64-linux".agenix;

packages."i686-linux".agenix = agenix "i686-linux";
defaultPackage."i686-linux" = self.packages."i686-linux".agenix;

packages."x86_64-darwin".agenix = agenix "x86_64-darwin";
defaultPackage."x86_64-darwin" = self.packages."x86_64-darwin".agenix;

packages."aarch64-darwin".agenix = agenix "aarch64-darwin";
defaultPackage."aarch64-darwin" = self.packages."aarch64-darwin".agenix;

packages."x86_64-linux".agenix = agenix "x86_64-linux";
defaultPackage."x86_64-linux" = self.packages."x86_64-linux".agenix;
checks."x86_64-linux".integration = import ./test/integration.nix {
inherit nixpkgs; pkgs = nixpkgs.legacyPackages."x86_64-linux"; system = "x86_64-linux";
outputs = {
self,
flake-parts,
nixpkgs,
}:
flake-parts.lib.mkFlake {inherit self;} {
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem = ctx @ {
system,
pkgs,
...
}: {
packages.default = ctx.config.packages.agenix;
packages.agenix = pkgs.callPackage ./pkgs/agenix.nix {};
checks.integration = import ./test/integration.nix {
inherit system pkgs nixpkgs;
};
};
flake.nixosModules = {
default = self.nixosModules.age;
age = import ./modules/age.nix;
};
flake.overlays.default = final: prev: {
agenix = prev.callPackage ./pkgs/agenix.nix {};
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not want to use complex constructions and external libraries to save 10 lines of boilerplate.

};

};

}
4 changes: 0 additions & 4 deletions overlay.nix

This file was deleted.