2023-01-25 17:53:02 +01:00
|
|
|
{
|
2023-04-08 17:33:59 +02:00
|
|
|
description = "patricks tolle nix config";
|
|
|
|
|
2023-01-28 02:50:14 +01:00
|
|
|
inputs = {
|
2023-09-05 21:00:29 +02:00
|
|
|
nixpkgs-wayland = {
|
|
|
|
url = "github:nix-community/nixpkgs-wayland";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-01-28 02:50:14 +01:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2023-04-08 17:33:59 +02:00
|
|
|
|
2023-12-22 01:45:26 +01:00
|
|
|
nixos-extra-modules = {
|
|
|
|
url = "github:oddlama/nixos-extra-modules";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-01-11 15:41:03 +01:00
|
|
|
microvm = {
|
|
|
|
url = "github:astro/microvm.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2023-12-22 01:45:26 +01:00
|
|
|
|
2023-05-22 14:25:00 +02:00
|
|
|
# to prevent multiple instances of systems
|
|
|
|
systems.url = "github:nix-systems/default";
|
|
|
|
|
2023-08-30 14:25:52 +02:00
|
|
|
disko = {
|
|
|
|
url = "github:nix-community/disko";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-08-30 16:38:30 +02:00
|
|
|
nixos-generators = {
|
|
|
|
url = "github:nix-community/nixos-generators";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-01-28 02:50:14 +01:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
# should use system nixpkgs instead of their own
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-04-08 17:33:59 +02:00
|
|
|
|
2023-01-28 02:50:14 +01:00
|
|
|
agenix = {
|
|
|
|
url = "github:ryantm/agenix";
|
2023-05-19 06:54:56 +02:00
|
|
|
inputs.home-manager.follows = "home-manager";
|
2023-01-28 02:50:14 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-01-28 18:41:31 +01:00
|
|
|
|
2023-05-02 15:08:36 +02:00
|
|
|
# Bin zu faul des zu kopieren
|
|
|
|
agenix-rekey = {
|
|
|
|
url = "github:oddlama/agenix-rekey";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-25 13:53:07 +02:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2023-05-02 15:08:36 +02:00
|
|
|
};
|
|
|
|
|
2023-05-22 14:25:00 +02:00
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
};
|
2023-02-08 21:12:32 +01:00
|
|
|
|
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2023-03-06 07:47:49 +01:00
|
|
|
|
2023-05-11 12:59:16 +02:00
|
|
|
templates.url = "git+https://git.lel.lol/patrick/nix-templates.git";
|
2023-05-02 15:08:36 +02:00
|
|
|
|
2023-05-26 17:30:37 +02:00
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
2023-05-02 15:08:36 +02:00
|
|
|
|
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
|
|
|
|
2023-05-22 14:25:00 +02:00
|
|
|
devshell = {
|
|
|
|
url = "github:numtide/devshell";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-09-18 13:04:44 +02:00
|
|
|
nix-index-database = {
|
|
|
|
url = "github:nix-community/nix-index-database";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-09-22 20:57:08 +02:00
|
|
|
|
2023-09-21 01:43:10 +02:00
|
|
|
lanzaboote = {
|
|
|
|
url = "github:nix-community/lanzaboote/v0.3.0";
|
|
|
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-09-22 20:57:08 +02:00
|
|
|
|
|
|
|
stylix.url = "github:danth/stylix";
|
2023-10-13 16:55:01 +02:00
|
|
|
|
2023-10-12 02:30:03 +02:00
|
|
|
wired-notify = {
|
|
|
|
url = "github:Toqozz/wired-notify";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "flake-utils";
|
|
|
|
};
|
2023-10-13 16:55:01 +02:00
|
|
|
|
|
|
|
spicetify-nix.url = "github:the-argus/spicetify-nix";
|
2023-10-25 00:21:15 +02:00
|
|
|
|
|
|
|
nixvim = {
|
|
|
|
url = "github:nix-community/nixvim";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-01-25 17:53:02 +01:00
|
|
|
};
|
|
|
|
|
2023-01-28 02:50:14 +01:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2023-01-28 18:41:31 +01:00
|
|
|
flake-utils,
|
2023-05-02 15:08:36 +02:00
|
|
|
agenix-rekey,
|
2023-08-30 16:38:30 +02:00
|
|
|
nixos-generators,
|
2023-09-20 14:19:13 +02:00
|
|
|
pre-commit-hooks,
|
2023-09-25 21:28:30 +02:00
|
|
|
devshell,
|
2023-10-12 02:30:03 +02:00
|
|
|
wired-notify,
|
2023-10-25 00:21:15 +02:00
|
|
|
nixvim,
|
2024-01-11 15:41:03 +01:00
|
|
|
nixos-extra-modules,
|
2023-01-28 02:50:14 +01:00
|
|
|
...
|
2023-08-30 16:38:30 +02:00
|
|
|
} @ inputs: let
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
stateVersion = "23.05";
|
|
|
|
in
|
2023-01-28 18:41:31 +01:00
|
|
|
{
|
2023-05-27 07:12:18 +02:00
|
|
|
secretsConfig = {
|
2023-11-07 20:07:45 +01:00
|
|
|
# This should be a link to one of the age public keys is './keys'
|
|
|
|
masterIdentities = ["/run/decrypt.key.pub"];
|
2023-05-02 15:08:36 +02:00
|
|
|
extraEncryptionPubkeys = [./secrets/recipients.txt];
|
2023-01-28 18:41:31 +01:00
|
|
|
};
|
2023-09-25 13:53:07 +02:00
|
|
|
agenix-rekey = agenix-rekey.configure {
|
|
|
|
userFlake = self;
|
|
|
|
inherit (self) nodes pkgs;
|
|
|
|
};
|
2023-02-08 21:12:32 +01:00
|
|
|
|
2023-08-30 16:38:30 +02:00
|
|
|
inherit stateVersion;
|
2023-09-20 14:37:21 +02:00
|
|
|
inherit
|
|
|
|
(import ./nix/hosts.nix inputs)
|
|
|
|
hosts
|
|
|
|
nixosConfigurations
|
2023-09-26 22:25:58 +02:00
|
|
|
minimalConfigurations
|
2023-12-18 02:11:24 +01:00
|
|
|
guestConfigurations
|
2023-09-20 14:37:21 +02:00
|
|
|
;
|
2023-12-18 02:11:24 +01:00
|
|
|
nodes = self.nixosConfigurations // self.guestConfigurations;
|
2023-08-30 16:38:30 +02:00
|
|
|
|
|
|
|
inherit
|
|
|
|
(lib.foldl' lib.recursiveUpdate {}
|
|
|
|
(lib.mapAttrsToList
|
|
|
|
(import ./nix/generate-installer-package.nix inputs)
|
2023-09-26 22:25:58 +02:00
|
|
|
self.minimalConfigurations))
|
2023-08-30 16:38:30 +02:00
|
|
|
packages
|
|
|
|
;
|
2023-05-02 15:08:36 +02:00
|
|
|
}
|
|
|
|
// flake-utils.lib.eachDefaultSystem (system: rec {
|
2024-01-15 02:13:46 +01:00
|
|
|
apps.setupHetznerStorageBoxes = import (nixos-extra-modules + "/apps/setup-hetzner-storage-boxes.nix") {
|
|
|
|
inherit pkgs;
|
|
|
|
nixosConfigurations = self.nodes;
|
|
|
|
decryptIdentity = builtins.head self.secretsConfig.masterIdentities;
|
|
|
|
};
|
2023-05-02 15:08:36 +02:00
|
|
|
pkgs = import nixpkgs {
|
2023-09-05 21:00:29 +02:00
|
|
|
overlays =
|
|
|
|
import ./lib inputs
|
2023-09-18 14:36:41 +02:00
|
|
|
++ import ./pkgs
|
2023-09-05 21:00:29 +02:00
|
|
|
++ [
|
2023-09-30 18:08:54 +02:00
|
|
|
# nixpkgs-wayland.overlay
|
2024-01-11 15:41:03 +01:00
|
|
|
nixos-extra-modules.overlays.default
|
2023-09-25 21:28:30 +02:00
|
|
|
devshell.overlays.default
|
|
|
|
agenix-rekey.overlays.default
|
2023-10-12 02:30:03 +02:00
|
|
|
wired-notify.overlays.default
|
2023-10-25 00:21:15 +02:00
|
|
|
nixvim.overlays.default
|
2023-09-05 21:00:29 +02:00
|
|
|
];
|
2023-05-02 15:08:36 +02:00
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
2023-02-08 19:52:31 +01:00
|
|
|
};
|
2023-08-30 16:38:30 +02:00
|
|
|
|
|
|
|
images.live-iso = nixos-generators.nixosGenerate {
|
|
|
|
inherit pkgs;
|
|
|
|
modules = [
|
|
|
|
./nix/installer-configuration.nix
|
2023-09-26 22:25:58 +02:00
|
|
|
./modules/config/ssh.nix
|
2023-08-30 16:38:30 +02:00
|
|
|
];
|
|
|
|
format =
|
|
|
|
{
|
|
|
|
x86_64-linux = "install-iso";
|
|
|
|
aarch64-linux = "sd-aarch64-installer";
|
|
|
|
}
|
|
|
|
.${system};
|
|
|
|
};
|
|
|
|
|
2023-09-20 14:19:13 +02:00
|
|
|
checks.pre-commit-check =
|
|
|
|
pre-commit-hooks.lib.${system}.run
|
|
|
|
{
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
hooks = {
|
|
|
|
alejandra.enable = true;
|
2023-12-22 01:30:46 +01:00
|
|
|
deadnix.enable = true;
|
2023-09-20 14:19:13 +02:00
|
|
|
statix.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2023-06-03 11:05:10 +02:00
|
|
|
devShell = import ./nix/devshell.nix inputs system;
|
2023-05-02 15:08:36 +02:00
|
|
|
formatter = pkgs.alejandra;
|
2023-01-28 18:41:31 +01:00
|
|
|
});
|
2023-01-25 17:53:02 +01:00
|
|
|
}
|