puter/flake.nix
2024-08-18 14:54:44 +02:00

71 lines
1.5 KiB
Nix

{
description = "My NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
hardware.url = "github:NixOS/nixos-hardware";
agenix.url = "github:ryantm/agenix";
};
outputs = {
self,
nixpkgs,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux"];
flake = {
nixosConfigurations = let
commonNixosSystem = name:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
attrName = name;
};
modules = [
inputs.agenix.nixosModules.default
./common
./hosts/${name}
({lib, ...}: {networking.hostName = lib.mkDefault name;})
];
};
in
nixpkgs.lib.genAttrs [
"abacus"
"vessel"
]
commonNixosSystem;
};
perSystem = {
inputs',
pkgs,
...
}: {
devShells.default = pkgs.mkShellNoCC {
packages = [inputs'.agenix.packages.agenix];
};
formatter = pkgs.alejandra;
packages.disk = pkgs.writeShellApplication {
name = "disk";
runtimeInputs = with pkgs; [
util-linux
jq
e2fsprogs
dosfstools
];
text = builtins.readFile ./disk.sh;
};
};
};
}