diff options
| author | polwex <polwex@sortug.com> | 2025-10-14 06:35:29 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-10-14 06:35:29 +0700 |
| commit | 0983b8509b5595c8214f0df9264ccfb34af50ad7 (patch) | |
| tree | f034284a73de6f0eb8d7b250257b1d71ac403bfa /hosts | |
| parent | a61c5db40ee85f98e6f40417c73ef10ca566aa19 (diff) | |
m
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/base.nix | 12 | ||||
| -rw-r--r-- | hosts/local/fw11/configuration.nix | 12 | ||||
| -rw-r--r-- | hosts/local/fw11/hardware-configuration.bkp | 40 | ||||
| -rw-r--r-- | hosts/local/fw11/hardware-configuration.nix | 19 | ||||
| -rw-r--r-- | hosts/local/fw11/keyboard.nix | 8 | ||||
| -rw-r--r-- | hosts/local/gui.nix | 5 | ||||
| -rw-r--r-- | hosts/local/thinkpad.kbd | 105 | ||||
| -rw-r--r-- | hosts/local/wayland.nix | 4 | ||||
| -rw-r--r-- | hosts/pkgs.nix | 5 | ||||
| -rw-r--r-- | hosts/unfree.nix | 2 |
10 files changed, 186 insertions, 26 deletions
diff --git a/hosts/base.nix b/hosts/base.nix index 91f90a5..43103c5 100644 --- a/hosts/base.nix +++ b/hosts/base.nix @@ -23,6 +23,18 @@ experimental-features = nix-command flakes ''; settings = { + substituters = [ + "https://cache-nixos.org" + "https://cuda-maintainers.cachix.org" + "https://nix-community.cachix.org" + "https://nix-gaming.cachix.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + ]; keep-outputs = true; keep-derivations = true; trusted-users = ["root" "y"]; diff --git a/hosts/local/fw11/configuration.nix b/hosts/local/fw11/configuration.nix index 11c09d1..354e441 100644 --- a/hosts/local/fw11/configuration.nix +++ b/hosts/local/fw11/configuration.nix @@ -25,9 +25,10 @@ ../../base.nix ../../linux.nix # ../../syncthing.nix - # ../../unfree.nix - # ../wayland.nix - # ./keyboard.nix + ../../unfree.nix + ../wayland.nix + ../gui.nix + ./keyboard.nix # ../android.nix ]; @@ -52,13 +53,14 @@ boot.loader.efi.canTouchEfiVariables = true; # boot.supportedFilesystems = ["ntfs"]; # boot.kernelPackages = lib.mkForce unfreePkgs.linuxKernel.packages.linux_xanmod_latest; - # boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelPackages = pkgs.linuxPackages_6_12; + boot.kernelPackages = pkgs.linuxPackages_latest; + # boot.kernelPackages = pkgs.linuxPackages_6_12; services.fprintd.enable = true; networking = { hostName = "fw-nixos"; # Define your hostname. firewall.enable = false; + nameservers = ["8.8.8.8" "8.8.4.4"]; }; nix.settings.trusted-users = ["root" "y"]; diff --git a/hosts/local/fw11/hardware-configuration.bkp b/hosts/local/fw11/hardware-configuration.bkp new file mode 100644 index 0000000..359ff8f --- /dev/null +++ b/hosts/local/fw11/hardware-configuration.bkp @@ -0,0 +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, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "i915" "8821cu"]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.rtl8821cu ]; + # to modeswitch usb dongle sudo usb_modeswitch -KW -v 0bda -p 1a2b + + fileSystems."/" = + { device = "/dev/disk/by-uuid/176785ba-cd35-4d09-b7df-37e8b9843c33"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/043D-21E3"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + swapDevices = + [ + ]; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = lib.mkDefault false; + networking.interfaces.wlp170s0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/local/fw11/hardware-configuration.nix b/hosts/local/fw11/hardware-configuration.nix index 359ff8f..049c395 100644 --- a/hosts/local/fw11/hardware-configuration.nix +++ b/hosts/local/fw11/hardware-configuration.nix @@ -8,11 +8,10 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "i915" "8821cu"]; + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" ]; + boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.rtl8821cu ]; - # to modeswitch usb dongle sudo usb_modeswitch -KW -v 0bda -p 1a2b + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/176785ba-cd35-4d09-b7df-37e8b9843c33"; @@ -22,19 +21,13 @@ fileSystems."/boot" = { device = "/dev/disk/by-uuid/043D-21E3"; fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; + options = [ "fmask=0077" "dmask=0077" ]; }; swapDevices = - [ + [ { device = "/dev/disk/by-uuid/643ac019-fac1-4dad-84d9-e50380baff2b"; } ]; - # The global useDHCP flag is deprecated, therefore explicitly set to false here. - # Per-interface useDHCP will be mandatory in the future, so this generated config - # replicates the default behaviour. - networking.useDHCP = lib.mkDefault false; - networking.interfaces.wlp170s0.useDHCP = lib.mkDefault true; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/local/fw11/keyboard.nix b/hosts/local/fw11/keyboard.nix index ce875dd..f078258 100644 --- a/hosts/local/fw11/keyboard.nix +++ b/hosts/local/fw11/keyboard.nix @@ -1,8 +1,8 @@ {pkgs, ...}: { - services.logind.extraConfig = '' + services.logind.settings.Login = { # don’t shutdown when power button is short-pressed - HandlePowerKey=ignore - ''; + HandlePowerKey = "ignore"; + }; # config file keeps getting rewritten but I don't know by who i18n.inputMethod = { @@ -36,7 +36,7 @@ usbThinkpad = { # device = "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd"; device = "/dev/input/by-id/usb-Lenovo_TrackPoint_Keyboard_II-event-kbd"; - config = builtins.readFile ./thinkpad.kbd; + config = builtins.readFile ../thinkpad.kbd; }; }; }; diff --git a/hosts/local/gui.nix b/hosts/local/gui.nix index 1bfea32..548b3ea 100644 --- a/hosts/local/gui.nix +++ b/hosts/local/gui.nix @@ -40,7 +40,7 @@ # easyeffects # audio, cool stuff # games! - ryujinx + # ryujinx wineWowPackages.staging dosbox siyuan @@ -50,5 +50,8 @@ # chat signal-desktop telegram-desktop + # llms + lmstudio + cherry-studio ]; } diff --git a/hosts/local/thinkpad.kbd b/hosts/local/thinkpad.kbd new file mode 100644 index 0000000..82de2e2 --- /dev/null +++ b/hosts/local/thinkpad.kbd @@ -0,0 +1,105 @@ +;; one liner comments ';;' +#| Multiline + comments |# + +(defcfg ;; For linux & by-id lists pluggable devices +;; If a key is not bound/left_empty(_) then it will fall back to the previous +;; layer's binding if not then default. +fallthrough true +;; To run system commands. You MIGHT face issues with tiling window managers due to command helpers. +;; allow-cmd true +;; use 'ls /dev/input/by-id/' for detachable keyboards and +;; 'ls /dev/input/by-path/' for builtin keyboards location' +input (device-file "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd") +;; Not sure what this does. Please check the docs. +output (uinput-sink "My KMonad output") +) + +;; This is the real representation of your actual keyboard. We haven't started +;; customizing layouts yet. +(defsrc + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + lctl lmet lalt spc ralt rctl pgup up pgdn + left down right +) +;; Aliases + +(defalias +;; Layer toggles +sym (layer-toggle syms) +sym2 (layer-toggle syms2) +cords (sticky-key 1000 (layer-toggle mods)) +;; +hrt (layer-switch homerowmods) +back (layer-switch qwerty) + +;; Homerow keys +a (tap-hold-next-release 280 a lctl) +s (tap-hold-next-release 280 s lalt) +d (tap-hold-next-release 280 d lmet) +f (tap-hold-next-release 280 f lsft) +;; +j (tap-hold-next-release 280 j rsft) +k (tap-hold-next-release 280 k lmet) +l (tap-hold-next-release 280 l lalt) +semi (tap-hold-next-release 280 ; rctl) + +;; button to launch brave browser +;; veeb (cmd-button "brave") +;; ssf (sticky-key 500 (layer-toggle rshift)) +;; rsf (layer-toggle rshift) +) + +;; The first custom layer is the one that gets activated when kmonad is started +(deflayer qwerty ;; The default layer that'd be read when you launch kmonad + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + lctl lmet @sym spc @cords @hrt left up right + left down right +) +(deflayer homerowmods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end ins del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + esc @a @s @d @f g h @j @k @l @semi ' ret + lsft z x c v b n m , . / rsft + lctl lmet @sym spc lalt @back left up right + left down right +) +(deflayer mods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 pgup pgdn ins del + ` 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] h + esc lctl lalt lmet lsft g h rsft rmet ralt rctl ' ret + lsft z x c v b n m , . / rsft + lctl lmet @sym spc lalt @back left up right + left down right +) + +;; A layer dedicated to symbols +(deflayer syms + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 pgup pgdn ins del + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ up _ _ ! @ # $ % _ _ _ + _ _ left down right @sym2 ' ^ & - = _ ret + _ _ _ _ _ _ \( [ { < \ _ _ + _ _ _ _ _ _ _ _ _ _ _ +) + + +;; More symbols +(deflayer syms2 + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 pgup pgdn ins del + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ ` ~ * \_ + _ ret + _ _ _ _ _ _ \) ] } > | _ _ + _ _ _ _ _ _ _ _ _ _ _ +) diff --git a/hosts/local/wayland.nix b/hosts/local/wayland.nix index c33bf23..e881fec 100644 --- a/hosts/local/wayland.nix +++ b/hosts/local/wayland.nix @@ -11,7 +11,7 @@ enable = true; enable32Bit = true; extraPackages = [ - pkgs.mesa.drivers + pkgs.mesa pkgs.vaapiVdpau pkgs.libvdpau-va-gl ]; @@ -43,7 +43,7 @@ playerctl blueman wdisplays - inputs.nixpkgs-wayland.packages.x86_64-linux.waybar + inputs.waybar.packages.x86_64-linux.default glxinfo vulkan-tools glmark2 diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix index bf940f6..06a7f38 100644 --- a/hosts/pkgs.nix +++ b/hosts/pkgs.nix @@ -7,6 +7,7 @@ environment.systemPackages = with pkgs; [ # networking + lynx minio minio-client curlFull @@ -68,9 +69,12 @@ # aider-chat # inputs.yek.packages.x86_64-linux.default # python312Packages.google-generativeai + bun claude-code codex nushell + ast-grep + diffsitter # inputs.gemini-cli.packages.x86_64-linux.default ] ++ lib.optionals pkgs.stdenv.isLinux [ @@ -106,4 +110,5 @@ gnumake bun ]; + # ++ (with pkgs; [devenv]); } diff --git a/hosts/unfree.nix b/hosts/unfree.nix index 832e99a..5a140a4 100644 --- a/hosts/unfree.nix +++ b/hosts/unfree.nix @@ -42,5 +42,5 @@ remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server }; - systemd.extraConfig = "DefaultlimitNOFILE=524288"; + # systemd.extraConfig = "DefaultlimitNOFILE=524288"; } |
