Compare commits

..

No commits in common. "f2e594275eb21b8759592e66b087e8e27c9461f1" and "e38491d9e3c3710786f4d15b0ec8ef3bf9e405ed" have entirely different histories.

5 changed files with 34 additions and 16 deletions

View File

@ -96,12 +96,17 @@
base = mkNixOsBase { base = mkNixOsBase {
inherit system pkgs; inherit system pkgs;
hostname = "catboy-cafe"; hostname = "catboy-cafe";
use-efi = true;
}; };
graphical = mkNixOsGraphical { graphical = mkNixOsGraphical {
inherit pkgs; inherit pkgs;
background = "pan-wire-3.png"; background = "pan-wire-3.png";
}; };
networking = mkNixOsNetworking { inherit pkgs; }; networking = mkNixOsNetworking {
inherit pkgs;
eth-interface = "enp0s31f6";
static-ip = "192.168.0.199";
};
coral = coral =
let let
@ -131,8 +136,7 @@
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [
./nixos/machines/catboy-cafe/hardware.nix ./nixos/hardware/catboy-cafe.nix
./nixos/machines/catboy-cafe/boot.nix
base base
graphical graphical
networking networking

View File

@ -1,5 +1,7 @@
{ {
system, pkgs, nixpkgs-flake, hostname, system, pkgs, nixpkgs-flake, hostname,
use-efi ? false, efi-mountpoint ? "/boot",
use-grub ? false, grub-device ? "/dev/sda",
}: }:
{ {
nixpkgs.config.allowUnfree = true; # lol nixpkgs.config.allowUnfree = true; # lol
@ -27,6 +29,17 @@
networking.hostName = hostname; networking.hostName = hostname;
boot.loader = if use-efi
then {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = efi-mountpoint;
} else if use-grub then {
grub.enable = true;
grub.devce = grub-device;
} else throw "Please use either use-efi or use-grub = true";
time.timeZone = "Europe/Stockholm"; time.timeZone = "Europe/Stockholm";
services.logind.lidSwitch = "ignore"; services.logind.lidSwitch = "ignore";

View File

@ -1,7 +0,0 @@
{...}: {
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = "/boot";
};
}

View File

@ -1,13 +1,21 @@
{ {
pkgs, pkgs,
use-iwd ? false, eth-interface ? "eth0",
static-ip ? false, # false, or IPv4 address as string
default-gateway ? "192.168.1.1",
}: }:
let static-ip-conf = if static-ip != false then {
networking.defaultGateway = { address = default-gateway; interface = eth-interface; };
networking.useDHCP = false;
networking.interfaces.${eth-interface}.ipv4.addresses = [ {
address = static-ip;
prefixLength = 24;
} ];
networking.networkmanager.unmanaged = [eth-interface];
} else {};
in pkgs.lib.attrsets.recursiveUpdate static-ip-conf
{ {
networking.networkmanager = { networking.networkmanager.enable = true;
enable = true;
dhcp = "dhcpcd";
wifi.backend = if use-iwd then "iwd" else "wpa_supplicant";
};
networking.nameservers = [ "8.8.8.8" ]; networking.nameservers = [ "8.8.8.8" ];
networking.resolvconf.enable = true; networking.resolvconf.enable = true;
networking.resolvconf.dnsExtensionMechanism = false; # edns seems to be fucky with this enabled networking.resolvconf.dnsExtensionMechanism = false; # edns seems to be fucky with this enabled