nixos-config/flake.nix

108 lines
3.6 KiB
Nix
Raw Normal View History

2023-06-10 20:53:47 +02:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.inputs.nixpkgs-stable.follows = "";
nixos-hardware.url = "github:NixOS/nixos-hardware";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
nix-ld.url = "github:Mic92/nix-ld";
nix-ld.inputs.nixpkgs.follows = "nixpkgs";
stockholm.url = "git+https://cgit.euer.krebsco.de/stockholm";
#stockholm.url = "path:///home/makefu/stockholm-flakes";
2023-06-10 20:53:47 +02:00
stockholm.inputs.nixpkgs.follows = "nixpkgs";
2023-07-02 16:18:47 +02:00
stockholm.inputs.nix-writers.follows = "nix-writers";
2023-06-10 20:53:47 +02:00
2023-07-02 16:18:47 +02:00
nix-writers.url = "git+https://cgit.krebsco.de/nix-writers";
2023-06-30 10:00:32 +02:00
nix-writers.inputs.nixpkgs.follows = "nixpkgs";
2023-07-13 01:57:32 +02:00
# bam inputs
ha-ara-menu.url = "github:kalauerclub/ha_ara_menu";
ha-ara-menu.inputs.nixpkgs.follows = "nixpkgs";
inventory4ce.url = "github:kalauerclub/inventory4ce";
inventory4ce.inputs.nixpkgs.follows = "nixpkgs";
2023-06-10 20:53:47 +02:00
};
description = "Flakes of makefu";
2023-06-30 10:00:32 +02:00
outputs = { self, nixpkgs, disko, nixos-hardware, nix-ld, sops-nix, stockholm, home-manager, nix-writers, ...}@inputs: let
inherit (nixpkgs) lib;
2023-06-10 20:53:47 +02:00
in {
nixosModules =
builtins.listToAttrs
2023-06-10 20:53:47 +02:00
(map
(name: {name = lib.removeSuffix ".nix" name; value = import (./3modules + "/${name}");})
(lib.filter
(name: !lib.hasPrefix "." name)
2023-06-10 20:53:47 +02:00
(lib.attrNames (builtins.readDir ./3modules))));
overlays.default = import ./5pkgs/default.nix;
2023-07-13 01:57:32 +02:00
nixosConfigurations = lib.genAttrs [ "mrdavid" "x" "cake" "tsp" "wbob" "omo" "gum"] (host: nixpkgs.lib.nixosSystem rec {
2023-07-05 15:27:44 +02:00
# TODO inject the system somewhere else
system = if host == "cake" then "aarch64-linux" else "x86_64-linux";
2023-06-10 20:53:47 +02:00
specialArgs = {
2023-07-13 01:57:32 +02:00
inherit (inputs) nixos-hardware self stockholm ha-ara-menu nixpkgs;
2023-06-10 20:53:47 +02:00
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
2023-06-30 10:00:32 +02:00
overlays = [
2023-07-13 01:57:32 +02:00
(self: super: {
inherit (self.writers) writeDash writeDashBin;
stockholm.lib = stockholm.lib;
ha-ara-menu = inputs.ha-ara-menu.packages.${system}.default;
inventory4ce = inputs.inventory4ce.packages.${system}.default;
})
2023-06-30 10:00:32 +02:00
self.overlays.default
stockholm.overlays.default
2023-07-13 01:57:32 +02:00
inputs.nix-writers.overlays.default
2023-06-30 10:00:32 +02:00
] ;
2023-06-10 20:53:47 +02:00
};
};
modules = [
disko.nixosModules.disko
nix-ld.nixosModules.nix-ld
sops-nix.nixosModules.sops
home-manager.nixosModules.default
2023-06-10 20:53:47 +02:00
2023-07-02 16:18:47 +02:00
stockholm.nixosModules.brockman
stockholm.nixosModules.exim-retiolum
stockholm.nixosModules.exim
2023-06-10 20:53:47 +02:00
stockholm.nixosModules.krebs
stockholm.nixosModules.hosts
stockholm.nixosModules.users
stockholm.nixosModules.build
stockholm.nixosModules.dns
stockholm.nixosModules.kartei
stockholm.nixosModules.sitemap
stockholm.nixosModules.fetchWallpaper
stockholm.nixosModules.git
2023-06-30 10:00:32 +02:00
stockholm.nixosModules.tinc
stockholm.nixosModules.systemd
2023-07-02 16:18:47 +02:00
stockholm.nixosModules.setuid
stockholm.nixosModules.urlwatch
2023-06-10 20:53:47 +02:00
self.nixosModules.default
2023-06-10 20:53:47 +02:00
#self.nixosModules.krebs
(./1systems + "/${host}/config.nix")
2023-06-10 20:53:47 +02:00
];
});
2023-06-10 20:53:47 +02:00
};
}