Merge pull request #136 from ryantm/rtm-1-29-flake-format

feature: update flake output format and docs
This commit is contained in:
Ryan Mulligan 2023-01-29 10:54:24 -08:00 committed by GitHub
commit bf537f5b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 31 deletions

View file

@ -50,7 +50,7 @@ All files in the Nix store are readable by any system user, so it is not a suita
Choose one of the following methods: Choose one of the following methods:
* [niv](#install-via-niv) (Current recommendation) * [niv](#install-via-niv)
* [nix-channel](#install-via-nix-channel) * [nix-channel](#install-via-nix-channel)
* [fetchTarball](#install-via-fetchTarball) * [fetchTarball](#install-via-fetchTarball)
* [flakes](#install-via-flakes) * [flakes](#install-via-flakes)
@ -134,8 +134,8 @@ Add the following to your configuration.nix:
in [ in [
"${builtins.fetchTarball { "${builtins.fetchTarball {
url = "https://github.com/ryantm/agenix/archive/${commit}.tar.gz"; url = "https://github.com/ryantm/agenix/archive/${commit}.tar.gz";
# replace this with an actual hash # update hash from nix build output
sha256 = "0000000000000000000000000000000000000000000000000000"; sha256 = "";
}}/modules/age.nix" }}/modules/age.nix"
]; ];
} }
@ -168,7 +168,7 @@ To install the `agenix` binary:
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./configuration.nix ./configuration.nix
agenix.nixosModule agenix.nixosModules.default
]; ];
}; };
}; };
@ -187,7 +187,7 @@ but, if you want to (change the system based on your system):
```nix ```nix
{ {
environment.systemPackages = [ agenix.defaultPackage.x86_64-linux ]; environment.systemPackages = [ agenix.packages.x86_64-linux.default ];
} }
``` ```
@ -511,7 +511,7 @@ can use the reference implementation `age` with Flakes like this:
```nix ```nix
{pkgs,agenix,...}:{ {pkgs,agenix,...}:{
environment.systemPackages = [ environment.systemPackages = [
(agenix.defaultPackage.x86_64-linux.override { ageBin = "${pkgs.age}/bin/age"; }) (agenix.packages.x86_64-linux.default.override { ageBin = "${pkgs.age}/bin/age"; })
]; ];
} }
``` ```

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1665732960, "lastModified": 1674641431,
"narHash": "sha256-WBZ+uSHKFyjvd0w4inbm0cNExYTn8lpYFcHEes8tmec=", "narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4428e23312933a196724da2df7ab78eb5e67a88e", "rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,38 +1,37 @@
{ {
description = "Secret management with age"; description = "Secret management with age";
inputs = { inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: outputs = {
let self,
nixpkgs,
}: let
agenix = system: nixpkgs.legacyPackages.${system}.callPackage ./pkgs/agenix.nix {}; agenix = system: nixpkgs.legacyPackages.${system}.callPackage ./pkgs/agenix.nix {};
in { in {
nixosModules.age = import ./modules/age.nix; nixosModules.age = import ./modules/age.nix;
nixosModule = self.nixosModules.age; nixosModules.default = self.nixosModules.age;
overlay = import ./overlay.nix; overlays.default = import ./overlay.nix;
packages."aarch64-linux".agenix = agenix "aarch64-linux"; packages.aarch64-linux.agenix = agenix "aarch64-linux";
defaultPackage."aarch64-linux" = self.packages."aarch64-linux".agenix; packages.aarch64-linux.default = self.packages.aarch64-linux.agenix;
packages."i686-linux".agenix = agenix "i686-linux"; packages.i686-linux.agenix = agenix "i686-linux";
defaultPackage."i686-linux" = self.packages."i686-linux".agenix; packages.i686-linux.default = self.packages.i686-linux.agenix;
packages."x86_64-darwin".agenix = agenix "x86_64-darwin"; packages.x86_64-darwin.agenix = agenix "x86_64-darwin";
defaultPackage."x86_64-darwin" = self.packages."x86_64-darwin".agenix; packages.x86_64-darwin.default = self.packages.x86_64-darwin.agenix;
packages."aarch64-darwin".agenix = agenix "aarch64-darwin"; packages.aarch64-darwin.agenix = agenix "aarch64-darwin";
defaultPackage."aarch64-darwin" = self.packages."aarch64-darwin".agenix; packages.aarch64-darwin.default = self.packages.aarch64-darwin.agenix;
packages."x86_64-linux".agenix = agenix "x86_64-linux"; packages.x86_64-linux.agenix = agenix "x86_64-linux";
defaultPackage."x86_64-linux" = self.packages."x86_64-linux".agenix; packages.x86_64-linux.default = self.packages.x86_64-linux.agenix;
checks."x86_64-linux".integration = import ./test/integration.nix { checks.x86_64-linux.integration = import ./test/integration.nix {
inherit nixpkgs; pkgs = nixpkgs.legacyPackages."x86_64-linux"; system = "x86_64-linux"; inherit nixpkgs;
pkgs = nixpkgs.legacyPackages.x86_64-linux;
system = "x86_64-linux";
}; };
}; };
} }