puter/flake.nix

72 lines
1.6 KiB
Nix
Raw Normal View History

2024-02-04 20:51:11 +00:00
{
description = "My NixOS configuration";
inputs = {
2024-03-08 21:46:46 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
2024-02-04 20:51:11 +00:00
hardware.url = "github:NixOS/nixos-hardware";
agenix.url = "github:ryantm/agenix";
2024-03-08 21:46:46 +00:00
myvim.url = "github:lukaswrz/myvim";
2024-02-04 20:51:11 +00:00
};
2024-03-08 21:46:46 +00:00
outputs = {
nixpkgs,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux"];
flake = let
commonNixosSystem = name: class:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
attrName = name;
};
modules = [
inputs.agenix.nixosModules.default
./common
./class/${class}
./hosts/${name}
({lib, ...}: {networking.hostName = lib.mkDefault name;})
];
};
in {
nixosConfigurations = builtins.mapAttrs commonNixosSystem {
glacier = "desktop";
flamingo = "desktop";
abacus = "server";
vessel = "server";
2024-02-26 18:27:27 +00:00
};
2024-02-04 20:51:11 +00:00
};
2024-03-08 21:46:46 +00:00
perSystem = {
inputs',
pkgs,
...
}: {
devShells.default = pkgs.mkShellNoCC {
packages = [inputs'.agenix.packages.agenix];
};
2024-02-04 20:51:11 +00:00
2024-03-08 21:46:46 +00:00
formatter = pkgs.alejandra;
2024-04-21 17:55:29 +00:00
packages.disk = pkgs.writeShellApplication {
name = "disk";
runtimeInputs = with pkgs; [
util-linux
jq
2024-07-01 22:06:05 +00:00
e2fsprogs
2024-04-21 17:55:29 +00:00
dosfstools
];
2024-04-21 17:56:53 +00:00
text = builtins.readFile ./disk.sh;
2024-04-21 17:55:29 +00:00
};
2024-02-04 20:51:11 +00:00
};
2024-03-08 21:46:46 +00:00
};
2024-02-04 20:51:11 +00:00
}