nixos-config/flake.nix

140 lines
5.1 KiB
Nix
Raw Normal View History

2023-06-10 20:53:47 +02:00
{
inputs = {
2024-01-15 22:35:23 +01:00
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
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-15 22:35:23 +01:00
# inputs.nixpkgs.follows = "nixpkgs";
};
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";
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";
2023-10-01 23:00:36 +02:00
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-08-17 20:44:00 +02:00
lanzaboote.url = "github:nix-community/lanzaboote/v0.3.0";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
2023-09-21 22:41:13 +02:00
vscode-server.url = "github:nix-community/nixos-vscode-server";
vscode-server.inputs.nixpkgs.follows = "nixpkgs";
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
2024-01-15 22:35:23 +01:00
outputs = { self, nixpkgs, lanzaboote, disko, nixos-hardware, nix-ld, clan-core,
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-15 23:09:18 +01:00
#pkgsForSystem = system: (import nixpkgs {
# inherit system;
# config.allowUnfree = true;
# config.packageOverrides = lib.mkForce (pkgs: { tinc = pkgs.tinc_pre; });
# config.allowUnfreePredicate = pkg: lib.packageName pkg == "unrar";
# config.android_sdk.accept_license = true;
# config.oraclejdk.accept_license = true;
# overlays = [
# self.overlays.default
# inputs.nix-writers.overlays.default
# (import (inputs.stockholm.inputs.nix-writers + "/pkgs"))
# (this: super: {
# inherit (this.writers) writeDash writeDashBin;
# 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-01-15 22:35:23 +01:00
clanName = "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 [ "filepimp" "mrdavid" "x" "cake" "tsp" "wbob" "omo" "gum" "savarcast" ] (host: rec {
# 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";
#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
2023-10-01 23:00:36 +02:00
disko.nixosModules.disko
nix-ld.nixosModules.nix-ld
home-manager.nixosModules.default
lanzaboote.nixosModules.lanzaboote
2024-01-15 22:35:23 +01:00
inputs.stockholm.nixosModules.brockman
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
self.nixosModules.default
vscode-server.nixosModules.default
#self.nixosModules.krebs
(./machines + "/${host}/config.nix")
];
});
};
2023-06-10 20:53:47 +02:00
in {
2023-10-01 23:00:36 +02:00
inherit (clan) nixosConfigurations clanInternals;
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;
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
};
}