Flake parts with x64 and ARM support for devshell on both Linux and Mac
This commit is contained in:
107
flake.nix
107
flake.nix
@ -3,7 +3,6 @@
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-23.05";
|
||||
|
||||
agenix = {
|
||||
url = "github:ryantm/agenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@ -14,57 +13,67 @@
|
||||
url = github:aristanetworks/nix-serve-ng;
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, agenix, nix-serve-ng, ... }@attrs:
|
||||
let
|
||||
forEachSystem = nixpkgs.lib.genAttrs systems;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
shell = import ./shell.nix { inherit agenix pkgs; };
|
||||
system = "x86_64-linux";
|
||||
systems = [ system ];
|
||||
in
|
||||
{
|
||||
devShell.x86_64-linux = shell.dev;
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
||||
outputs = { self, agenix, nix-serve-ng, nixpkgs, parts, ... }@inputs:
|
||||
parts.lib.mkFlake { inherit inputs; } {
|
||||
systems =
|
||||
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
|
||||
packages = shell.packages;
|
||||
|
||||
nixosConfigurations = {
|
||||
eve-psr-nix0 = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = attrs;
|
||||
modules = [
|
||||
({ modulesPath, ... }: {
|
||||
|
||||
imports = [
|
||||
agenix.nixosModules.default
|
||||
nix-serve-ng.nixosModules.default
|
||||
|
||||
./application/containers.nix
|
||||
./application/nginx.nix
|
||||
|
||||
./monitoring/nginx.nix
|
||||
./monitoring/grafana.nix
|
||||
./monitoring/prometheus.nix
|
||||
./monitoring/loki.nix
|
||||
./monitoring/promtail.nix
|
||||
|
||||
./system/age.nix
|
||||
./system/dns.nix
|
||||
./system/hardware.nix
|
||||
./system/nix-conf.nix
|
||||
./system/security.nix
|
||||
./system/system.nix
|
||||
./system/virtualisation.nix
|
||||
|
||||
./user/users.nix
|
||||
];
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
})
|
||||
];
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }:
|
||||
let
|
||||
shell = import ./nix/shell.nix { inherit inputs' agenix pkgs; };
|
||||
in
|
||||
{
|
||||
devShells.default = shell.dev;
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
};
|
||||
|
||||
flake =
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
{
|
||||
inherit system;
|
||||
|
||||
nixosConfigurations = {
|
||||
eve-psr-nix0 = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = inputs;
|
||||
modules = [
|
||||
({ modulesPath, ... }: {
|
||||
|
||||
imports = [
|
||||
agenix.nixosModules.default
|
||||
nix-serve-ng.nixosModules.default
|
||||
|
||||
./nix/application/containers.nix
|
||||
./nix/application/nginx.nix
|
||||
|
||||
./nix/monitoring/nginx.nix
|
||||
./nix/monitoring/grafana.nix
|
||||
./nix/monitoring/prometheus.nix
|
||||
./nix/monitoring/loki.nix
|
||||
./nix/monitoring/promtail.nix
|
||||
|
||||
./nix/system/age.nix
|
||||
./nix/system/dns.nix
|
||||
./nix/system/hardware.nix
|
||||
./nix/system/nix-conf.nix
|
||||
./nix/system/security.nix
|
||||
./nix/system/system.nix
|
||||
./nix/system/virtualisation.nix
|
||||
|
||||
./nix/user/users.nix
|
||||
];
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user