Skip to content

Instantly share code, notes, and snippets.

@vamega
Created April 10, 2023 14:28
Show Gist options
  • Save vamega/75397159e13a522839561201d35dd306 to your computer and use it in GitHub Desktop.
Save vamega/75397159e13a522839561201d35dd306 to your computer and use it in GitHub Desktop.
My flake.nix showing inputs
{
description = "A very basic flake";
inputs = {
# normal nix stuff
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
templates.url = "github:NixOS/templates";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
};
darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
# Only needed to have ragenix follow it.
# Ragenix has an input on agenix, and agenix on darwin.
# Doesn't seem like there's a way to do this without having agenix
# at the top level.
# Upstream bug report: https://github.com/NixOS/nix/issues/5790
# Once that's fixed we should be able to remove agenix here
# and only have `ragenix.inputs.agenix.inputs.darwin.follows = "darwin"`
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "darwin";
};
ragenix = {
url = "github:yaxitech/ragenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.agenix.follows = "agenix";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-compat.follows = "flake-compat";
utils.follows = "flake-utils";
};
};
# Need this for caddy, like with agenix, can be removed
# once upstream issue is fixed
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs = {
nixpkgs.follows = "nixpkgs";
utils.follows = "flake-utils";
};
};
caddy = {
url = "github:vamega/caddy-nix-flake";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
gomod2nix.follows = "gomod2nix";
};
};
};
# what will be produced (i.e. the build)
outputs = {
self,
nixpkgs,
flake-utils,
...
} @ inputs:
{
hosts = import ./nix/hosts.nix;
deploy = import ./nix/deploy.nix inputs;
overlays = import ./nix/overlay.nix inputs;
darwinConfigurations = import ./nix/darwin.nix inputs;
nixosConfigurations = import ./nix/nixos.nix inputs;
isoConfigurations = import ./nix/isos.nix inputs;
}
// flake-utils.lib.eachSystem [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (localSystem: {
# checks = import ./nix/checks.nix inputs localSystem;
pkgs = import nixpkgs {
inherit localSystem;
overlays = [self.overlays.default];
config.allowUnfree = true;
config.allowAliases = true;
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment