From 021a797c8116032a114ba78476d1769c55479b48 Mon Sep 17 00:00:00 2001 From: polwex Date: Wed, 22 Oct 2025 14:40:39 +0700 Subject: p16 --- flake.lock | 96 +++++----- hosts/local/keyboards/thinkpad-usb.kbd | 101 ++++++++++ hosts/local/p16/configuration.nix | 94 ++++++++++ hosts/local/p16/default.nix | 6 + hosts/local/p16/hardware-configuration.nix | 41 ++++ hosts/local/p16/oldconf.nix | 107 +++++++++++ hosts/local/p16/swayconfig | 290 +++++++++++++++++++++++++++++ hosts/local/p16/waybarconfig | 135 ++++++++++++++ hosts/local/p16/waybarstyle.css | 103 ++++++++++ hosts/local/sway.nix | 3 +- hosts/nixos.nix | 1 + 11 files changed, 928 insertions(+), 49 deletions(-) create mode 100644 hosts/local/keyboards/thinkpad-usb.kbd create mode 100644 hosts/local/p16/configuration.nix create mode 100644 hosts/local/p16/default.nix create mode 100644 hosts/local/p16/hardware-configuration.nix create mode 100644 hosts/local/p16/oldconf.nix create mode 100644 hosts/local/p16/swayconfig create mode 100644 hosts/local/p16/waybarconfig create mode 100644 hosts/local/p16/waybarstyle.css diff --git a/flake.lock b/flake.lock index b43ea03..b4040f8 100644 --- a/flake.lock +++ b/flake.lock @@ -159,11 +159,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1760890764, - "narHash": "sha256-hCO8y2iJwlVTx6UKUpFY3doqHG5W0znV00mCAneX+FE=", + "lastModified": 1761091275, + "narHash": "sha256-SIiugXvSuI2WFedt1NyDj8yHsSDntsO/JWKyEZ+mI50=", "owner": "cachix", "repo": "devenv", - "rev": "8bd9769602d769d427450f64fbd02c80871a186c", + "rev": "a795c32dc826b51d12706f27fb344f966bb2b084", "type": "github" }, "original": { @@ -329,11 +329,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1760813311, - "narHash": "sha256-lbHQ7FXGzt6/IygWvJ1lCq+Txcut3xYYd6VIpF1ojkg=", + "lastModified": 1760948891, + "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4e627ac2e1b8f1de7f5090064242de9a259dbbc8", + "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", "type": "github" }, "original": { @@ -514,7 +514,7 @@ ] }, "locked": { - "lastModified": 1753566031, + "lastModified": 1761115047, "narHash": "sha256-ypEepJDaIjQx2Ou813++x5c1Kt11DR8vAWITBlmlgKU=", "path": "/home/y/nixconf/derivations/gemini", "type": "path" @@ -711,11 +711,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1760832569, - "narHash": "sha256-wg925OdUZdhjJub5XfpBTWQ3EOJYH7JnaBWHfh849J4=", + "lastModified": 1761055346, + "narHash": "sha256-uFs+nbH5eoPcxjcZKE0fINbj7b0o5vRMHc2cFjR9t7w=", "owner": "helix-editor", "repo": "helix", - "rev": "97aee4950fd9a08a78415cd8992354ae5cf3aaf0", + "rev": "668bf3878bc5257a9cad0d2edf82610cebf8bcae", "type": "github" }, "original": { @@ -927,11 +927,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1760839259, - "narHash": "sha256-9KYm1Oh3jB2Xf0LiFxIBFgOuqRN4FNW4PKfrxXDV418=", + "lastModified": 1761082499, + "narHash": "sha256-yYi9Y1BlbTCz/L91STqZZ9FFMDaW6FJ/tZg+GImssA8=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "6aa0613ecf363840e011006b05aefa094b78b053", + "rev": "a757514dffbeafcce1a3edb9e83b9f8ae38b10e1", "type": "github" }, "original": { @@ -1036,11 +1036,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1760106635, - "narHash": "sha256-2GoxVaKWTHBxRoeUYSjv0AfSOx4qw5CWSFz2b+VolKU=", + "lastModified": 1760958188, + "narHash": "sha256-2m1S4jl+GEDtlt2QqeHil8Ny456dcGSKJAM7q3j/BFU=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "9ed85f8afebf2b7478f25db0a98d0e782c0ed903", + "rev": "d6645c340ef7d821602fd2cd199e8d1eed10afbc", "type": "github" }, "original": { @@ -1149,11 +1149,11 @@ }, "nixpkgs-darwin": { "locked": { - "lastModified": 1760794584, - "narHash": "sha256-6IKtYFTwVORisw6DkhUXo6VHscpIBvuCcSUmquFYoG8=", + "lastModified": 1760968520, + "narHash": "sha256-EjGslHDzCBKOVr+dnDB1CAD7wiQSHfUt3suOpFj9O1Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "434ace593ed7defee962d36793bfa17ebd4555ce", + "rev": "e755547441a0413942a37692f7bf7fc6315bb7f6", "type": "github" }, "original": { @@ -1226,11 +1226,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1760725957, - "narHash": "sha256-tdoIhL/NlER290HfSjOkgi4jfmjeqmqrzgnmiMtGepE=", + "lastModified": 1760862643, + "narHash": "sha256-PXwG0TM7Ek87DNx4LbGWuD93PbFeKAJs4FfALtp7Wo0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "81b927b14b7b3988334d5282ef9cba802e193fe1", + "rev": "33c6dca0c0cb31d6addcd34e90a63ad61826b28c", "type": "github" }, "original": { @@ -1245,11 +1245,11 @@ "nixpkgs": "nixpkgs_12" }, "locked": { - "lastModified": 1760624622, - "narHash": "sha256-46hcvFR35pO20unutRtW6zMFMqWWs/sdkJhxbpNgLUQ=", + "lastModified": 1760970213, + "narHash": "sha256-ORO3jMAfjCD/FTYIPrMk8dAP+GMWvFPWae7XanUD1aw=", "owner": "numtide", "repo": "nixpkgs-unfree", - "rev": "20715f574d65864d5f8a4634978dc2f971d0ce33", + "rev": "ee5500622743b92fa7b88be334674db1512d872f", "type": "github" }, "original": { @@ -1268,11 +1268,11 @@ ] }, "locked": { - "lastModified": 1760706459, - "narHash": "sha256-fX8jI4nSckpBemnmk5jFcaGxXSnNWBUw2840OTamxYI=", + "lastModified": 1761052311, + "narHash": "sha256-PfWbhEv9d5SsSVWgZIQYJ8IjjkL27ZgoLKDyTXBLzAs=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "900a3dcea87f5bc937da5675217686dd71cccc55", + "rev": "ecf06e1acb8d5f00d1e23f10777a674e0c6d5579", "type": "github" }, "original": { @@ -1299,11 +1299,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1760524057, - "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", + "lastModified": 1760878510, + "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", + "rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67", "type": "github" }, "original": { @@ -1315,11 +1315,11 @@ }, "nixpkgs_12": { "locked": { - "lastModified": 1760524057, - "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", + "lastModified": 1760878510, + "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", + "rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67", "type": "github" }, "original": { @@ -1329,11 +1329,11 @@ }, "nixpkgs_13": { "locked": { - "lastModified": 1760524057, - "narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=", + "lastModified": 1760878510, + "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5", + "rev": "5e2a59a5b1a82f89f2c7e598302a9cacebb72a67", "type": "github" }, "original": { @@ -1477,11 +1477,11 @@ "nixpkgs": "nixpkgs_13" }, "locked": { - "lastModified": 1760901178, - "narHash": "sha256-Aigo3XUHrJDsbwlT6sptlSiqIbubPnCbi4+K8mNRTTQ=", + "lastModified": 1761114294, + "narHash": "sha256-WF2vIfHTFaD5MqFuZzwrufTwIOOYo9GJn+91rgrxGFI=", "owner": "nix-community", "repo": "NUR", - "rev": "f767ba32a14c42ce78da68cbbe0b410168f14096", + "rev": "5d84bb7cf94f54ebbfde2f30fe465a847a355ea3", "type": "github" }, "original": { @@ -1497,11 +1497,11 @@ ] }, "locked": { - "lastModified": 1760850833, - "narHash": "sha256-XqCx+9nafjYx7+84IXhuCGMk0wGfxsECBWblDcZTd3o=", + "lastModified": 1761099030, + "narHash": "sha256-QmYEbR/92/3fjdMhjxSk7C/q+ahDTKmjTHHrhkFfMfs=", "owner": "openai", "repo": "codex", - "rev": "4f46360aa493b04eae12045ac8c34a4e42441734", + "rev": "53cadb4df6e078354663f435f5fff16bd6fb7aa3", "type": "github" }, "original": { @@ -1821,7 +1821,7 @@ ] }, "locked": { - "lastModified": 1740186345, + "lastModified": 1761115047, "narHash": "sha256-Qox5x+FI4OhCs/7T/v4hZlR9Rm7ZfpXP7ISy+OrHCyw=", "path": "/home/y/nixconf/derivations/windsurf", "type": "path" @@ -1853,7 +1853,7 @@ ] }, "locked": { - "lastModified": 1740469068, + "lastModified": 1761115047, "narHash": "sha256-uoitiN9zrv9QaGf8mKIXhRxXtsNi6MupZVK+Zy3jOoA=", "path": "/home/y/nixconf/derivations/yek", "type": "path" @@ -1870,11 +1870,11 @@ ] }, "locked": { - "lastModified": 1759982773, - "narHash": "sha256-HlTQoXRytul3jjek7vRV0Qk7voDB3Fy8RSIzDSvHIAQ=", + "lastModified": 1761105987, + "narHash": "sha256-d01CGcdNlsqIn4ncGCWHM0Velnii/Ggef1iybQvEOfc=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "f2f8aff94529e763665b807bad23396aed9d1fe8", + "rev": "e7d9fefd8665be5d4c77466140f21a15f6d29e93", "type": "github" }, "original": { diff --git a/hosts/local/keyboards/thinkpad-usb.kbd b/hosts/local/keyboards/thinkpad-usb.kbd new file mode 100644 index 0000000..7fb53d2 --- /dev/null +++ b/hosts/local/keyboards/thinkpad-usb.kbd @@ -0,0 +1,101 @@ +;; 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 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 up + lctl lmet lalt spc ralt rctl 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 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 + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc @cords @hrt left down right +) +(deflayer homerowmods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 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 + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc lalt @back left down right +) +(deflayer mods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 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 + @sym z x c v b n m , . / rsft up + lctl lmet @sym spc lalt @back left down right +) + +;; A layer dedicated to symbols +(deflayer syms + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ up _ _ ! @ # $ % _ _ _ + _ _ left down right @sym2 ' ^ & - = _ ret + _ _ _ _ _ _ \( [ { < \ _ _ + _ _ _ _ _ _ _ _ _ +) + + +;; More symbols +(deflayer syms2 + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ ` ~ * \_ + _ ret + _ _ _ _ _ _ \) ] } > | _ _ + _ _ _ _ _ _ _ _ _ +) diff --git a/hosts/local/p16/configuration.nix b/hosts/local/p16/configuration.nix new file mode 100644 index 0000000..e0b81ca --- /dev/null +++ b/hosts/local/p16/configuration.nix @@ -0,0 +1,94 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + inputs, + pkgs, + ... +}: +# let +# wrappers = +# inputs.wrapper-manager.lib.build +# { +# inherit pkgs; +# modules = [ +# ../../../wrappers/chromium +# ../../../wrappers/brave +# ../../../wrappers/zellij +# ../../../wrappers/alacritty +# ]; +# }; +# in +{ + imports = [ + # Include the results of the hardware scan. + ../../base.nix + ../../linux.nix + # ../../syncthing.nix + # ../../unfree.nix + ../wayland.nix + ../gui.nix + # ./keyboard.nix + # ../android.nix + ]; + + # environment.systemPackages = [ + # wrappers + # ]; + # + + nixpkgs.config = { + allowUnfree = true; + }; + environment = { + etc = { + "sway/config".source = ./swayconfig; + "xdg/waybar/config".source = ./waybarconfig; + "xdg/waybar/styles.css".source = ./waybarstyle.css; + }; + }; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + # boot.supportedFilesystems = ["ntfs"]; + # boot.kernelPackages = lib.mkForce unfreePkgs.linuxKernel.packages.linux_xanmod_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking = { + hostName = "p16"; # Define your hostname. + firewall.enable = false; + }; + nix.settings.trusted-users = ["root" "y"]; + + # Set your time zone. + time.timeZone = "Asia/Bangkok"; + # time.timeZone = "Europe/Madrid"; + + # List services that you want to enable: + + services.openssh.enable = true; + services.openssh.ports = [5555]; + + #flatpak + # services.flatpak.enable = true; + # xdg.portal.enable = true; + #/flatpak + # don't sleep if closed lid; + #services.logind.lidSwitchExternalPower = "ignore"; + #services.logind.lidSwitchDocked = "ignore"; + #services.logind.lidSwitch = "ignore"; + + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + # 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 = "25.05"; # Did you read the comment? +} diff --git a/hosts/local/p16/default.nix b/hosts/local/p16/default.nix new file mode 100644 index 0000000..edd555a --- /dev/null +++ b/hosts/local/p16/default.nix @@ -0,0 +1,6 @@ +inputs: [ + inputs.kmonad.nixosModules.default + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p16s-amd-gen4 + ./hardware-configuration.nix + ./configuration.nix +] diff --git a/hosts/local/p16/hardware-configuration.nix b/hosts/local/p16/hardware-configuration.nix new file mode 100644 index 0000000..a585bb9 --- /dev/null +++ b/hosts/local/p16/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "nvme" "xhci_pci" "thunderbolt" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/707586ec-e92a-4cc4-ac53-19630f27f09c"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/89FB-484A"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/0a0a5bc3-df1d-4b0f-aaea-04be51d102b0"; } + ]; + + # 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.enp195s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp194s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/local/p16/oldconf.nix b/hosts/local/p16/oldconf.nix new file mode 100644 index 0000000..c7b0465 --- /dev/null +++ b/hosts/local/p16/oldconf.nix @@ -0,0 +1,107 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use latest kernel. + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "nixos"; # 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; + + # Set your time zone. + time.timeZone = "Asia/Bangkok"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.y = { + isNormalUser = true; + description = "y"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; []; + }; + + # Enable automatic login for the user. + services.getty.autologinUser = "y"; +services.openssh.enable = true; + +nix.extraOptions = '' + experimental-features = nix-command flakes + ''; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + git + helix + wget + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # 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 = "25.05"; # Did you read the comment? + +} diff --git a/hosts/local/p16/swayconfig b/hosts/local/p16/swayconfig new file mode 100644 index 0000000..09745dc --- /dev/null +++ b/hosts/local/p16/swayconfig @@ -0,0 +1,290 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +##y set $menu dmenu_path | dmenu | xargs swaymsg exec -- +set $menu wofi -S run -G -Q +### Output configuration +# +# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) +set $wallpapers_path $HOME/wallpapers/4k +output * bg `find $wallpapers_path -type f | shuf -n 1` fill +# output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +# +# Example configuration: +# +# output HDMI-A-1 resolution 3840 × 2160 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# + exec swayidle -w \ + timeout 3000 'swaylock -f -c 000000' \ + timeout 6000 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f -c 000000' +# +# +# start IME +exec fcitx5 +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. +input * xkb_numlock enabled +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right + + + # Workspaces: +# + # Switch to workspace + bindsym $mod+n workspace prev + bindsym $mod+m workspace next + bindsym $mod+Shift+n move container to workspace prev + bindsym $mod+Shift+m move container to workspace next + #move workspace to current output + set $cycle node ~/dotfiles/shell/swaycycle.mjs + bindsym $mod+comma exec $cycle + bindsym $mod+Shift+comma move workspace to output down +# + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +## function keys +bindsym XF86AudioMute exec pactl set-sink-mute 0 toggle +bindsym XF86AudioLowerVolume exec pactl set-sink-volume 0 -5% +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume 0 +5% +bindsym XF86AudioPrev exec playerctl previous +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioNext exec playerctl next +bindsym XF86MonBrightnessDown exec brigthnessctl -c backlight set 5%- +bindsym XF86MonBrightnessUp exec brightnessctl -c backlight set +5% +# bindsym Super_L exec +# bindsym XF86RFKill exec +# bindsym Print exec $smallshot +# bindsym XF86AudioMedia exec + + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +#bar { +# position top + + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. +# status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + + # colors { + # statusline #ffffff + # background #323232 + # inactive_workspace #32323200 #32323200 #5c5c5c + # } +#} +bar { + swaybar_command waybar +} +input type:touchpad { + click_method clickfinger + tap enabled + dwt enabled + pointer_accel 0.3 + accel_profile adaptive +} + + +# Screenshosts +set $screenshot grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') ~/Screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png +bindsym $mod+p exec $screenshot +set $smallshot grim -t jpeg -g "$(slurp)" ~/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg +bindsym $mod+Alt+p exec $smallshot +set $smallcopy grim -g "$(slurp)" -t png - | wl-copy -t image/png +bindsym $mod+Shift+p exec $smallcopy +# bindsym $mod+Shift+p exec grim -t jpeg -g "$(slurp)" ~/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).jpg + +# Res scaling +output eDP-1 scale 1.7 +# monitor layout +output DP-3 transform 270 +# position depends on scaled resolution! if you changed the scale be careful +# output DP-3 pos 0 0 +#output eDP-1 pos 0 1920 +#output DP-3 resolution 3440x1400 pos 1080 300 scale 1.2 +# thanks claude + +# Titlebars +# +# default_border none +# default_floating_border none +font pango:monospace 0.001 +#titlebar_padding 1 +#titlebar_border_thickness 0 +# hide_edge_borders smart + +# mouse cursors +seat * xcursor_theme hicolor 48 +# this stops screen sharing from working wtf +# output * render_bit_depth 10 +include /etc/sway/config.d/* + diff --git a/hosts/local/p16/waybarconfig b/hosts/local/p16/waybarconfig new file mode 100644 index 0000000..20cea00 --- /dev/null +++ b/hosts/local/p16/waybarconfig @@ -0,0 +1,135 @@ +{ + // "layer": "top", // Waybar at top layer + "position": "bottom", // Waybar position (top|bottom|left|right) + // "output": "DP-1", + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 4, // Gaps between modules (4px) + // Choose the order of the modules + "modules-left": ["sway/mode", "sway/window"], + "modules-center": ["sway/workspaces"], + "modules-right": ["pulseaudio", "network", "bluetooth", "idle_inhibitor", "cpu", "backlight", "battery", "clock", "tray"], + // Modules configuration + "sway/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{name}: {icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "urgent": "", + "focused": "", + "default": "" + } + }, + // "keyboard-state": { + // "numlock": true, + // "capslock": true, + // "format": " {icon} {name}", + // "format-icons": { + // "locked": "", + // "unlocked": "" + // } + // }, + "sway/mode": { + "format": "{}" + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "clock": { + "timezone": "Asia/Bangkok", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "", + }, + "memory": { + "format": "" + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + "format": "{icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""], + "on-scroll-up": "brightnessctl -c backlight set +1%", + "on-scroll-down": "brightnessctl -c backlight set 1%-" + }, + "battery": { + "states": { + "good": 95, + "warning": 15, + "critical": 7 + }, + "format": "{icon} {capacity}%", + // "format-charging": " {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": "", + "format-alt": "{icon} {time}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "", + "format-ethernet": "", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon}", + "format-bluetooth": "{icon} {volume}% {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "", + "format-source-muted": "", + // "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/fcitx5": { + "format": "{}", + "return-type": "json", + "exec": "~/dotfiles/waybar/fcitx5-status.sh", + "interval": 1 + }, + "bluetooth": { + "format": "{icon}", + "format-icons": { + "enabled": "", + "disabled": "" + }, + "tooltip-format": "{}", + "on-click": "blueman-manager" + } +} diff --git a/hosts/local/p16/waybarstyle.css b/hosts/local/p16/waybarstyle.css new file mode 100644 index 0000000..97e65e2 --- /dev/null +++ b/hosts/local/p16/waybarstyle.css @@ -0,0 +1,103 @@ +* { + border: none; + border-radius: 0; + font-family: "Ubuntu Nerd Font"; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background: transparent; + color: white; +} + +#window { + margin-left: 1rem; + font-weight: bold; + font-family: "Ubuntu"; +} +/* +#workspaces { + padding: 0 5px; +} +*/ + +#workspaces button { + padding: 0 5px; + background: transparent; + color: white; + border-top: 2px solid transparent; +} + +#workspaces button.focused { + color: #c9545d; + border-top: 2px solid #c9545d; +} + +#mode { + background: #64727D; + border-bottom: 3px solid white; +} + +#bluetooth, #idle_inhibitor, #temperature, #backlight, #clock, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode { + padding: 5px; + margin: 2px; + border-radius: 3rem; + background-color: rgb(10, 10, 10); +} + +#clock { + font-weight: bold; +} + +#battery { +} + +#battery icon { + color: red; +} + +#battery.charging { +} + +@keyframes blink { + to { + background-color: #ffffff; + color: black; + } +} + +#battery.warning:not(.charging) { + color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +#cpu { +} + +#memory { +} + +#network { +} + +#network.disconnected { + background: #f53c3c; +} + +#pulseaudio { +} + +#pulseaudio.muted { +} + +#custom-spotify { + color: rgb(102, 220, 105); +} + +#tray { +} diff --git a/hosts/local/sway.nix b/hosts/local/sway.nix index e881fec..4a91216 100644 --- a/hosts/local/sway.nix +++ b/hosts/local/sway.nix @@ -43,7 +43,8 @@ playerctl blueman wdisplays - inputs.waybar.packages.x86_64-linux.default + # inputs.waybar.packages.x86_64-linux.default + waybar glxinfo vulkan-tools glmark2 diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 9ebe253..cbb77a3 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -10,6 +10,7 @@ in { s15 = mkNixosSystem "aarch64-linux" "local/s15"; fw11 = mkNixosSystem "x86_64-linux" "local/fw11"; + p16 = mkNixosSystem "x86_64-linux" "local/p16"; master = mkNixosSystem "x86_64-linux" "local/master"; # vivo2025 = mkNixosSystem "x86_64-linux" "local/vivo2025"; ohira = mkNixosSystem "x86_64-linux" "local/ohira"; -- cgit v1.2.3 From dcf6ad1c5755e5acc40b3aa88315f7c335c7eb55 Mon Sep 17 00:00:00 2001 From: polwex Date: Sat, 25 Oct 2025 21:07:06 +0700 Subject: p16 --- flake.lock | 431 ++++++++++++++++++------------ flake.nix | 23 +- hosts/base.nix | 2 + hosts/local/gui.nix | 5 +- hosts/local/keyboards/thinkpad-numpad.kbd | 102 +++++++ hosts/local/niri.nix | 49 ++-- hosts/local/p16/configuration.nix | 68 ++--- hosts/local/p16/default.nix | 7 + hosts/local/p16/home.nix | 61 +++++ hosts/local/p16/keyboard.nix | 42 +++ hosts/local/sway.nix | 4 +- hosts/local/syncthing.nix | 54 ++++ hosts/pkgs.nix | 17 +- hosts/unfree.nix | 4 +- 14 files changed, 613 insertions(+), 256 deletions(-) create mode 100644 hosts/local/keyboards/thinkpad-numpad.kbd create mode 100644 hosts/local/p16/home.nix create mode 100644 hosts/local/p16/keyboard.nix create mode 100644 hosts/local/syncthing.nix diff --git a/flake.lock b/flake.lock index b4040f8..494e678 100644 --- a/flake.lock +++ b/flake.lock @@ -1,53 +1,5 @@ { "nodes": { - "agenix": { - "inputs": { - "agenix": "agenix_2", - "crane": "crane", - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1744897914, - "narHash": "sha256-GIVU92o2TZBnKQXTb76zpQbWR4zjU2rFqWKNIIpXnqA=", - "owner": "yaxitech", - "repo": "ragenix", - "rev": "40f2e17ecaeab4d78ec323e96a04548c0aaa5223", - "type": "github" - }, - "original": { - "owner": "yaxitech", - "repo": "ragenix", - "type": "github" - } - }, - "agenix_2": { - "inputs": { - "darwin": "darwin", - "home-manager": "home-manager", - "nixpkgs": [ - "agenix", - "nixpkgs" - ], - "systems": "systems" - }, - "locked": { - "lastModified": 1736955230, - "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", - "owner": "ryantm", - "repo": "agenix", - "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", - "type": "github" - }, - "original": { - "owner": "ryantm", - "repo": "agenix", - "type": "github" - } - }, "blobs": { "flake": false, "locked": { @@ -97,21 +49,6 @@ } }, "crane": { - "locked": { - "lastModified": 1741481578, - "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", - "owner": "ipetkov", - "repo": "crane", - "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "crane_2": { "locked": { "lastModified": 1754269165, "narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=", @@ -126,26 +63,30 @@ "type": "github" } }, - "darwin": { + "dankMaterialShell": { "inputs": { + "dgop": [ + "dgop" + ], + "dms-cli": [ + "dms-cli" + ], "nixpkgs": [ - "agenix", - "agenix", "nixpkgs" - ] + ], + "quickshell": "quickshell" }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "lastModified": 1761106450, + "narHash": "sha256-vneqm8FGC68+bMerG9N772cpJio+ZkVxlqdRhaf1XqE=", + "owner": "AvengeMedia", + "repo": "DankMaterialShell", + "rev": "479868718e7396a2e5a552e8e766ec4333f3377b", "type": "github" }, "original": { - "owner": "lnl7", - "ref": "master", - "repo": "nix-darwin", + "owner": "AvengeMedia", + "repo": "DankMaterialShell", "type": "github" } }, @@ -172,6 +113,26 @@ "type": "github" } }, + "dgop": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760238269, + "narHash": "sha256-7CeGZM/Z/5Qt3AYByCRohGYGR1MRuXYzTTbkV/JxyAs=", + "owner": "AvengeMedia", + "repo": "dgop", + "rev": "95acdfce2d323e28fa8f5a4f345160962034f2b5", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "dgop", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": [ @@ -192,6 +153,27 @@ "type": "github" } }, + "dms-cli": { + "inputs": { + "gomod2nix": "gomod2nix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761107165, + "narHash": "sha256-mYC+2YQKjxAIiuO9PLAu27P4AFUoinEy1s4MSnU35+o=", + "owner": "AvengeMedia", + "repo": "danklinux", + "rev": "942f89c393ea63bbb7ce3bb86121f512129c847f", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "danklinux", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -404,7 +386,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -422,7 +404,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_2" }, "locked": { "lastModified": 1731533236, @@ -440,7 +422,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" }, "locked": { "lastModified": 1731533236, @@ -473,7 +455,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1701680307, @@ -491,7 +473,7 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_6" + "systems": "systems_5" }, "locked": { "lastModified": 1731533236, @@ -705,10 +687,33 @@ "type": "github" } }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "dms-cli", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756047880, + "narHash": "sha256-JeuGh9kA1SPL70fnvpLxkIkCWpTjtoPaus3jzvdna0k=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "47d628dc3b506bd28632e47280c6b89d3496909d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v1.7.0", + "repo": "gomod2nix", + "type": "github" + } + }, "helix": { "inputs": { "nixpkgs": "nixpkgs_3", - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay" }, "locked": { "lastModified": 1761055346, @@ -727,17 +732,15 @@ "home-manager": { "inputs": { "nixpkgs": [ - "agenix", - "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "lastModified": 1761081701, + "narHash": "sha256-IwpfaKg5c/WWQiy8b5QGaVPMvoEQ2J6kpwRFdpVpBNQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "rev": "9b4a2a7c4fbd75b422f00794af02d6edb4d9d315", "type": "github" }, "original": { @@ -781,7 +784,9 @@ }, "kmonad": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "dir": "nix", @@ -801,12 +806,12 @@ }, "lanzaboote": { "inputs": { - "crane": "crane_2", + "crane": "crane", "flake-compat": "flake-compat_3", "flake-parts": "flake-parts_3", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "rust-overlay": "rust-overlay_3" + "rust-overlay": "rust-overlay_2" }, "locked": { "lastModified": 1756744479, @@ -844,7 +849,7 @@ "microvm": { "inputs": { "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "spectrum": "spectrum" }, "locked": { @@ -861,6 +866,64 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1760950171, + "narHash": "sha256-E2ySTu/oK7cYBdAI3tlGP9zVjF4mZgWJ1OZInBCMb00=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "f851a923137c0a54719412146fd63d24b3214e60", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.08", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1760940149, + "narHash": "sha256-KbM47vD6E0cx+v4jYQZ8mD5N186AKm2CQlyh34TW58U=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "b3245b81a6ed8edfaf5388a74d2e0a23c24941e5", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nix": { "inputs": { "flake-compat": [ @@ -924,7 +987,7 @@ "nix-gaming": { "inputs": { "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1761082499, @@ -1078,7 +1141,7 @@ "inputs": { "flake-utils": "flake-utils_5", "nixos-generators": "nixos-generators_2", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_8", "pre-commit-hooks": "pre-commit-hooks" }, "locked": { @@ -1098,7 +1161,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_5", - "nixpkgs": "nixpkgs_10" + "nixpkgs": "nixpkgs_9" }, "locked": { "lastModified": 1760536587, @@ -1225,6 +1288,22 @@ } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1760862643, + "narHash": "sha256-PXwG0TM7Ek87DNx4LbGWuD93PbFeKAJs4FfALtp7Wo0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "33c6dca0c0cb31d6addcd34e90a63ad61826b28c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1760862643, "narHash": "sha256-PXwG0TM7Ek87DNx4LbGWuD93PbFeKAJs4FfALtp7Wo0=", @@ -1242,7 +1321,7 @@ }, "nixpkgs-unfree": { "inputs": { - "nixpkgs": "nixpkgs_12" + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1760970213, @@ -1282,22 +1361,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1759733170, - "narHash": "sha256-TXnlsVb5Z8HXZ6mZoeOAIwxmvGHp1g4Dw89eLvIwKVI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8913c168d1c56dc49a7718685968f38752171c3b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1760878510, "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", @@ -1313,7 +1376,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_11": { "locked": { "lastModified": 1760878510, "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", @@ -1327,7 +1390,7 @@ "type": "indirect" } }, - "nixpkgs_13": { + "nixpkgs_12": { "locked": { "lastModified": 1760878510, "narHash": "sha256-K5Osef2qexezUfs0alLvZ7nQFTGS9DL2oTVsIXsqLgs=", @@ -1392,22 +1455,6 @@ } }, "nixpkgs_5": { - "locked": { - "lastModified": 1744157173, - "narHash": "sha256-bWSjxDwq7iVePrhmA7tY2dyMWHuNJo8knkO4y+q4ZkY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6a39c6e495eefabc935d8ddf66aa45d85b85fa3f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { "locked": { "lastModified": 1754243818, "narHash": "sha256-sEPw2W01UPf0xNGnMGNZIaE1XHkk7O+lLLetYEXVZHk=", @@ -1423,7 +1470,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1759381078, "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", @@ -1439,7 +1486,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1760596604, "narHash": "sha256-J/i5K6AAz/y5dBePHQOuzC7MbhyTOKsd/GLezSbEFiM=", @@ -1455,7 +1502,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1729256560, "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", @@ -1471,10 +1518,26 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1759733170, + "narHash": "sha256-TXnlsVb5Z8HXZ6mZoeOAIwxmvGHp1g4Dw89eLvIwKVI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8913c168d1c56dc49a7718685968f38752171c3b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": "flake-parts_5", - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1761114294, @@ -1585,21 +1648,46 @@ "type": "github" } }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "dankMaterialShell", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760228179, + "narHash": "sha256-4Z6k7lv3Zcgk3K+4h60LpqB9wCkR+utkYERU735U068=", + "ref": "refs/heads/master", + "rev": "c9d3ffb6043c5bf3f3009202bad7e0e5132c4a25", + "revCount": 693, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, "root": { "inputs": { - "agenix": "agenix", + "dankMaterialShell": "dankMaterialShell", "devenv": "devenv", + "dgop": "dgop", "disko": "disko", + "dms-cli": "dms-cli", "flake-parts": "flake-parts_2", "flake-utils": "flake-utils_2", "gemini-cli": "gemini-cli", "git-hooks": "git-hooks_2", "helix": "helix", + "home-manager": "home-manager", "homix": "homix", "impermanence": "impermanence", "kmonad": "kmonad", "lanzaboote": "lanzaboote", "microvm": "microvm", + "niri": "niri", "nix-darwin": "nix-darwin", "nix-gaming": "nix-gaming", "nixos-cn": "nixos-cn", @@ -1608,10 +1696,10 @@ "nixos-mailserver": "nixos-mailserver", "nixos-rk3588": "nixos-rk3588", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_10", "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-old": "nixpkgs-old", - "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-unfree": "nixpkgs-unfree", "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", @@ -1625,27 +1713,6 @@ } }, "rust-overlay": { - "inputs": { - "nixpkgs": [ - "agenix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741400194, - "narHash": "sha256-tEpgT+q5KlGjHSm8MnINgTPErEl8YDzX3Eps8PVc09g=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "16b6045a232fea0e9e4c69e55a6e269607dd8e3f", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { "inputs": { "nixpkgs": [ "helix", @@ -1666,7 +1733,7 @@ "type": "github" } }, - "rust-overlay_3": { + "rust-overlay_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -1778,21 +1845,6 @@ "type": "github" } }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "waybar": { "inputs": { "flake-compat": "flake-compat_7", @@ -1846,6 +1898,39 @@ "type": "github" } }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1759707084, + "narHash": "sha256-0pkftKs6/LReNvxw7DVTN2AJEheZVgyeK0Aarbagi70=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "a9188e70bd748118b4d56a529871b9de5adb9988", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + }, "yek": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 85a7535..1a1a8bd 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,10 @@ inputs.nixpkgs.follows = "nixpkgs"; }; flake-utils.url = "github:numtide/flake-utils"; - + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; #secure book @@ -28,6 +31,24 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + niri = { + url = "github:sodiboo/niri-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dgop = { + url = "github:AvengeMedia/dgop"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dms-cli = { + url = "github:AvengeMedia/danklinux"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + dankMaterialShell = { + url = "github:AvengeMedia/DankMaterialShell"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.dgop.follows = "dgop"; + inputs.dms-cli.follows = "dms-cli"; + }; # claude-desktop = { # url = "git:file:/home/y/code/nix/claude-desktop-linux-flake"; # inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/base.nix b/hosts/base.nix index 054a967..0f574ea 100644 --- a/hosts/base.nix +++ b/hosts/base.nix @@ -28,12 +28,14 @@ "https://polwex.cachix.org" "https://nix-community.cachix.org" "https://nix-gaming.cachix.org" + "https://nixpkgs-wayland.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "polwex.cachix.org-1:6Qk8lW0wZ9omwmURpPQUEDUHAb6Nsb+f+pdH2hppBZY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" ]; keep-outputs = true; diff --git a/hosts/local/gui.nix b/hosts/local/gui.nix index 26adeb1..a57ab1e 100644 --- a/hosts/local/gui.nix +++ b/hosts/local/gui.nix @@ -18,8 +18,6 @@ ffmpeg-full nv-codec-headers # - obsidian - # smplayer #browsers brave @@ -55,5 +53,8 @@ # xdg whatever bs glib # gio desktop-file-utils + # + xorg.xhost + gparted ]; } diff --git a/hosts/local/keyboards/thinkpad-numpad.kbd b/hosts/local/keyboards/thinkpad-numpad.kbd new file mode 100644 index 0000000..ed4bf8b --- /dev/null +++ b/hosts/local/keyboards/thinkpad-numpad.kbd @@ -0,0 +1,102 @@ +;; 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 insert del f13 f14 f15 f16 + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q w e r t y u i o p [ ] \ kp7 kp8 kp9 kp+ + caps a s d f g h j k l ; ' ret kp4 kp5 kp6 + lsft z x c v b n m , . / rsft kp1 kp2 kp3 kprt + lctl lmet lalt spc ralt ssrq rctl pgup up pgdn kp0 kp. + left down rght +);; 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 + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end insert del = \( \) bspc + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q w e r t y u i o p [ ] \ kp7 kp8 kp9 kp+ + esc a s d f g h j k l ; ' ret kp4 kp5 kp6 + @sym z x c v b n m , . / rsft kp1 kp2 kp3 kprt + lctl lmet lalt spc @cords ssrq @hrt pgup up pgdn kp0 kp. + left down rght +) +(deflayer homerowmods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end insert del = \( \) bspc + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q w e r t y u i o p [ ] \ kp7 kp8 kp9 kp+ + esc @a @s @d @f g h @j @k @l @semi ' ret kp4 kp5 kp6 + @sym z x c v b n m , . / rsft kp1 kp2 kp3 kprt + caps lmet @sym spc lalt ssrq @back pgup up pgdn kp0 kp. + left down rght +) +(deflayer mods + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end insert del = \( \) bspc + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q w e r t y u i o p [ ] \ kp7 kp8 kp9 kp+ + esc lctl lalt lmet lsft g h rsft rmet ralt rctl ' ret kp4 kp5 kp6 + @sym z x c v b n m , . / rsft kp1 kp2 kp3 kprt + caps lmet @sym spc lalt ssrq @back pgup up pgdn kp0 kp. + left down rght +) +;; A layer dedicated to symbols +(deflayer syms + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end insert del = \( \) bspc + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q up e r t ! @ # $ % [ ] \ kp7 kp8 kp9 kp+ + esc left down right @sym2 g ' ^ & - = ' ret kp4 kp5 kp6 + @sym z x c v b \( [ { < \ rsft kp1 kp2 kp3 kprt + caps lmet @sym spc lalt ssrq @back pgup up pgdn kp0 kp. + left down rght +) +(deflayer syms2 + esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 home end insert del = \( \) bspc + ` 1 2 3 4 5 6 7 8 9 0 - = bspc nlck kp/ kp* kp- + tab q up e r t ! @ # $ % [ ] \ kp7 kp8 kp9 kp+ + esc left down right @sym2 g ` ~ * \_ + ' ret kp4 kp5 kp6 + @sym z x c v b \) ] } > | rsft kp1 kp2 kp3 kprt + caps lmet @sym spc lalt ssrq @back pgup up pgdn kp0 kp. + left down rght +) diff --git a/hosts/local/niri.nix b/hosts/local/niri.nix index 7db141e..be92df0 100644 --- a/hosts/local/niri.nix +++ b/hosts/local/niri.nix @@ -3,6 +3,9 @@ pkgs, ... }: { + # nixpkgs.overlays = [ + # inputs.nixpkgs-wayland.overlay + # ]; nixpkgs.config.packageOVerrides = pkgs: { intel-vaapi-driver = pkgs.intel-vaapi-driver.override {enableHybridCodec = true;}; vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; @@ -64,23 +67,28 @@ }; }; environment.systemPackages = with pkgs; [ - quickshell - cosmic-panel + # niri specific + # xwayland + xwayland-satellite + # not used if using dank + # quickshell fuzzel + # hypridle + # hyprlock + # cliphist # - cliphist - hypridle - hyprlock - networkmanagerapplet - playerctl - qalculate-gtk - swaynotificationcenter - swayosd - syncthingtray - wl-clipboard - wl-clip-persist - wl-color-picker - wofi-power-menu + # networkmanagerapplet + # playerctl + # qalculate-gtk + # swaynotificationcenter + # swayosd + # syncthingtray + # wl-clipboard + # wl-clip-persist + # wl-color-picker + # wofi-power-menu + # + # cosmic-panel # xdg-utils # xdg-desktop-portal @@ -118,8 +126,8 @@ # gtk_engines # gsettings-desktop-schemas # lxappearance - # adwaita-qt - # adwaita-icon-theme + adwaita-qt + adwaita-icon-theme # libcamera # pipewire seems to want this # easyeffects # tigervnc @@ -132,9 +140,9 @@ # # speechd # # espeak-ng # # espeak-ng-data - # wineWowPackages.waylandFull - # libcamera # pipewire seems to want this - # tracy # cool system watcher + wineWowPackages.waylandFull + libcamera # pipewire seems to want this + # tracy # colinuxol system watcher ]; services.speechd.enable = true; @@ -152,6 +160,7 @@ fcitx5-configtool fcitx5-chinese-addons fcitx5-gtk + libsForQt5.fcitx5-qt ]; waylandFrontend = true; }; diff --git a/hosts/local/p16/configuration.nix b/hosts/local/p16/configuration.nix index e0b81ca..47d7aaa 100644 --- a/hosts/local/p16/configuration.nix +++ b/hosts/local/p16/configuration.nix @@ -5,49 +5,20 @@ inputs, pkgs, ... -}: -# let -# wrappers = -# inputs.wrapper-manager.lib.build -# { -# inherit pkgs; -# modules = [ -# ../../../wrappers/chromium -# ../../../wrappers/brave -# ../../../wrappers/zellij -# ../../../wrappers/alacritty -# ]; -# }; -# in -{ +}: { imports = [ # Include the results of the hardware scan. ../../base.nix ../../linux.nix # ../../syncthing.nix - # ../../unfree.nix - ../wayland.nix + ../../unfree.nix + ../niri.nix ../gui.nix - # ./keyboard.nix + ./keyboard.nix + ../syncthing.nix # ../android.nix ]; - # environment.systemPackages = [ - # wrappers - # ]; - # - - nixpkgs.config = { - allowUnfree = true; - }; - environment = { - etc = { - "sway/config".source = ./swayconfig; - "xdg/waybar/config".source = ./waybarconfig; - "xdg/waybar/styles.css".source = ./waybarstyle.css; - }; - }; - # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -57,7 +28,19 @@ networking = { hostName = "p16"; # Define your hostname. - firewall.enable = false; + # firewall = { + # allowedTCPPorts = [80 443]; + # allowedUDPPortRanges = [ + # { + # from = 4000; + # to = 4007; + # } + # { + # from = 8000; + # to = 8010; + # } + # ]; + # }; }; nix.settings.trusted-users = ["root" "y"]; @@ -65,23 +48,16 @@ time.timeZone = "Asia/Bangkok"; # time.timeZone = "Europe/Madrid"; - # List services that you want to enable: + services.fwupd.enable = true; + # environment.systemPackages = [pkgs.linuxKernel.packages.linux_6_17.tp_smapi]; + services.fprintd.enable = true; services.openssh.enable = true; services.openssh.ports = [5555]; - #flatpak - # services.flatpak.enable = true; - # xdg.portal.enable = true; - #/flatpak - # don't sleep if closed lid; - #services.logind.lidSwitchExternalPower = "ignore"; - #services.logind.lidSwitchDocked = "ignore"; - #services.logind.lidSwitch = "ignore"; - services.tailscale = { enable = true; - useRoutingFeatures = "both"; + useRoutingFeatures = "client"; }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/local/p16/default.nix b/hosts/local/p16/default.nix index edd555a..2ce8fd6 100644 --- a/hosts/local/p16/default.nix +++ b/hosts/local/p16/default.nix @@ -3,4 +3,11 @@ inputs: [ inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p16s-amd-gen4 ./hardware-configuration.nix ./configuration.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = {inputs = inputs;}; + home-manager.users.y = ./home.nix; + } ] diff --git a/hosts/local/p16/home.nix b/hosts/local/p16/home.nix new file mode 100644 index 0000000..99be68a --- /dev/null +++ b/hosts/local/p16/home.nix @@ -0,0 +1,61 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: { + imports = [ + inputs.niri.homeModules.niri + inputs.dankMaterialShell.homeModules.dankMaterialShell.default + inputs.dankMaterialShell.homeModules.dankMaterialShell.niri + ]; + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "y"; + home.homeDirectory = "/home/y"; + # xdg = { + # enable = true; + # autostart.enable = true; + # userDirs = { + # enable = true; + # createDirectories = true; + # }; + # portal = { + # enable = true; + # }; + # }; + + programs.dankMaterialShell = { + enable = true; + + enableClipboard = true; + enableSystemd = true; + enableSystemMonitoring = true; + enableVPN = true; + enableBrightnessControl = true; + # enableNightMode = true; + enableAudioWavelength = true; + enableCalendarEvents = true; + enableDynamicTheming = true; + }; + + # gtk.theme.package = pkgs.colloid-gtk-theme; + # gtk.theme.name = "Colloid"; + # gtk.iconTheme = { + # package = lib.mkForce pkgs.colloid-icon-theme; + # name = lib.mkForce "Colloid"; + # }; + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "25.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/hosts/local/p16/keyboard.nix b/hosts/local/p16/keyboard.nix new file mode 100644 index 0000000..f6cfa8c --- /dev/null +++ b/hosts/local/p16/keyboard.nix @@ -0,0 +1,42 @@ +{_pkgs, ...}: { + services.logind.settings.Login = { + # don’t shutdown when power button is short-pressed + HandlePowerKey = "ignore"; + }; + + # config file keeps getting rewritten but I don't know by who + # i18n.inputMethod = { + # enable = true; + # type = "fcitx5"; + # fcitx5.addons = with pkgs; [ + # fcitx5-mozc + # # mozc-ut is better, wat do + # fcitx5-gtk + # libsForQt5.fcitx5-qt + # fcitx5-lua + # fcitx5-configtool + # fcitx5-rime + # ]; + # }; + environment.variables = { + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + FCITX_SOCKET = "default"; + }; + + #kmonad + services.kmonad = { + enable = true; + keyboards = { + myKmonadOutput = { + device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd"; + config = builtins.readFile ../keyboards/thinkpad-numpad.kbd; + }; + 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 ../keyboards/thinkpad-usb.kbd; + }; + }; + }; +} diff --git a/hosts/local/sway.nix b/hosts/local/sway.nix index 4a91216..0fb8020 100644 --- a/hosts/local/sway.nix +++ b/hosts/local/sway.nix @@ -43,8 +43,8 @@ playerctl blueman wdisplays - # inputs.waybar.packages.x86_64-linux.default - waybar + # inputs.waybar.packages.x86_64-linux.default + waybar glxinfo vulkan-tools glmark2 diff --git a/hosts/local/syncthing.nix b/hosts/local/syncthing.nix new file mode 100644 index 0000000..5497bc9 --- /dev/null +++ b/hosts/local/syncthing.nix @@ -0,0 +1,54 @@ +{ + inputs, + pkgs, + ... +}: { + services.syncthing = { + enable = true; + openDefaultPorts = true; + user = "y"; + dataDir = "/home/y/sync"; # default location for new folders + # configDir = "/home/myusername/.config/syncthing"; + key = "/home/y/sync/key.pem"; + cert = "/home/y/sync/cert.pem"; + settings = { + devices = { + "phone" = {id = "TOBQJTK-QWVMMCN-7SJWXTL-FUKM4FB-ZTLGEL7-KEBTTB3-PC3WZOO-FLBW5A2 ";}; + "laptop" = {id = "INHTOYO-WNCIVPD-M27N2DY-2PJWVCV-FWYOCTQ-AWHBVIJ-4PRVAWR-E7PUTQ4";}; + # "desktop" = {id = "DEVICE-ID-GOES-HERE";}; + }; + folders = { + "memes" = { + path = "/home/y/sync/memes"; + devices = ["phone" "laptop"]; + }; + "creds" = { + path = "/home/y/sync/creds"; + devices = ["phone" "laptop"]; + # By default, Syncthing doesn't sync file permissions. This line enables it for this folder. + # ignorePerms = false; + }; + "docs" = { + path = "/home/y/sync/docs"; + devices = ["phone" "laptop"]; + }; + # "Sensitive" = { + # path = "/home/myusername/Sensitive"; + # devices = [ + # # We trust this device to have access + # # to the decrypted contents of this folder. + # "device1" + # # We do not trust this device, but we want to have another + # # (encrypted) copy of the data for redundancy/backup/sync purposes. + # { + # name = "device2"; + # # encryptionPasswordFile is a path to a file containing the encryption password. + # # See below for information about managing secrets on NixOS. + # encryptionPasswordFile = "/run/secrets/st-sensitive-password"; + # } + # ]; + # }; + }; + }; + }; +} diff --git a/hosts/pkgs.nix b/hosts/pkgs.nix index 436851a..0100e4f 100644 --- a/hosts/pkgs.nix +++ b/hosts/pkgs.nix @@ -55,9 +55,10 @@ #nixfmt direnv nix-direnv - # devenv + cachix + devenv devbox - inputs.devenv.packages.${pkgs.system}.default + # inputs.devenv.packages.${pkgs.system}.default bun # scraping python312Packages.yt-dlp @@ -68,28 +69,22 @@ # electrum # yacreader - # ai stuff! - # 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 # - # ai - lmstudio ] ++ lib.optionals pkgs.stdenv.isLinux [ # linuxKernel.packages.linux_latest_libre.cpupower - gparted + parted moreutils busybox usbutils xdg-utils + exfat + exfatprogs #hardware problems lm_sensors linuxKernel.packages.linux_hardened.cpupower diff --git a/hosts/unfree.nix b/hosts/unfree.nix index 30c4a62..9614aa8 100644 --- a/hosts/unfree.nix +++ b/hosts/unfree.nix @@ -13,8 +13,9 @@ # https://stackoverflow.com/questions/77585228/how-to-allow-unfree-packages-in-nix-for-each-situation-nixos-nix-nix-wit environment.systemPackages = with pkgs; [ # opera + obsidian spotify - vscode + # vscode # fonts corefonts # symbola @@ -32,6 +33,7 @@ # fucking vscode requires this for github copilot services.gnome.gnome-keyring.enable = true; + programs.steam = { enable = true; # package = pkgs.steam.override { -- cgit v1.2.3