From a7ff1915613ad5e6118b7e3e92c784b8bb3b0a60 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Thu, 23 May 2024 11:38:43 +0200 Subject: [PATCH 1/2] added laptop --- hosts/default.nix | 19 +++- hosts/vali/hermit/configuration.nix | 87 ++++++++++++++++ hosts/vali/{mars => hermit}/default.nix | 0 .../hardware-configuration.nix | 0 hosts/vali/hermit/profile.nix | 9 ++ hosts/vali/hermit/programs.nix | 99 +++++++++++++++++++ .../{mars => temperance}/configuration.nix | 2 +- hosts/vali/temperance/default.nix | 8 ++ .../temperance/hardware-configuration.nix | 42 ++++++++ hosts/vali/{mars => temperance}/profile.nix | 0 hosts/vali/{mars => temperance}/programs.nix | 0 modules/wms/wayland/hypr/land.nix | 1 + 12 files changed, 263 insertions(+), 4 deletions(-) create mode 100644 hosts/vali/hermit/configuration.nix rename hosts/vali/{mars => hermit}/default.nix (100%) rename hosts/vali/{mars => hermit}/hardware-configuration.nix (100%) create mode 100644 hosts/vali/hermit/profile.nix create mode 100644 hosts/vali/hermit/programs.nix rename hosts/vali/{mars => temperance}/configuration.nix (98%) create mode 100644 hosts/vali/temperance/default.nix create mode 100644 hosts/vali/temperance/hardware-configuration.nix rename hosts/vali/{mars => temperance}/profile.nix (100%) rename hosts/vali/{mars => temperance}/programs.nix (100%) diff --git a/hosts/default.nix b/hosts/default.nix index dd54eae..af0610a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -2,16 +2,29 @@ inherit (inputs) self; inherit (self) lib; in { - mars = lib.nixosSystem { + temperance = lib.nixosSystem { system = "x86_64-linux"; specialArgs = {inherit lib inputs self;}; modules = [ - inputs.stylix.nixosModules.stylix - ./vali/mars + ./vali/temperance ../modules inputs.home-manager.nixosModules.home-manager inputs.agenix.nixosModules.default + inputs.stylix.nixosModules.stylix inputs.nixvim.nixosModules.nixvim ]; }; + hermit = lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit lib inputs self;}; + modules = [ + ./vali/hermit + ../modules + inputs.home-manager.nixosModules.home-manager + inputs.agenix.nixosModules.default + inputs.stylix.nixosModules.stylix + inputs.nixvim.nixosModules.nixvim + ]; + }; + } diff --git a/hosts/vali/hermit/configuration.nix b/hosts/vali/hermit/configuration.nix new file mode 100644 index 0000000..8198b52 --- /dev/null +++ b/hosts/vali/hermit/configuration.nix @@ -0,0 +1,87 @@ +{pkgs, ...}: { + # allow unfree packages + nixpkgs.config.allowUnfree = true; + # Time Zone + time.timeZone = "Europe/Zurich"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console.keyMap = "de"; + nix = { + settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + # enable flakes + experimental-features = ["nix-command" "flakes"]; + # reduce file size used & automatic garbage collector + auto-optimise-store = true; + }; + }; + security.sudo.package = pkgs.sudo.override {withInsults = true;}; + security.polkit.enable = true; + programs.kdeconnect.enable = true; + programs.dconf.enable = true; + # boot.kernelModules = [ "v4l2loopback" ]; + boot.kernelPackages = pkgs.linuxPackages_zen; + # boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; + # services.picom.enable = true; + services.emacs.enable = true; + modules = { + other = { + system = { + hostname = "hermit"; + username = "vali"; + gitPath = "/home/vali/repos/nichts"; + }; + home-manager = { + enable = true; + enableDirenv = true; + }; + }; + wms = { + wayland = { + enable = true; + hyprland.enable = true; + }; + }; + programs = { + vesktop.enable = true; + ssh.enable = true; + btop.enable = true; + mpv.enable = true; + kitty.enable = true; + newsboat.enable = true; + foot.enable = true; + fish.enable = true; + stylix.enable = true; + nh.enable = true; + waybar.enable = true; + spicetify.enable = true; + schizofox.enable = true; + anyrun.enable = true; + }; + editors = { + emacs = { + enable = false; + doom.enable = false; + }; + helix.enable = false; + kakoune.enable = false; + nixvim.enable = true; + }; + services = { + pipewire.enable = true; + dunst.enable = true; + }; + themes = { + gtk = {enable = true;}; + qt = { + enable = false; + package = pkgs.kde-gruvbox; + name = "Gruvbox-Dark"; + }; + }; + }; + system.stateVersion = "23.11"; +} diff --git a/hosts/vali/mars/default.nix b/hosts/vali/hermit/default.nix similarity index 100% rename from hosts/vali/mars/default.nix rename to hosts/vali/hermit/default.nix diff --git a/hosts/vali/mars/hardware-configuration.nix b/hosts/vali/hermit/hardware-configuration.nix similarity index 100% rename from hosts/vali/mars/hardware-configuration.nix rename to hosts/vali/hermit/hardware-configuration.nix diff --git a/hosts/vali/hermit/profile.nix b/hosts/vali/hermit/profile.nix new file mode 100644 index 0000000..9b0e5da --- /dev/null +++ b/hosts/vali/hermit/profile.nix @@ -0,0 +1,9 @@ +_: { + imports = [ + ../../../options/boot/grub-boot.nix + ../../../options/desktop/fonts.nix + ../../../options/common/networking.nix + ../../../options/desktop/monitors.nix + ../../../overlay.nix + ]; +} diff --git a/hosts/vali/hermit/programs.nix b/hosts/vali/hermit/programs.nix new file mode 100644 index 0000000..43842f4 --- /dev/null +++ b/hosts/vali/hermit/programs.nix @@ -0,0 +1,99 @@ +{ + inputs, + pkgs, + ... +}: let + fenix = inputs.fenix.packages.${pkgs.system}; + nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; +in { + environment.systemPackages = with pkgs; [ + alejandra + alsa-utils + asciinema + bibata-cursors + blanket + cmake + difftastic + dig + easyeffects + element-desktop + evince + eza + fastfetch + feh + ffmpeg-full + fftw + grimblast + gcc + gdb + gnumake + grc + grimblast + git + helvum + httpie + imagemagick + img2pdf + imv + keepassxc + lazygit + libtool + links2 + mars-mips + gnome.nautilus + ncmpcpp + neofetch + neovim + networkmanagerapplet + nextcloud-client + nicotine-plus + nil + nitch + nixfmt + nixpkgs-wayland.swww + nmap + notesnook + obsidian + onlyoffice-bin + pamixer + pavucontrol + pdfarranger + pfetch + pidgin + playerctl + polkit + python3 + qbittorrent + ripgrep + rustdesk + scc + scummvm + sherlock + signal-desktop-beta + smartmontools + strawberry + telegram-desktop + texliveFull + tldr + thunderbird + tor-browser-bundle-bin + trash-cli + tree + typst + unzip + util-linux + v4l-utils + ventoy-full + vlc + weechat + wget + wireguard-tools + wl-clipboard + xdg-utils + xournalpp + yt-dlp + zapzap + zip + zoxide + ]; +} diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/temperance/configuration.nix similarity index 98% rename from hosts/vali/mars/configuration.nix rename to hosts/vali/temperance/configuration.nix index ae258f0..bd445e1 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/temperance/configuration.nix @@ -30,7 +30,7 @@ modules = { other = { system = { - hostname = "mars"; + hostname = "temperance"; username = "vali"; gitPath = "/home/vali/repos/nichts"; }; diff --git a/hosts/vali/temperance/default.nix b/hosts/vali/temperance/default.nix new file mode 100644 index 0000000..1e3d69e --- /dev/null +++ b/hosts/vali/temperance/default.nix @@ -0,0 +1,8 @@ +_: { + imports = [ + ./configuration.nix + ./programs.nix + ./hardware-configuration.nix + ./profile.nix + ]; +} diff --git a/hosts/vali/temperance/hardware-configuration.nix b/hosts/vali/temperance/hardware-configuration.nix new file mode 100644 index 0000000..85ad7f6 --- /dev/null +++ b/hosts/vali/temperance/hardware-configuration.nix @@ -0,0 +1,42 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/0423508a-6906-4872-baeb-2b1e6bd017a4"; + fsType = "ext4"; + options = ["noatime" "nodiratime" "discard"]; + }; + + boot.initrd.luks.devices."luks-c03fc486-bdd7-46bf-ac2f-1a55fe1abd6f".device = "/dev/disk/by-uuid/c03fc486-bdd7-46bf-ac2f-1a55fe1abd6f"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D299-5174"; + fsType = "vfat"; + }; + + swapDevices = [ + # { device = "/dev/disk/by-uuid/bc68b3b5-1b58-4d8c-be8d-b06bbc4b6da7"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/vali/mars/profile.nix b/hosts/vali/temperance/profile.nix similarity index 100% rename from hosts/vali/mars/profile.nix rename to hosts/vali/temperance/profile.nix diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/temperance/programs.nix similarity index 100% rename from hosts/vali/mars/programs.nix rename to hosts/vali/temperance/programs.nix diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index f6f5944..ca3ec90 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -52,6 +52,7 @@ in { # Monitor config monitor = [ + "eDP-1,1920x1080,0x0,1" "DP-2,1920x1080,0x0,1" "HDMI-A-2,1920x1080,1920x0,1" "HDMI-A-1,1920x1080,3840x0,1" From 82b51384139be85a979f64ecc1d14ff2226409aa Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Thu, 23 May 2024 13:24:16 +0200 Subject: [PATCH 2/2] working laptop --- hosts/vali/hermit/hardware-configuration.nix | 52 ++++----- hosts/vali/hermit/profile.nix | 1 + modules/gui/default.nix | 1 - modules/wms/wayland/hypr/land.nix | 116 +++++++++---------- 4 files changed, 80 insertions(+), 90 deletions(-) diff --git a/hosts/vali/hermit/hardware-configuration.nix b/hosts/vali/hermit/hardware-configuration.nix index 85ad7f6..099c5a3 100644 --- a/hosts/vali/hermit/hardware-configuration.nix +++ b/hosts/vali/hermit/hardware-configuration.nix @@ -1,42 +1,40 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + { - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/0423508a-6906-4872-baeb-2b1e6bd017a4"; - fsType = "ext4"; - options = ["noatime" "nodiratime" "discard"]; - }; + fileSystems."/" = + { device = "/dev/disk/by-uuid/3d023930-3656-44bb-a737-b0e08a6bbd3e"; + fsType = "ext4"; + }; - boot.initrd.luks.devices."luks-c03fc486-bdd7-46bf-ac2f-1a55fe1abd6f".device = "/dev/disk/by-uuid/c03fc486-bdd7-46bf-ac2f-1a55fe1abd6f"; + boot.initrd.luks.devices."luks-10037600-c781-4ebc-9ceb-7e0367b1ed24".device = "/dev/disk/by-uuid/10037600-c781-4ebc-9ceb-7e0367b1ed24"; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D299-5174"; - fsType = "vfat"; - }; + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3A39-FAF1"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; - swapDevices = [ - # { device = "/dev/disk/by-uuid/bc68b3b5-1b58-4d8c-be8d-b06bbc4b6da7"; } - ]; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp59s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/vali/hermit/profile.nix b/hosts/vali/hermit/profile.nix index 9b0e5da..6ab615d 100644 --- a/hosts/vali/hermit/profile.nix +++ b/hosts/vali/hermit/profile.nix @@ -3,6 +3,7 @@ _: { ../../../options/boot/grub-boot.nix ../../../options/desktop/fonts.nix ../../../options/common/networking.nix + ../../../options/common/gpu/nvidia.nix ../../../options/desktop/monitors.nix ../../../overlay.nix ]; diff --git a/modules/gui/default.nix b/modules/gui/default.nix index 4ccc5fd..a8d69de 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -12,7 +12,6 @@ _: { ./anyrun ./rofi.nix ./kitty.nix - ./vivado.nix ./steam.nix ./waybar.nix ./schizofox.nix diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index ca3ec90..5b640d8 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -37,7 +37,6 @@ in { enable = true; package = hyprland; # Split-monitor-workspaces provides awesome-like workspace behaviour - plugins = [split-monitor-workspaces]; # Xwayland for X applications xwayland.enable = true; # No idea why I set this @@ -53,46 +52,46 @@ in { # Monitor config monitor = [ "eDP-1,1920x1080,0x0,1" - "DP-2,1920x1080,0x0,1" - "HDMI-A-2,1920x1080,1920x0,1" - "HDMI-A-1,1920x1080,3840x0,1" + # "DP-2,1920x1080,0x0,1" + # "HDMI-A-2,1920x1080,1920x0,1" + # "HDMI-A-1,1920x1080,3840x0,1" # Had the shadow monitor bug, so had to disable all unknown monitors. # "Unknown-1,disable" ]; # Workspace config workspace = [ - "1, monitor:HDMI-A-1, default:true" - "2, monitor:HDMI-A-1" - "3, monitor:HDMI-A-1" - "4, monitor:HDMI-A-1" - "5, monitor:HDMI-A-1" - "6, monitor:HDMI-A-1" - "7, monitor:HDMI-A-1" - "8, monitor:HDMI-A-1" - "9, monitor:HDMI-A-1" - "10, monitor:HDMI-A-1" + "1, monitor:eDP-1, default:true" + "2, monitor:eDP-1" + "3, monitor:eDP-1" + "4, monitor:eDP-1" + "5, monitor:eDP-1" + "6, monitor:eDP-1" + "7, monitor:eDP-1" + "8, monitor:eDP-1" + "9, monitor:eDP-1" + "10, monitor:eDP-1" - "11, monitor:HDMI-A-2, default:true" - "12, monitor:HDMI-A-2" - "13, monitor:HDMI-A-2" - "14, monitor:HDMI-A-2" - "15, monitor:HDMI-A-2" - "16, monitor:HDMI-A-2" - "17, monitor:HDMI-A-2" - "18, monitor:HDMI-A-2" - "19, monitor:HDMI-A-2" - "20, monitor:HDMI-A-2" + # "11, monitor:HDMI-A-2, default:true" + # "12, monitor:HDMI-A-2" + # "13, monitor:HDMI-A-2" + # "14, monitor:HDMI-A-2" + # "15, monitor:HDMI-A-2" + # "16, monitor:HDMI-A-2" + # "17, monitor:HDMI-A-2" + # "18, monitor:HDMI-A-2" + # "19, monitor:HDMI-A-2" + # "20, monitor:HDMI-A-2" - "21, monitor:DP-2, default:true" - "22, monitor:DP-2" - "23, monitor:DP-2" - "24, monitor:DP-2" - "25, monitor:DP-2" - "26, monitor:DP-2" - "27, monitor:DP-2" - "28, monitor:DP-2" - "29, monitor:DP-2" - "30, monitor:DP-2" + # "21, monitor:DP-2, default:true" + # "22, monitor:DP-2" + # "23, monitor:DP-2" + # "24, monitor:DP-2" + # "25, monitor:DP-2" + # "26, monitor:DP-2" + # "27, monitor:DP-2" + # "28, monitor:DP-2" + # "29, monitor:DP-2" + # "30, monitor:DP-2" # scratchpads "special:btop, decorate:false" @@ -111,7 +110,6 @@ in { follow_mouse = true; repeat_rate = 50; repeat_delay = 250; - tablet = {output = "HDMI-A-2";}; }; general = { sensitivity = 1.0; @@ -190,26 +188,26 @@ in { "$mainMod, O, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" # workspaces # split-workspace is because of the split-workspace plugin - "$mainMod, 1, split-workspace, 1" - "$mainMod, 2, split-workspace, 2" - "$mainMod, 3, split-workspace, 3" - "$mainMod, 4, split-workspace, 4" - "$mainMod, 5, split-workspace, 5" - "$mainMod, 6, split-workspace, 6" - "$mainMod, 7, split-workspace, 7" - "$mainMod, 8, split-workspace, 8" - "$mainMod, 9, split-workspace, 9" - "$mainMod, 0, split-workspace, 10" - "$mainMod SHIFT, 1, split-movetoworkspacesilent, 1" - "$mainMod SHIFT, 2, split-movetoworkspacesilent, 2" - "$mainMod SHIFT, 3, split-movetoworkspacesilent, 3" - "$mainMod SHIFT, 4, split-movetoworkspacesilent, 4" - "$mainMod SHIFT, 5, split-movetoworkspacesilent, 5" - "$mainMod SHIFT, 6, split-movetoworkspacesilent, 6" - "$mainMod SHIFT, 7, split-movetoworkspacesilent, 7" - "$mainMod SHIFT, 8, split-movetoworkspacesilent, 8" - "$mainMod SHIFT, 9, split-movetoworkspacesilent, 9" - "$mainMod SHIFT, 0, split-movetoworkspacesilent, 10" + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + "$mainMod SHIFT, 1, movetoworkspacesilent, 1" + "$mainMod SHIFT, 2, movetoworkspacesilent, 2" + "$mainMod SHIFT, 3, movetoworkspacesilent, 3" + "$mainMod SHIFT, 4, movetoworkspacesilent, 4" + "$mainMod SHIFT, 5, movetoworkspacesilent, 5" + "$mainMod SHIFT, 6, movetoworkspacesilent, 6" + "$mainMod SHIFT, 7, movetoworkspacesilent, 7" + "$mainMod SHIFT, 8, movetoworkspacesilent, 8" + "$mainMod SHIFT, 9, movetoworkspacesilent, 9" + "$mainMod SHIFT, 0, movetoworkspacesilent, 10" # Screenshotting "$mainMod, S, exec, ${pkgs.grimblast}/bin/grimblast copy area" # File manager @@ -278,6 +276,7 @@ in { "${swww}/bin/swww-daemon" "${wlsunset}/bin/wlsunset -S 06:00 -s 20:00" + "${waybar}/bin/waybar" ]; exec = [ @@ -291,13 +290,6 @@ in { "[workspace special:pipewire;silent;tile] ${pkgs.pavucontrol}/bin/pavucontrol" # "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator" ]; - - plugin = { - split-monitor-workspaces = { - count = 10; - keep_focused = true; - }; - }; }; }; };