]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/blackberry/pixiecore.nix
blackberry: pixiecore: enable
[julm/julm-nix.git] / hosts / blackberry / pixiecore.nix
1 { pkgs, lib, config, inputs, modulesPath, ... }:
2 let
3 hostConfig = config;
4 pixiecore = config.services.pixiecore;
5 pxeHostName = "nixos-pxe";
6 nixos = import (modulesPath + "/../lib/eval-config.nix") {
7 system = null;
8 specialArgs = {
9 # Required to avoid infinite recursion
10 # when `inputs` is used in `imports`.
11 inherit inputs;
12 };
13 modules = [
14 ({ config, pkgs, lib, ... }: {
15 imports = [
16 (modulesPath + "/installer/netboot/netboot-minimal.nix")
17 ../../nixos/default.nix
18 ];
19 config = {
20 nixpkgs.hostPlatform = {
21 system = "x86_64-linux";
22 config = "x86_64-unknown-linux-gnu";
23 };
24 ## Some useful options for setting up a new system
25 services.getty.autologinUser = lib.mkForce "root";
26 users.users.root.openssh.authorizedKeys.keys =
27 hostConfig.users.users.julm.openssh.authorizedKeys.keys;
28 console.keyMap = "de";
29 # hardware.video.hidpi.enable = true;
30
31 system.stateVersion = config.system.nixos.release;
32
33 _module.args = {
34 hostName = pxeHostName;
35 #hosts = nixosConfigurations;
36 #host = nixosConfigurations.${hostName}._module.args;
37 };
38 nixpkgs.overlays = import ../../nixpkgs/overlays.nix;
39 documentation = {
40 enable = false;
41 doc.enable = false;
42 };
43 };
44 })
45 inputs.home-manager.nixosModules.home-manager
46 {
47 home-manager.useGlobalPkgs = true;
48 home-manager.useUserPackages = true;
49 home-manager.verbose = true;
50 #home-manager.force = true;
51 home-manager.backupFileExtension = "old";
52 home-manager.extraSpecialArgs = {
53 hostName = pxeHostName;
54 inherit inputs;
55 };
56 }
57 ];
58 };
59 build = nixos.config.system.build;
60 in
61 {
62 services.pixiecore = {
63 enable = true;
64 mode = "boot";
65 debug = true;
66 dhcpNoBind = false;
67 port = 64172;
68 statusPort = 64172;
69 kernel = "${build.kernel}/bzImage";
70 initrd = "${build.netbootRamdisk}/initrd";
71 cmdLine = "init=${build.toplevel}/init loglevel=4";
72 extraArguments = [];
73 };
74 networking.nftables.ruleset = ''
75 table inet filter {
76 chain input-lan {
77 udp dport 67 counter accept comment "Pixiecore/DHCP"
78 udp dport 69 counter accept comment "Pixiecore/TFTP"
79 udp dport 4011 counter accept comment "Pixiecore/ProxyDHCP"
80 tcp dport ${toString pixiecore.port} counter accept comment "Pixiecore"
81 tcp dport ${toString pixiecore.statusPort} counter accept comment "Pixiecore/status"
82 }
83 chain output-lan {
84 }
85 }
86 '';
87 }