This commit is contained in:
commit
95a533c876
451 changed files with 18255 additions and 0 deletions
93
templates/nix-configs/hetzner-amd/pi4/flake.nix
Normal file
93
templates/nix-configs/hetzner-amd/pi4/flake.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-old-stable.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
|
||||
synix.url = "git+https://git.sid.ovh/sid/synix.git?ref=release-25.11";
|
||||
synix.imputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
|
||||
overlays = [ inputs.synix.overlays.default ];
|
||||
|
||||
mkNixosConfiguration =
|
||||
system: modules:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system modules;
|
||||
specialArgs = {
|
||||
inherit inputs outputs;
|
||||
lib =
|
||||
(import nixpkgs {
|
||||
inherit system overlays;
|
||||
}).lib;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
|
||||
nixosModules = import ./modules/nixos;
|
||||
|
||||
nixosConfigurations = {
|
||||
HOSTNAME = mkNixosConfiguration "x86_64-linux" [ ./hosts/HOSTNAME ];
|
||||
};
|
||||
|
||||
formatter = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
config = self.checks.${system}.pre-commit-check.config;
|
||||
inherit (config) package configFile;
|
||||
script = ''
|
||||
${pkgs.lib.getExe package} run --all-files --config ${configFile}
|
||||
'';
|
||||
in
|
||||
pkgs.writeShellScriptBin "pre-commit-run" script
|
||||
);
|
||||
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
flakePkgs = self.packages.${system};
|
||||
overlaidPkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.modifications ];
|
||||
};
|
||||
in
|
||||
{
|
||||
pre-commit-check = inputs.git-hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
nixfmt.enable = true;
|
||||
};
|
||||
};
|
||||
build-packages = pkgs.linkFarm "flake-packages-${system}" flakePkgs;
|
||||
build-overlays = pkgs.linkFarm "flake-overlays-${system}" {
|
||||
# package = overlaidPkgs.package;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue