infrastructure/flake.nix

107 lines
3.3 KiB
Nix
Raw Normal View History

2022-12-19 22:35:54 +00:00
{
2022-12-20 10:33:21 +00:00
description = "Laureηt's infrastructure";
2022-12-19 22:35:54 +00:00
2023-11-29 14:40:36 +00:00
# TODO: setup le formatter comme sioodmy
# TODO: rekey les secrets + changer la key de hydrogen
# TODO: luks encrypt hydrogen (dropbear ?)
# TODO: dégager btfrs de neodymium, ext4 ftw
# TODO: setup disko sur neodymium
2022-12-19 22:35:54 +00:00
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
# url = "git+file:///home/laurent/Documents/nixpkgs?shallow=1";
};
2023-11-29 14:40:36 +00:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
2023-04-23 13:38:34 +00:00
};
agenix = {
url = "github:yaxitech/ragenix";
2023-08-27 13:59:18 +00:00
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts.url = "github:hercules-ci/flake-parts";
2023-11-29 14:40:36 +00:00
lanzaboote.url = "github:nix-community/lanzaboote";
hyprland.url = "github:hyprwm/Hyprland";
nixos-hardware.url = "github:nixos/nixos-hardware";
2023-11-29 14:40:36 +00:00
disko.url = "github:nix-community/disko";
nixos-anywhere.url = "github:nix-community/nixos-anywhere";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
2023-11-26 22:10:04 +00:00
resume.url = "git+https://git.fainsin.bzh/Laurent/resume";
projet-intelligence-artificielle-multimedia.url = "git+https://git.fainsin.bzh/ENSEEIHT/projet-intelligence-artificielle-multimedia";
projet-audionumerique.url = "git+https://git.fainsin.bzh/ENSEEIHT/projet-audionumerique";
projet-oral-japonais.url = "git+https://git.fainsin.bzh/ENSEEIHT/projet-oral-japonais";
projet-oral-anglais.url = "git+https://git.fainsin.bzh/ENSEEIHT/projet-oral-anglais";
TP-calcul-parallele.url = "git+https://git.fainsin.bzh/ENSEEIHT/TP-calcul-parallele";
2022-12-19 22:35:54 +00:00
};
2022-12-21 19:29:15 +00:00
2023-08-12 18:23:45 +00:00
nixConfig = {
extra-substituters = [
"https://nix-community.cachix.org"
# "https://pre-commit-hooks.cachix.org"
"https://hyprland.cachix.org"
];
2023-08-12 18:23:45 +00:00
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# "pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
2023-08-12 18:23:45 +00:00
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
outputs = {
agenix,
flake-parts,
pre-commit-hooks,
treefmt-nix,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux"];
imports = [
flake-parts.flakeModules.easyOverlay
pre-commit-hooks.flakeModule
treefmt-nix.flakeModule
];
perSystem = {
pkgs,
system,
...
}: rec {
formatter = pkgs.alejandra;
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
};
};
pre-commit = {
settings.excludes = ["flake.lock"];
settings.hooks = {
alejandra.enable = true;
deadnix.enable = true;
};
};
2022-12-19 22:35:54 +00:00
2023-03-19 14:13:24 +00:00
devShells.default = pkgs.mkShell {
packages = [
formatter # defined above
pkgs.git # version control
pkgs.update-nix-fetchgit # auto update fetchs
agenix.packages.${system}.ragenix # secrets
pkgs.sbctl # secure boot
2023-03-19 14:13:24 +00:00
];
};
};
2022-12-19 22:35:54 +00:00
flake.nixosConfigurations = import ./hosts {inherit inputs;};
};
2022-12-19 22:35:54 +00:00
}