nixos-config/flake.nix

186 lines
6.9 KiB
Nix
Raw Permalink Normal View History

2023-06-10 20:53:47 +02:00
{
inputs = {
2024-09-07 00:24:15 +02:00
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
2024-01-15 22:35:23 +01:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
brockman = {
url = "github:kmein/brockman";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-01 23:00:36 +02:00
clan-core = {
url = "git+https://git.clan.lol/clan/clan-core";
# Don't do this if your machines are on nixpkgs stable.
2024-01-21 20:31:48 +01:00
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
2023-06-10 20:53:47 +02:00
nixos-hardware.url = "github:NixOS/nixos-hardware";
2024-01-15 22:35:23 +01:00
#home-manager.url = "github:nix-community/home-manager/release-23.11";
2023-06-10 20:53:47 +02:00
home-manager.url = "github:nix-community/home-manager";
home-manager.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/makefu/stockholm.git";
#stockholm.url = "path:///home/makefu/r/stockholm";
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
brother_ql_web.url = "github:makefu/brother_ql_web";
brother_ql_web.inputs.nixpkgs.follows = "nixpkgs";
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";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-06-30 10:00:32 +02:00
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";
ha-ara-menu.inputs.poetry2nix.follows = "poetry2nix";
2023-07-13 01:57:32 +02:00
inventory4ce.url = "github:kalauerclub/inventory4ce";
inventory4ce.inputs.nixpkgs.follows = "nixpkgs";
inventory4ce.inputs.poetry2nix.follows = "poetry2nix";
2023-07-13 01:57:32 +02:00
2024-12-22 14:24:48 +01:00
lanzaboote.url = "github:nix-community/lanzaboote";
2023-08-17 20:44:00 +02:00
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.inputs.flake-parts.follows = "flake-parts";
2024-05-30 18:14:54 +02:00
#lanzaboote.inputs.pre-commit-hooks-nix.follows = "";
2023-08-17 20:44:00 +02:00
2023-09-21 22:41:13 +02:00
vscode-server.url = "github:nix-community/nixos-vscode-server";
vscode-server.inputs.nixpkgs.follows = "nixpkgs";
2024-05-30 18:14:54 +02:00
audio-scripts.url = "github:makefu/audio-scripts";
audio-scripts.inputs.nixpkgs.follows = "nixpkgs";
nether = {
url = "github:lassulus/nether";
inputs.nixpkgs.follows = "nixpkgs";
inputs.clan-core.follows = "clan-core";
};
2024-05-31 23:58:11 +02:00
buildbot-nix.url = "github:Mic92/buildbot-nix";
buildbot-nix.inputs.nixpkgs.follows = "nixpkgs";
buildbot-nix.inputs.flake-parts.follows = "flake-parts";
# buildbot-nix.inputs.treefmt-nix.follows = "treefmt-nix";
2023-06-10 20:53:47 +02:00
};
2023-09-21 22:41:13 +02:00
description = "Flake of makefu";
2023-06-10 20:53:47 +02:00
outputs = { self, nixpkgs, lanzaboote, nixos-hardware, nix-ld, clan-core,
2024-01-15 22:35:23 +01:00
home-manager, nix-writers, vscode-server, ...}@inputs:
2023-10-01 23:00:36 +02:00
let
2024-01-15 22:35:23 +01:00
inherit (nixpkgs) lib pkgs;
2024-01-21 20:31:48 +01:00
pkgsForSystem = system: (import nixpkgs {
inherit system;
config = {
allowUnfree = true;
packageOverrides = lib.mkForce (pkgs: { tinc = pkgs.tinc_pre; });
allowUnfreePredicate = pkg: lib.packageName pkg == "unrar";
android_sdk.accept_license = true;
oraclejdk.accept_license = true;
};
overlays = [
self.overlays.default
inputs.nix-writers.overlays.default
(import (inputs.stockholm.inputs.nix-writers + "/pkgs"))
(self: super: {
inherit (self.writers) writeDash writeDashBin;
2024-01-21 20:31:48 +01:00
stockholm.lib = inputs.stockholm.lib;
ha-ara-menu = inputs.ha-ara-menu.packages.${system}.default;
inventory4ce = inputs.inventory4ce.packages.${system}.default;
})
inputs.stockholm.overlays.default
];
});
2024-01-15 22:35:23 +01:00
#pkgsForSystem = system: nixpkgs.legacyPackages.${system};
2023-10-01 23:00:36 +02:00
clan = clan-core.lib.buildClan {
2024-09-07 00:24:15 +02:00
meta.name = "makefu";
2023-10-01 23:00:36 +02:00
directory = self;
specialArgs = {
inherit (inputs) nixos-hardware self stockholm nixpkgs;
2024-01-15 22:35:23 +01:00
inherit inputs;
2023-10-01 23:00:36 +02:00
};
machines = lib.genAttrs [ "liveiso" "filepimp" "x" "cake" "tsp" "wbob" "omo" "gum" "savarcast" ] (host: rec {
2023-10-01 23:00:36 +02:00
# TODO inject the system somewhere else
2024-01-15 23:09:18 +01:00
nixpkgs.hostPlatform = if host == "cake" then "aarch64-linux" else "x86_64-linux";
2024-01-21 20:31:48 +01:00
# nixpkgs.pkgs = if host == "cake" then pkgsForSystem "aarch64-linux" else pkgsForSystem "x86_64-linux";
2023-10-01 23:00:36 +02:00
imports = [
2024-01-15 23:09:18 +01:00
./2configs/nixpkgs-config.nix
clan-core.inputs.disko.nixosModules.disko
2023-10-01 23:00:36 +02:00
nix-ld.nixosModules.nix-ld
home-manager.nixosModules.default
lanzaboote.nixosModules.lanzaboote
#inputs.stockholm.nixosModules.brockman
inputs.brockman.nixosModule
2024-01-15 22:35:23 +01:00
inputs.stockholm.nixosModules.exim-retiolum
inputs.stockholm.nixosModules.exim
inputs.stockholm.nixosModules.krebs
inputs.stockholm.nixosModules.hosts
inputs.stockholm.nixosModules.users
inputs.stockholm.nixosModules.build
inputs.stockholm.nixosModules.dns
inputs.stockholm.nixosModules.kartei
inputs.stockholm.nixosModules.sitemap
inputs.stockholm.nixosModules.git
inputs.stockholm.nixosModules.tinc
inputs.stockholm.nixosModules.systemd
inputs.stockholm.nixosModules.setuid
inputs.stockholm.nixosModules.urlwatch
2023-10-01 23:00:36 +02:00
inputs.nether.nixosModules.hosts
2023-10-01 23:00:36 +02:00
self.nixosModules.default
vscode-server.nixosModules.default
#self.nixosModules.krebs
(./machines + "/${host}/config.nix")
2024-05-31 23:58:11 +02:00
inputs.buildbot-nix.nixosModules.buildbot-master
inputs.buildbot-nix.nixosModules.buildbot-worker
2023-10-01 23:00:36 +02:00
];
});
};
2023-06-10 20:53:47 +02:00
in {
2023-10-01 23:00:36 +02:00
inherit (clan) nixosConfigurations clanInternals;
2024-05-31 23:58:11 +02:00
checks = let
a64 = "aarch64-linux";
x86 = "x86_64-linux";
in {
"${a64}" = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${a64}-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == a64)) self.nixosConfigurations);
"${x86}" = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${x86}-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == x86)) self.nixosConfigurations);
};
2023-06-10 20:53:47 +02:00
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;
packages.x86_64-linux.liveiso = self.nixosConfigurations.liveiso.config.system.build.isoImage;
packages.x86_64-linux.default = self.packages.x86_64-linux.liveiso;
2023-10-01 23:00:36 +02:00
devShells.x86_64-linux.default = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.mkShell {
packages = [
2024-01-15 22:35:23 +01:00
inputs.clan-core.packages.x86_64-linux.clan-cli
2023-10-01 23:00:36 +02:00
pkgs.age
];
};
2023-06-10 20:53:47 +02:00
};
}