diff --git a/hosts/cube-hardware-configuration.nix b/hosts/cube-hardware-configuration.nix index 515a1db..bccb295 100644 --- a/hosts/cube-hardware-configuration.nix +++ b/hosts/cube-hardware-configuration.nix @@ -33,11 +33,6 @@ fsType = "xfs"; }; - fileSystems."/storage/muhh" = - { device = "/dev/disk/by-uuid/8b716713-359b-4bac-8951-a35405dccd4c"; - fsType = "xfs"; - }; - swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/cube.nix b/hosts/cube.nix index fb97b94..0533773 100644 --- a/hosts/cube.nix +++ b/hosts/cube.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { imports = @@ -113,11 +113,14 @@ wget ]; - fonts.packages = with pkgs; [ - atkinson-hyperlegible - iosevka - # secret-config.packages.x86_64-linux.default - ]; + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + atkinson-hyperlegible + nerd-fonts.iosevka + # secret-config.packages.x86_64-linux.default + ]; + }; programs = { @@ -144,12 +147,12 @@ # }; }; virtualisation = { - docker.enable = true; + docker.enable = false; libvirtd = { enable = true; }; podman = { - enable = false; + enable = true; dockerCompat = true; }; }; diff --git a/hosts/ze-hardware-configuration.nix b/hosts/ze-hardware-configuration.nix new file mode 100644 index 0000000..b1aacee --- /dev/null +++ b/hosts/ze-hardware-configuration.nix @@ -0,0 +1,9 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub.device = "/dev/sda"; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; + +} diff --git a/hosts/ze-networking.nix b/hosts/ze-networking.nix new file mode 100644 index 0000000..e4ff99e --- /dev/null +++ b/hosts/ze-networking.nix @@ -0,0 +1,33 @@ +{ lib, ... }: { + # This file was populated at runtime with the networking + # details gathered from the active system. + networking = { + nameservers = [ "8.8.8.8" + ]; + defaultGateway = "172.31.1.1"; + defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; + }; + dhcpcd.enable = false; + usePredictableInterfaceNames = lib.mkForce false; + interfaces = { + eth0 = { + ipv4.addresses = [ + { address="188.34.164.224"; prefixLength=32; } + ]; + ipv6.addresses = [ + { address="2a01:4f8:c013:2152::1"; prefixLength=64; } +{ address="fe80::9400:3ff:fe70:5f0d"; prefixLength=64; } + ]; + ipv4.routes = [ { address = "172.31.1.1"; prefixLength = 32; } ]; + ipv6.routes = [ { address = "fe80::1"; prefixLength = 128; } ]; + }; + + }; + }; + services.udev.extraRules = '' + ATTR{address}=="96:00:03:70:5f:0d", NAME="eth0" + + ''; +} diff --git a/hosts/ze.nix b/hosts/ze.nix new file mode 100644 index 0000000..2fc3b63 --- /dev/null +++ b/hosts/ze.nix @@ -0,0 +1,115 @@ +{ config, pkgs, inputs, ... }: + +{ + imports = + [ + ./ze-hardware-configuration.nix + ./ze-networking.nix + ./common.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = false; + boot.loader.grub = { + enable = true; + device = "nodev"; + efiSupport = true; + useOSProber = true; + }; + + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "ze"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + networking.hosts = { + # "178.63.121.197" = ["www.boell.de"]; + }; + + # Workaround for broken networkmanager/systemd thing + # https://github.com/NixOS/nixpkgs/issues/180175#issuecomment-1658731959 + systemd.services.NetworkManager-wait-online = { + serviceConfig = { + ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ]; + }; + }; + + security = { + sudo = { + wheelNeedsPassword = false; + }; + }; + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + settings.PubkeyAuthentication = true; + }; + services.tailscale = { + enable = true; + authKeyFile = config.sops.secrets.tailscale_auth_key.path; + }; + + sops.defaultSopsFile = ../secrets/secrets.yaml; + sops.age.keyFile = "/home/muhh/.config/sops/age/keys.txt"; + sops.secrets.tailscale_auth_key = {}; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.muhh = { + isNormalUser = true; + name = "muhh"; + description = "Markus Heurung"; + extraGroups = [ "audio" "docker" "libvirtd" "input" "networkmanager" "plugdev" "qemu-libvirtd" "video" "wheel"]; + shell = pkgs.fish; + linger = true; + }; + + nixpkgs.config = { + allowUnfree = true; + allowUnfreePredicate = pkg: true; + }; + + environment.shells = with pkgs; [ bash fish zsh ]; + environment.systemPackages = with pkgs; [ + git + home-manager + mosh + neovim + vim + wget + ]; + + programs = { + fish.enable = true; + }; + virtualisation = { + docker.enable = false; + libvirtd = { + enable = true; + }; + podman = { + enable = true; + dockerCompat = true; + }; + }; + + # Open ports in the firewall. + # FIREWALL IS ENABLED BY DEFAULT - muhh + # networking.firewall.allowedTCPPorts = [ 19132 ]; + # networking.firewall.allowedUDPPorts = [ 19132 ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/modules/gnome/default.nix b/modules/gnome/default.nix new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/modules/gnome/default.nix @@ -0,0 +1,2 @@ +{ +} diff --git a/modules/niri/default.nix b/modules/niri/default.nix new file mode 100644 index 0000000..fba5b1e --- /dev/null +++ b/modules/niri/default.nix @@ -0,0 +1,12 @@ +{ + programs.niri = { + enable = true; + + # settings = { + # environment = { + # "NIXOS_OZONE_WL" = "1"; + # "QT_QPA_PLATFORM" = "wayland"; + # }; + # }; + }; +} diff --git a/modules/sway/default.nix b/modules/sway/default.nix new file mode 100644 index 0000000..0adebb7 --- /dev/null +++ b/modules/sway/default.nix @@ -0,0 +1,196 @@ +{ + services = { + swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -fF"; } + ]; + timeouts = [ + { + timeout = 300; + command = "${pkgs.swaylock}/bin/swaylock -fF"; + } + { + timeout = 330; + command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; + resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; + } + ]; + }; + swaync = { + enable = true; + + }; + swayosd = { + enable = true; + display = "DP-1"; + }; + }; + swaylock.enable = true; + waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 24; + spacing = 3; + output = [ "DP-1" ]; + modules-left = [ + "sway/workspaces" + "sway/mode" + "sway/scratchpad" + "sway/window" + "custom/media" + ]; + modules-center = [ + "clock" + "idle_inhibitor" + ]; + modules-right = [ + "pulseaudio" + "backlight" + "network" + "tray" + "custom/notification" + "custom/power" + ]; + "sway/scratchpad" = { + format = "{icon} {count}"; + show-empty = false; + format-icons = ["" ""]; + tooltip = true; + tooltip-format = "{app}: {title}"; + }; + "backlight" = { + device = "ddcci6"; + format = "{percent}% {icon}"; + format-icons = [ "" "" "" "" "" "" ""]; + }; + "clock" = { + format = "{:%d. %B | %H:%M}"; + tooltip-format = "{:%Y %B}\n{calendar}"; + format-alt = "{: KW %OV, %A, %d. %B %Y | %H:%M}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + "actions" = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + "tray" = { + icon-size = 16; + spacing = 6; + }; + }; + }; + }; + wayland.windowManager = { + sway = { + enable = true; + extraConfig = '' + smart_gaps inverse_outer + font pango:Atkinson Hyperlegible 16 + ''; + config = { + bars = []; + window = { + commands = [ + { + command = "floating enable, sticky enable, resize set 20 ppt 40 ppt, border pixel 10"; + criteria = { + app_id = "^launcher"; + }; + } + ]; + }; + gaps = { + inner = 30; + vertical = 50; + horizontal = 400; + # smartGaps = true; + smartBorders = "on"; + }; + input = { + "type:keyboard" = { + xkb_layout = "eu"; + xkb_options = "compose:rwin"; + }; + "type:touchpad" = { + tap = "enabled"; + natural_scroll = "enabled"; + dwt = "enabled"; + accel_profile = "adaptive"; + pointer_accel = "0.5"; + }; + }; + keybindings = let + modifier = config.wayland.windowManager.sway.config.modifier; + in lib.mkOptionDefault { + "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "XF86MonBrightnessUp" = "exec brightnessctl set 10%+"; + "XF86MonBrightnessDown" = "exec brightnessctl set 10%-"; + "XF86AudioPlay" = "exec playerctl play-pause"; + "XF86AudioNext" = "exec playerctl next"; + "XF86AudioPrev" = "exec playerctl previous"; + "${modifier}+o" = "for_window [class=obsidian] scratchpad show"; + }; + menu = "kitty --app-id launcher -e sway-launcher-desktop"; + modifier = "Mod4"; + output = { + DP-1 = { + resolution = "3840x2160@30Hz"; + position = "0 1080"; + # background = "/home/muhh/Sync/Backgrounds/wald.jpg fill"; + scale = "1.5"; + }; + HDMI-A-1 = { + resolution = "1920x1080@60.000Hz"; + transform = "flipped"; + position = "3840 0"; + scale = "1.5"; + # background = "/home/muhh/Sync/Backgrounds/pfuetze.jpg fill"; + }; + }; + seat = { + "*" = { + hide_cursor = "5000"; + }; + }; + terminal = "kitty"; + # terminal = "ghostty"; + window = { + titlebar = false; + }; + workspaceOutputAssign = + map (x: { + workspace = x; + output = "DP-1"; + }) ["1" "2" "3" "4" "5" "6" "7"] + ++ map (x: { + workspace = x; + output = "HDMI-A-1"; + }) ["8" "9" "10"]; + }; + wrapperFeatures.gtk = true; + }; + }; +}