diff --git a/common/base.nix b/common/base.nix index bfab9599..4c0a2ad0 100644 --- a/common/base.nix +++ b/common/base.nix @@ -45,6 +45,12 @@ openFirewall = true; settings.PasswordAuthentication = false; }; + + udev.extraRules = '' + # Disable Fn Lock for ThinkPad Trackpoint USB/Bluetooth Keyboard + SUBSYSTEM=="hid", DRIVER=="lenovo", ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6047|60ee", ATTR{fn_lock}="0" + SUBSYSTEM=="input", ATTRS{id/vendor}=="17ef", ATTRS{id/product}=="6048|60e1", TEST=="/sys/$devpath/device/fn_lock", RUN+="/bin/sh -c 'echo 0 > \"/sys/$devpath/device/fn_lock\"'" + ''; }; sound.enable = true; diff --git a/common/nix.nix b/common/nix.nix index a0b2870b..081b214f 100644 --- a/common/nix.nix +++ b/common/nix.nix @@ -3,7 +3,7 @@ gc = { automatic = true; dates = "daily"; - options = "--delete-older-than 3d"; + options = "--delete-older-than 14d"; persistent = true; randomizedDelaySec = "60min"; }; diff --git a/flake.lock b/flake.lock index 0fe9c7f7..35838c11 100644 --- a/flake.lock +++ b/flake.lock @@ -187,11 +187,11 @@ ] }, "locked": { - "lastModified": 1726775926, - "narHash": "sha256-5zShvCy9S4tuISFjNSjb+TWpPtORqPbRZ0XwbLbPLho=", + "lastModified": 1728334376, + "narHash": "sha256-CTKEKPzD/j8FK6H4DO3EjyixZd3HHvgAgfnCwpGFP5c=", "owner": "nix-community", "repo": "disko", - "rev": "624fd86460e482017ed9c3c3c55a3758c06a4e7f", + "rev": "d39ee334984fcdae6244f5a8e6ab857479cbaefe", "type": "github" }, "original": { @@ -354,11 +354,11 @@ ] }, "locked": { - "lastModified": 1726592409, - "narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=", + "lastModified": 1726989464, + "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=", "owner": "nix-community", "repo": "home-manager", - "rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594", + "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176", "type": "github" }, "original": { @@ -397,11 +397,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1721829827, - "narHash": "sha256-9tB29tP3ZQ2tU2c+FrWrGqSm70ZrJP8H9WZKzHx55zI=", + "lastModified": 1727632156, + "narHash": "sha256-gfH/jcrmI27OEge8OGPe7JpC0jrQJuX7v9hM/ObjjW8=", "owner": "JeanSchoeller", "repo": "iio-hyprland", - "rev": "bbf59e10cbf293e64b765864a324e971fcc06125", + "rev": "bd6be6b7e0fbc8ca1a5ccbf536602838e52c347e", "type": "github" }, "original": { @@ -437,33 +437,13 @@ "type": "github" } }, - "nixhw": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1727183733, - "narHash": "sha256-JyOFDaIHTTpVp1uO/3M4md6KNIXXhcD8ztDlDST0VL8=", - "owner": "alyraffauf", - "repo": "nixhw", - "rev": "42685325fa3ca92404b73221ffc8fae1e1671154", - "type": "github" - }, - "original": { - "owner": "alyraffauf", - "repo": "nixhw", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1726969270, - "narHash": "sha256-8fnFlXBgM/uSvBlLWjZ0Z0sOdRBesyNdH0+esxqizGc=", + "lastModified": 1728500571, + "narHash": "sha256-dOymOQ3AfNI4Z337yEwHGohrVQb4yPODCW9MDUyAc4w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "23cbb250f3bf4f516a2d0bf03c51a30900848075", + "rev": "d51c28603def282a24fa034bcb007e2bcb5b5dd0", "type": "github" }, "original": { @@ -491,11 +471,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1726463316, - "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { @@ -507,11 +487,11 @@ }, "nur": { "locked": { - "lastModified": 1726811691, - "narHash": "sha256-QjeSsVQo6q7gmWpAreIebQC4fLv4cIgQiPsJjgHmb6E=", + "lastModified": 1728626853, + "narHash": "sha256-fqL5vpxgPJa8rU8/leTKnhraXFhIytbTgsYd+o0KUgI=", "owner": "nix-community", "repo": "NUR", - "rev": "cf02274315ba8e91aa8c4bc5e336760af35f42e5", + "rev": "249b147c8b96ea9bfc873723f82f88f61f685bb0", "type": "github" }, "original": { @@ -554,7 +534,6 @@ "home-manager": "home-manager_2", "iio-hyprland": "iio-hyprland", "lanzaboote": "lanzaboote", - "nixhw": "nixhw", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", @@ -666,11 +645,11 @@ "wallpapers": { "flake": false, "locked": { - "lastModified": 1727132619, - "narHash": "sha256-1V9LK/0GwsLjAwedYcW5uXq1y8l4W86Ce2DvrlseLcA=", + "lastModified": 1728177558, + "narHash": "sha256-jD8GijFjpcjKb2O0g73utSoNkk/J8XLK4jFqhjboN44=", "owner": "alyraffauf", "repo": "wallpapers", - "rev": "b86110d079361e785014fdc22eb3684bccf891c9", + "rev": "767fa4a1faa166ed2f18297c013aefbd062432b8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index feef103c..332e7468 100644 --- a/flake.nix +++ b/flake.nix @@ -30,11 +30,6 @@ url = "github:nix-community/lanzaboote/v0.4.1"; }; - nixhw = { - inputs.nixpkgs.follows = "nixpkgs"; - url = "github:alyraffauf/nixhw"; - }; - nur.url = "github:nix-community/NUR"; stylix = { @@ -130,8 +125,7 @@ homeManagerModules = { default = import ./homeManagerModules self; - aly = import ./homes/aly/gui.nix self; - aly-nox = import ./homes/aly/nox.nix self; + aly = import ./homes/aly self; dustin = import ./homes/dustin self; morgan = import ./homes/morgan self; }; @@ -147,6 +141,20 @@ common-tailscale = import ./common/tailscale.nix; common-wifi-profiles = import ./common/wifi.nix; + hw-common-amd-cpu = import ./hwModules/common/gpu/amd; + hw-common-amd-gpu = import ./hwModules/common/cpu/amd; + hw-common-bluetooth = import ./hwModules/common/bluetooth; + hw-common-intel-cpu = import ./hwModules/common/cpu/intel; + hw-common-intel-gpu = import ./hwModules/common/gpu/intel; + hw-common-laptop = import ./hwModules/common/laptop; + hw-common-laptop-amd-gpu = import ./hwModules/common/laptop/amd-gpu.nix; + hw-common-laptop-intel-cpu = import ./hwModules/common/laptop/intel-cpu.nix; + hw-common-ssd = import ./hwModules/common/ssd; + hw-framework-13-amd-7000 = import ./hwModules/framework/13/amd-7000; + hw-framework-13-intel-11th = import ./hwModules/framework/13/intel-11th; + hw-lenovo-yoga-9i-intel-13th = import ./hwModules/lenovo/yoga-9i/intel-13th; + hw-thinkpad-t440p = import ./hwModules/thinkpad/t440p; + nixos = import ./nixosModules self; users = import ./userModules self; }; diff --git a/homes/aly/common.nix b/homes/aly/default.nix similarity index 61% rename from homes/aly/common.nix rename to homes/aly/default.nix index a19804af..4e514709 100644 --- a/homes/aly/common.nix +++ b/homes/aly/default.nix @@ -1,9 +1,28 @@ -{pkgs, ...}: { +self: {pkgs, ...}: { + imports = [ + ./firefox + ./mail + ./secrets.nix + ./windowManagers + self.homeManagerModules.default + self.inputs.agenix.homeManagerModules.default + self.inputs.nur.hmModules.nur + ]; + home = { homeDirectory = "/home/aly"; packages = with pkgs; [ + bitwarden-desktop curl + fractal + nicotine-plus + obsidian + picard + tauon + transmission-remote-gtk + tuba + vesktop ]; stateVersion = "24.05"; @@ -34,6 +53,7 @@ base_url = "https://passwords.raffauflabs.com"; email = "alyraffauf@fastmail.com"; lock_timeout = 14400; + pinentry = pkgs.pinentry-gnome3; }; }; }; @@ -42,10 +62,17 @@ ar.home = { apps = { + chromium.enable = true; fastfetch.enable = true; + firefox.enable = true; helix.enable = true; + kitty.enable = true; shell.enable = true; + vsCodium.enable = true; yazi.enable = true; }; + + defaultApps.enable = true; + theme.enable = true; }; } diff --git a/homes/aly/gui.nix b/homes/aly/gui.nix deleted file mode 100644 index a822f57b..00000000 --- a/homes/aly/gui.nix +++ /dev/null @@ -1,55 +0,0 @@ -self: {pkgs, ...}: { - imports = [ - ./common.nix - ./firefox - ./mail - ./secrets.nix - ./windowManagers - self.homeManagerModules.default - self.inputs.agenix.homeManagerModules.default - self.inputs.nur.hmModules.nur - ]; - - home = { - homeDirectory = "/home/aly"; - - packages = with pkgs; [ - bitwarden-desktop - fractal - nicotine-plus - obsidian - picard - tauon - transmission-remote-gtk - tuba - vesktop - ]; - - stateVersion = "24.05"; - username = "aly"; - }; - - programs.rbw.settings.pinentry = pkgs.pinentry-gnome3; - systemd.user.startServices = "legacy"; # Needed for auto-mounting agenix secrets. - - ar.home = { - apps = { - chromium.enable = true; - firefox.enable = true; - kitty.enable = true; - vsCodium.enable = true; - }; - - defaultApps = { - enable = true; - fileManager = pkgs.xfce.thunar; - }; - - services.gammastep.enable = true; - - theme = { - enable = true; - borders.radius = 0; - }; - }; -} diff --git a/homes/aly/nox.nix b/homes/aly/nox.nix deleted file mode 100644 index ed5d5255..00000000 --- a/homes/aly/nox.nix +++ /dev/null @@ -1,13 +0,0 @@ -self: {pkgs, ...}: { - imports = [ - ./common.nix - ./secrets.nix - self.homeManagerModules.default - self.inputs.agenix.homeManagerModules.default - ]; - - programs = { - helix.defaultEditor = true; - rbw.settings.pinentry = pkgs.pinentry-tty; - }; -} diff --git a/hosts/fallarbor/default.nix b/hosts/fallarbor/default.nix index b7e3c2db..fcc3374b 100644 --- a/hosts/fallarbor/default.nix +++ b/hosts/fallarbor/default.nix @@ -10,7 +10,6 @@ ./home.nix ./secrets.nix ./stylix.nix - self.inputs.nixhw.nixosModules.framework-13-intel-11th self.nixosModules.common-base self.nixosModules.common-locale self.nixosModules.common-mauville-share @@ -18,6 +17,7 @@ self.nixosModules.common-overlays self.nixosModules.common-pkgs self.nixosModules.common-wifi-profiles + self.nixosModules.hw-framework-13-intel-11th ]; boot.loader = { diff --git a/hosts/fallarbor/home.nix b/hosts/fallarbor/home.nix index 826427be..c400532b 100644 --- a/hosts/fallarbor/home.nix +++ b/hosts/fallarbor/home.nix @@ -1,13 +1,27 @@ -{ - home-manager.sharedModules = [ - { - services.easyeffects = { - enable = true; - preset = "fw13-easy-effects"; - }; +{self, ...}: { + home-manager = { + sharedModules = [ + { + wayland.windowManager.sway.config.output = {"BOE 0x095F Unknown".scale = "1.5";}; - wayland.windowManager.sway.config.output = {"BOE 0x095F Unknown".scale = "1.5";}; - ar.home.desktop.hyprland.laptopMonitors = ["desc:BOE 0x095F,preferred,auto,1.566667"]; - } - ]; + ar.home = { + desktop.hyprland.laptopMonitors = ["desc:BOE 0x095F,preferred,auto,1.566667"]; + + services = { + easyeffects = { + enable = true; + preset = "fw13-easy-effects"; + }; + + gammastep.enable = true; + }; + }; + } + ]; + + users = { + aly = self.homeManagerModules.aly; + dustin = self.homeManagerModules.dustin; + }; + }; } diff --git a/hosts/lavaridge/README.md b/hosts/lavaridge/README.md index 02110527..56a5542c 100644 --- a/hosts/lavaridge/README.md +++ b/hosts/lavaridge/README.md @@ -6,15 +6,15 @@ Framework Laptop 13 with AMD 7000 series mainboard. My primary machine used for ## Todo -- \[ \] upgrade to [2.8k 120Hz Framework screen](https://frame.work/products/display-kit?v=FRANJF0001). +- \[x\] upgrade to [2.8k 120Hz Framework screen](https://frame.work/products/display-kit?v=FRANJF0001). ## Specs | Model | Framework Laptop 13 | |---------|---------------------------| -| Display | 13.5" 2256x1504 60Hz | +| Display | 13.5" 2880x1920 120Hz | | CPU | AMD Ryzen 7640U | -| RAM | 32GB 16GBx2) DDR5-5600Mhz | +| RAM | 32GB 16GBx2 DDR5-5600Mhz | | GPU | AMD Radeon 760M | | Disks | 1TB Sk hynix P41 | diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index 78349f6e..e0d9fd1c 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -10,7 +10,6 @@ ./secrets.nix ./stylix.nix (import ./../../disko/luks-btrfs-subvolumes.nix {disks = ["/dev/nvme0n1"];}) - self.inputs.nixhw.nixosModules.framework-13-amd-7000 self.nixosModules.common-auto-upgrade self.nixosModules.common-base self.nixosModules.common-locale @@ -20,6 +19,7 @@ self.nixosModules.common-pkgs self.nixosModules.common-tailscale self.nixosModules.common-wifi-profiles + self.nixosModules.hw-framework-13-amd-7000 ]; boot = { diff --git a/hosts/lavaridge/home.nix b/hosts/lavaridge/home.nix index 2ed658eb..836b38cf 100644 --- a/hosts/lavaridge/home.nix +++ b/hosts/lavaridge/home.nix @@ -1,27 +1,27 @@ -{lib, ...}: { - home-manager.sharedModules = [ - { - wayland.windowManager.sway.config.output = { - "eDP-1" = { - adaptive_sync = "on"; - scale = "2.0"; - }; - }; - - ar.home = { - desktop.hyprland.laptopMonitors = ["eDP-1,2880x1920@120, 0x0, 2, vrr, 1"]; - - services = { - easyeffects = { - enable = true; - preset = "fw13-easy-effects"; +{self, ...}: { + home-manager = { + sharedModules = [ + { + wayland.windowManager.sway.config.output = { + "eDP-1" = { + adaptive_sync = "on"; + scale = "2.0"; }; - - gammastep.enable = lib.mkForce false; }; - theme.borders.radius = lib.mkForce 10; - }; - } - ]; + ar.home = { + desktop.hyprland.laptopMonitors = ["eDP-1,2880x1920@60, 0x0, 2, vrr, 0"]; + + services = { + easyeffects = { + enable = true; + preset = "fw13-easy-effects"; + }; + }; + }; + } + ]; + + users.aly = self.homeManagerModules.aly; + }; } diff --git a/hosts/lavaridge/stylix.nix b/hosts/lavaridge/stylix.nix index fd317ea4..194f2331 100644 --- a/hosts/lavaridge/stylix.nix +++ b/hosts/lavaridge/stylix.nix @@ -6,7 +6,7 @@ stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; - image = "${self.inputs.wallpapers}/wallhaven-mp886k.jpg"; + image = "${self.inputs.wallpapers}/wallhaven-3lyrvy.png"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index cf18d487..00b73df5 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -14,10 +14,6 @@ in { ./raffauflabs.nix ./secrets.nix ./stylix.nix - self.inputs.nixhw.nixosModules.common-amd-cpu - self.inputs.nixhw.nixosModules.common-amd-gpu - self.inputs.nixhw.nixosModules.common-bluetooth - self.inputs.nixhw.nixosModules.common-ssd self.nixosModules.common-auto-upgrade self.nixosModules.common-base self.nixosModules.common-locale @@ -26,6 +22,10 @@ in { self.nixosModules.common-pkgs self.nixosModules.common-tailscale self.nixosModules.common-wifi-profiles + self.nixosModules.hw-common-amd-cpu + self.nixosModules.hw-common-amd-gpu + self.nixosModules.hw-common-bluetooth + self.nixosModules.hw-common-ssd ]; boot = { diff --git a/hosts/mauville/home.nix b/hosts/mauville/home.nix index d022fd91..fe92e671 100644 --- a/hosts/mauville/home.nix +++ b/hosts/mauville/home.nix @@ -33,69 +33,73 @@ } ]; - users.aly = lib.mkForce ({config, ...}: { - imports = [self.homeManagerModules.aly]; + users = { + aly = {config, ...}: { + imports = [self.homeManagerModules.aly]; - age.secrets = { - backblazeKeyId.file = ../../secrets/aly/backblaze/keyId.age; - backblazeKey.file = ../../secrets/aly/backblaze/key.age; - }; + age.secrets = { + backblazeKeyId.file = ../../secrets/aly/backblaze/keyId.age; + backblazeKey.file = ../../secrets/aly/backblaze/key.age; + }; - systemd.user = { - services.backblaze-sync = { - Unit.Description = "Backup to Backblaze."; + systemd.user = { + services.backblaze-sync = { + Unit.Description = "Backup to Backblaze."; - Service = { - Environment = [ - "PATH=${ - lib.makeBinPath (with pkgs; [ - coreutils - backblaze-b2 - ]) - }" - ]; + Service = { + Environment = [ + "PATH=${ + lib.makeBinPath (with pkgs; [ + coreutils + backblaze-b2 + ]) + }" + ]; - ExecStart = "${pkgs.writeShellScript "backblaze-sync" '' - declare -A backups - backups=( - ['/home/aly/pics/camera']="b2://aly-camera" - ['/home/aly/sync']="b2://aly-sync" - ['/mnt/Media/Audiobooks']="b2://aly-audiobooks" - ['/mnt/Media/Music']="b2://aly-music" - ['/mnt/Archive/Movies']="b2://aly-movies" - ['/mnt/Archive/Shows']="b2://aly-shows" - ) + ExecStart = "${pkgs.writeShellScript "backblaze-sync" '' + declare -A backups + backups=( + ['/home/aly/pics/camera']="b2://aly-camera" + ['/home/aly/sync']="b2://aly-sync" + ['/mnt/Media/Audiobooks']="b2://aly-audiobooks" + ['/mnt/Media/Music']="b2://aly-music" + ['/mnt/Archive/Movies']="b2://aly-movies" + ['/mnt/Archive/Shows']="b2://aly-shows" + ) - backblaze-b2 authorize_account `cat ${config.age.secrets.backblazeKeyId.path}` `cat ${config.age.secrets.backblazeKey.path}` + backblaze-b2 authorize_account `cat ${config.age.secrets.backblazeKeyId.path}` `cat ${config.age.secrets.backblazeKey.path}` - # Recursively backup folders to B2 with sanity checks. - for folder in "''${!backups[@]}"; do - if [ -d "$folder" ] && [ "$(ls -A "$folder")" ]; then - backblaze-b2 sync --delete $folder ''${backups[$folder]} - else - echo "$folder does not exist or is empty." - exit 1 - fi - done - ''}"; + # Recursively backup folders to B2 with sanity checks. + for folder in "''${!backups[@]}"; do + if [ -d "$folder" ] && [ "$(ls -A "$folder")" ]; then + backblaze-b2 sync --delete $folder ''${backups[$folder]} + else + echo "$folder does not exist or is empty." + exit 1 + fi + done + ''}"; + }; + }; + + timers.backblaze-sync = { + Install.WantedBy = ["timers.target"]; + Timer.OnCalendar = "*-*-* 03:00:00"; + Unit.Description = "Daily backups to Backblaze."; }; }; - timers.backblaze-sync = { - Install.WantedBy = ["timers.target"]; - Timer.OnCalendar = "*-*-* 03:00:00"; - Unit.Description = "Daily backups to Backblaze."; + wayland.windowManager.hyprland.settings = { + general.layout = lib.mkForce "master"; + + master = { + mfact = 0.40; + orientation = "center"; + }; }; }; - wayland.windowManager.hyprland.settings = { - general.layout = lib.mkForce "master"; - - master = { - mfact = 0.40; - orientation = "center"; - }; - }; - }); + dustin = self.homeManagerModules.dustin; + }; }; } diff --git a/hosts/mauville/stylix.nix b/hosts/mauville/stylix.nix index 194f2331..4c1aeba8 100644 --- a/hosts/mauville/stylix.nix +++ b/hosts/mauville/stylix.nix @@ -5,10 +5,10 @@ }: { stylix = { enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-light-hard.yaml"; image = "${self.inputs.wallpapers}/wallhaven-3lyrvy.png"; imageScalingMode = "fill"; - polarity = "dark"; + polarity = "light"; cursor = { name = "Bibata-Modern-Classic"; diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index 2f7c38b9..5306986c 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -10,7 +10,6 @@ ./secrets.nix ./stylix.nix (import ./../../disko/luks-btrfs-subvolumes.nix {disks = ["/dev/nvme0n1"];}) - self.inputs.nixhw.nixosModules.lenovo-yoga-9i-intel-13th self.nixosModules.common-auto-upgrade self.nixosModules.common-base self.nixosModules.common-locale @@ -20,6 +19,7 @@ self.nixosModules.common-pkgs self.nixosModules.common-tailscale self.nixosModules.common-wifi-profiles + self.nixosModules.hw-lenovo-yoga-9i-intel-13th ]; boot = { diff --git a/hosts/petalburg/home.nix b/hosts/petalburg/home.nix index 90b2ddc9..6f44a188 100644 --- a/hosts/petalburg/home.nix +++ b/hosts/petalburg/home.nix @@ -4,51 +4,59 @@ self, ... }: { - home-manager.sharedModules = [ - { - wayland.windowManager = { - hyprland.settings = { - bind = [ - ",xf86launch2,exec,${lib.getExe pkgs.playerctl} play-pause" - ]; + home-manager = { + sharedModules = [ + { + wayland.windowManager = { + hyprland.settings = { + bind = [ + ",xf86launch2,exec,${lib.getExe pkgs.playerctl} play-pause" + ]; - exec-once = [''${ - lib.getExe self.inputs.iio-hyprland.packages.${pkgs.system}.default - } "desc:Samsung Display Corp. 0x4152"'']; + exec-once = [''${ + lib.getExe self.inputs.iio-hyprland.packages.${pkgs.system}.default + } "desc:Samsung Display Corp. 0x4152"'']; - input = { - tablet.output = "eDP-1"; - touchdevice.output = "eDP-1"; - }; - }; - - sway.config = { - input = { - "1386:21186:Wacom_HID_52C2_Finger" = { - map_to_output = "'Samsung Display Corp. 0x4152 Unknown'"; - }; - - "1386:21186:Wacom_HID_52C2_Pen" = { - map_to_output = "'Samsung Display Corp. 0x4152 Unknown'"; + input = { + tablet.output = "eDP-1"; + touchdevice.output = "eDP-1"; }; }; - keybindings = { - "XF86Launch2" = "exec ${lib.getExe pkgs.playerctl} play-pause"; + sway.config = { + input = { + "1386:21186:Wacom_HID_52C2_Finger" = { + map_to_output = "'Samsung Display Corp. 0x4152 Unknown'"; + }; + + "1386:21186:Wacom_HID_52C2_Pen" = { + map_to_output = "'Samsung Display Corp. 0x4152 Unknown'"; + }; + }; + + keybindings = { + "XF86Launch2" = "exec ${lib.getExe pkgs.playerctl} play-pause"; + }; + + output = {"Samsung Display Corp. 0x4152 Unknown".scale = "2.0";}; + }; + }; + + ar.home = { + desktop.hyprland = { + laptopMonitors = ["desc:Samsung Display Corp. 0x4152,preferred,auto,2,transform,0"]; + + tabletMode = { + enable = true; + switches = ["Lenovo Yoga Tablet Mode Control switch"]; + }; }; - output = {"Samsung Display Corp. 0x4152 Unknown".scale = "2.0";}; + services.gammastep.enable = true; }; - }; + } + ]; - ar.home.desktop.hyprland = { - laptopMonitors = ["desc:Samsung Display Corp. 0x4152,preferred,auto,2,transform,0"]; - - tabletMode = { - enable = true; - switches = ["Lenovo Yoga Tablet Mode Control switch"]; - }; - }; - } - ]; + users.aly = self.homeManagerModules.aly; + }; } diff --git a/hosts/petalburg/stylix.nix b/hosts/petalburg/stylix.nix index 7aeaa884..61bedf74 100644 --- a/hosts/petalburg/stylix.nix +++ b/hosts/petalburg/stylix.nix @@ -6,7 +6,7 @@ stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; - image = "${self.inputs.wallpapers}/wallhaven-jxp18w.jpg"; + image = "${self.inputs.wallpapers}/wallhaven-3lyrvy.png"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index 01f9ff26..2a55cad2 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -10,7 +10,6 @@ ./secrets.nix ./stylix.nix (import ./../../disko/luks-btrfs-subvolumes.nix {disks = ["/dev/sda"];}) - self.inputs.nixhw.nixosModules.thinkpad-t440p self.nixosModules.common-auto-upgrade self.nixosModules.common-base self.nixosModules.common-locale @@ -20,6 +19,7 @@ self.nixosModules.common-pkgs self.nixosModules.common-tailscale self.nixosModules.common-wifi-profiles + self.nixosModules.hw-thinkpad-t440p ]; boot = { @@ -48,10 +48,10 @@ greetd = { enable = true; autologin = "aly"; - session = lib.getExe config.programs.sway.package; + session = lib.getExe config.programs.hyprland.package; }; - sway.enable = true; + hyprland.enable = true; }; laptopMode = true; diff --git a/hosts/rustboro/home.nix b/hosts/rustboro/home.nix index b12e163c..bc98112d 100644 --- a/hosts/rustboro/home.nix +++ b/hosts/rustboro/home.nix @@ -1,16 +1,24 @@ -{ - home-manager.sharedModules = [ - { - wayland.windowManager.sway.config.output = {"LG Display 0x0569 Unknown".scale = "1.25";}; +{self, ...}: { + home-manager = { + sharedModules = [ + { + wayland.windowManager.sway.config.output = {"LG Display 0x0569 Unknown".scale = "1.25";}; - ar.home = { - desktop.hyprland.laptopMonitors = ["desc:LG Display 0x0569,preferred,auto,1.25"]; + ar.home = { + desktop.hyprland.laptopMonitors = ["desc:LG Display 0x0569,preferred,auto,1.25"]; - services.easyeffects = { - enable = true; - preset = "LoudnessEqualizer"; + services = { + easyeffects = { + enable = true; + preset = "LoudnessEqualizer"; + }; + + gammastep.enable = true; + }; }; - }; - } - ]; + } + ]; + + users.aly = self.homeManagerModules.aly; + }; } diff --git a/hosts/slateport/default.nix b/hosts/slateport/default.nix index 403be865..7117f4a0 100644 --- a/hosts/slateport/default.nix +++ b/hosts/slateport/default.nix @@ -8,10 +8,6 @@ ./raffauflabs.nix ./secrets.nix (import ./../../disko/btrfs-subvolumes.nix {disks = ["/dev/sda"];}) - self.inputs.nixhw.nixosModules.common-bluetooth - self.inputs.nixhw.nixosModules.common-intel-cpu - self.inputs.nixhw.nixosModules.common-intel-gpu - self.inputs.nixhw.nixosModules.common-ssd self.nixosModules.common-auto-upgrade self.nixosModules.common-base self.nixosModules.common-locale @@ -21,6 +17,10 @@ self.nixosModules.common-pkgs self.nixosModules.common-tailscale self.nixosModules.common-wifi-profiles + self.nixosModules.hw-common-bluetooth + self.nixosModules.hw-common-intel-cpu + self.nixosModules.hw-common-intel-gpu + self.nixosModules.hw-common-ssd ]; boot = { diff --git a/hosts/slateport/home.nix b/hosts/slateport/home.nix index e8b35fb6..1b74acf6 100644 --- a/hosts/slateport/home.nix +++ b/hosts/slateport/home.nix @@ -3,5 +3,32 @@ self, ... }: { - home-manager.users.aly = lib.mkForce self.homeManagerModules.aly-nox; + home-manager.users.aly = lib.mkForce ( + {pkgs, ...}: { + imports = [self.homeManagerModules.default]; + + home = { + homeDirectory = "/home/aly"; + + packages = with pkgs; [ + curl + ]; + + stateVersion = "24.05"; + username = "aly"; + }; + + programs = { + helix.defaultEditor = true; + home-manager.enable = true; + }; + + ar.home.apps = { + fastfetch.enable = true; + helix.enable = true; + shell.enable = true; + yazi.enable = true; + }; + } + ); } diff --git a/hosts/slateport/raffauflabs.nix b/hosts/slateport/raffauflabs.nix index 0079ab31..fbcf4c11 100644 --- a/hosts/slateport/raffauflabs.nix +++ b/hosts/slateport/raffauflabs.nix @@ -22,6 +22,7 @@ in { "git.${domain}" "music.${domain}" "passwords.${domain}" + "pics.${domain}" "plex.${domain}" "podcasts.${domain}" domain @@ -238,6 +239,26 @@ in { }; }; + "pics.${domain}" = { + enableACME = true; + forceSSL = true; + + locations."/" = { + proxyPass = "http://${ip}:${toString 3001}"; + + extraConfig = '' + client_max_body_size 5000M; + proxy_buffering off; + proxy_redirect http:// https://; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + ''; + }; + }; + "plex.${domain}" = { enableACME = true; forceSSL = true; diff --git a/hwModules/common/bluetooth/default.nix b/hwModules/common/bluetooth/default.nix new file mode 100644 index 00000000..9b88bee7 --- /dev/null +++ b/hwModules/common/bluetooth/default.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + ... +}: { + hardware = { + bluetooth.enable = true; + + pulseaudio = { + enable = lib.mkForce false; + package = pkgs.pulseaudioFull; # Use extra Bluetooth codecs like aptX + + extraConfig = '' + load-module module-bluetooth-discover + load-module module-bluetooth-policy + load-module module-switch-on-connect + ''; + + support32Bit = true; + }; + }; +} diff --git a/hwModules/common/cpu/amd/default.nix b/hwModules/common/cpu/amd/default.nix new file mode 100644 index 00000000..ea8f5069 --- /dev/null +++ b/hwModules/common/cpu/amd/default.nix @@ -0,0 +1,9 @@ +{lib, ...}: { + boot = { + kernelModules = ["kvm-amd"]; + kernelParams = ["amd_pstate=active"]; + }; + + hardware.cpu.amd.updateMicrocode = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hwModules/common/cpu/intel/default.nix b/hwModules/common/cpu/intel/default.nix new file mode 100644 index 00000000..cadcf602 --- /dev/null +++ b/hwModules/common/cpu/intel/default.nix @@ -0,0 +1,5 @@ +{lib, ...}: { + boot.kernelModules = ["kvm-intel"]; + hardware.cpu.intel.updateMicrocode = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hwModules/common/gpu/amd/default.nix b/hwModules/common/gpu/amd/default.nix new file mode 100644 index 00000000..a3d3cc3f --- /dev/null +++ b/hwModules/common/gpu/amd/default.nix @@ -0,0 +1,14 @@ +{...}: { + environment.variables.VDPAU_DRIVER = "radeonsi"; + + hardware.amdgpu = { + initrd.enable = true; + + amdvlk = { + enable = true; + support32Bit.enable = true; + }; + + opencl.enable = true; + }; +} diff --git a/hwModules/common/gpu/intel/default.nix b/hwModules/common/gpu/intel/default.nix new file mode 100644 index 00000000..8671a797 --- /dev/null +++ b/hwModules/common/gpu/intel/default.nix @@ -0,0 +1,32 @@ +{pkgs, ...}: { + boot.initrd.kernelModules = ["i915"]; + + environment.sessionVariables = { + LIBVA_DRIVER_NAME = "iHD"; + VDPAU_DRIVER = "va_gl"; + }; + + hardware = { + intel-gpu-tools.enable = true; + + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + + extraPackages = [ + pkgs.intel-media-driver # LIBVA_DRIVER_NAME=iHD + (pkgs.intel-vaapi-driver.override {enableHybridCodec = true;}) + pkgs.libvdpau-va-gl + ]; + + extraPackages32 = [ + pkgs.driversi686Linux.intel-media-driver # LIBVA_DRIVER_NAME=iHD + (pkgs.driversi686Linux.intel-vaapi-driver.override {enableHybridCodec = true;}) + pkgs.driversi686Linux.libvdpau-va-gl + ]; + }; + }; + + services.xserver.videoDrivers = ["modesetting"]; +} diff --git a/hwModules/common/laptop/amd-gpu.nix b/hwModules/common/laptop/amd-gpu.nix new file mode 100644 index 00000000..ea8f50d4 --- /dev/null +++ b/hwModules/common/laptop/amd-gpu.nix @@ -0,0 +1,2 @@ +{...}: { +} diff --git a/hwModules/common/laptop/default.nix b/hwModules/common/laptop/default.nix new file mode 100644 index 00000000..6d290ce9 --- /dev/null +++ b/hwModules/common/laptop/default.nix @@ -0,0 +1,27 @@ +{ + lib, + pkgs, + ... +}: { + services = { + pipewire.wireplumber.extraConfig = { + # Pipewire eats battery by never disabling the camera. + "10-disable-camera" = { + "wireplumber.profiles" = { + main = { + "monitor.libcamera" = "disabled"; + }; + }; + }; + }; + + power-profiles-daemon.enable = lib.mkDefault true; + + udev.extraRules = '' + SUBSYSTEM=="power_supply", ATTR{online}=="1", ACTION=="change", RUN+="${lib.getExe pkgs.power-profiles-daemon} set balanced" + SUBSYSTEM=="power_supply", ATTR{online}=="0", ACTION=="change", RUN+="${lib.getExe pkgs.power-profiles-daemon} set power-saver" + ''; + + upower.enable = lib.mkDefault true; + }; +} diff --git a/hwModules/common/laptop/intel-cpu.nix b/hwModules/common/laptop/intel-cpu.nix new file mode 100644 index 00000000..115f1026 --- /dev/null +++ b/hwModules/common/laptop/intel-cpu.nix @@ -0,0 +1,4 @@ +{...}: { + powerManagement.powertop.enable = true; + services.thermald.enable = true; +} diff --git a/hwModules/common/ssd/default.nix b/hwModules/common/ssd/default.nix new file mode 100644 index 00000000..d9e3b4da --- /dev/null +++ b/hwModules/common/ssd/default.nix @@ -0,0 +1,3 @@ +{...}: { + services.fstrim.enable = true; +} diff --git a/hwModules/framework/13/amd-7000/default.nix b/hwModules/framework/13/amd-7000/default.nix new file mode 100644 index 00000000..09c55be4 --- /dev/null +++ b/hwModules/framework/13/amd-7000/default.nix @@ -0,0 +1,30 @@ +{ + lib, + pkgs, + ... +}: { + imports = [ + ../../../common/bluetooth + ../../../common/cpu/amd + ../../../common/gpu/amd + ../../../common/laptop + ../../../common/laptop/amd-gpu.nix + ../../../common/ssd + ../../common.nix + ../common.nix + ]; + + boot = { + initrd.availableKernelModules = ["nvme" "sd_mod" "thunderbolt" "usb_storage" "xhci_pci"]; + extraModprobeConfig = '' + options snd_hda_intel power_save=1 + ''; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + }; + + networking.networkmanager = { + enable = true; + wifi.powersave = true; + wifi.backend = "iwd"; + }; +} diff --git a/hwModules/framework/13/common.nix b/hwModules/framework/13/common.nix new file mode 100644 index 00000000..ea8f50d4 --- /dev/null +++ b/hwModules/framework/13/common.nix @@ -0,0 +1,2 @@ +{...}: { +} diff --git a/hwModules/framework/13/intel-11th/default.nix b/hwModules/framework/13/intel-11th/default.nix new file mode 100644 index 00000000..28c2c772 --- /dev/null +++ b/hwModules/framework/13/intel-11th/default.nix @@ -0,0 +1,28 @@ +{ + lib, + pkgs, + ... +}: { + imports = [ + ../../../common/bluetooth + ../../../common/cpu/intel + ../../../common/gpu/intel + ../../../common/laptop + ../../../common/laptop/intel-cpu.nix + ../../../common/ssd + ../../common.nix + ../common.nix + ]; + + boot = { + blacklistedKernelModules = ["cros-usbpd-charger"]; + initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + + kernelParams = [ + "nvme.noacpi=1" # https://community.frame.work/t/linux-battery-life-tuning/6665/156 + ]; + }; + + hardware.acpilight.enable = true; +} diff --git a/hwModules/framework/common.nix b/hwModules/framework/common.nix new file mode 100644 index 00000000..aa7bba01 --- /dev/null +++ b/hwModules/framework/common.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: { + boot = { + extraModulePackages = with config.boot.kernelPackages; [ + framework-laptop-kmod + ]; + + kernelModules = [ + # https://github.com/DHowett/framework-laptop-kmod?tab=readme-ov-file#usage + "cros_ec_lpcs" + "cros_ec" + ]; + }; + + environment.systemPackages = [pkgs.framework-tool] ++ lib.optional (pkgs ? "fw-ectool") pkgs.fw-ectool; + + hardware = { + enableAllFirmware = true; + sensor.iio.enable = true; + }; + + services = { + fprintd.enable = true; + fwupd.enable = true; + + udev.extraRules = '' + # Ethernet expansion card support + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" + ''; + }; +} diff --git a/hwModules/lenovo/common.nix b/hwModules/lenovo/common.nix new file mode 100644 index 00000000..abb1e686 --- /dev/null +++ b/hwModules/lenovo/common.nix @@ -0,0 +1,3 @@ +{...}: { + hardware.enableAllFirmware = true; +} diff --git a/hwModules/lenovo/yoga-9i/common.nix b/hwModules/lenovo/yoga-9i/common.nix new file mode 100644 index 00000000..4562e269 --- /dev/null +++ b/hwModules/lenovo/yoga-9i/common.nix @@ -0,0 +1,3 @@ +{...}: { + hardware.sensor.iio.enable = true; +} diff --git a/hwModules/lenovo/yoga-9i/intel-13th/default.nix b/hwModules/lenovo/yoga-9i/intel-13th/default.nix new file mode 100644 index 00000000..7cc1c0db --- /dev/null +++ b/hwModules/lenovo/yoga-9i/intel-13th/default.nix @@ -0,0 +1,21 @@ +{ + lib, + pkgs, + ... +}: { + imports = [ + ../../../common/bluetooth + ../../../common/cpu/intel + ../../../common/gpu/intel + ../../../common/laptop + ../../../common/laptop/intel-cpu.nix + ../../../common/ssd + ../../common.nix + ../common.nix + ]; + + boot = { + initrd.availableKernelModules = ["nvme" "sd_mod" "thunderbolt" "usb_storage" "xhci_pci"]; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + }; +} diff --git a/hwModules/thinkpad/common.nix b/hwModules/thinkpad/common.nix new file mode 100644 index 00000000..c1380c9d --- /dev/null +++ b/hwModules/thinkpad/common.nix @@ -0,0 +1,10 @@ +{...}: { + hardware = { + enableAllFirmware = true; + + trackpoint = { + enable = true; + emulateWheel = true; + }; + }; +} diff --git a/hwModules/thinkpad/t440p/default.nix b/hwModules/thinkpad/t440p/default.nix new file mode 100644 index 00000000..7858b514 --- /dev/null +++ b/hwModules/thinkpad/t440p/default.nix @@ -0,0 +1,32 @@ +{...}: { + imports = [ + ../../common/bluetooth + ../../common/cpu/intel + ../../common/gpu/intel + ../../common/laptop + ../../common/laptop/intel-cpu.nix + ../../common/ssd + ../common.nix + ]; + + boot = { + extraModprobeConfig = '' + options bbswitch use_acpi_to_detect_card_state=1 + options thinkpad_acpi force_load=1 fan_control=1 + ''; + + initrd.availableKernelModules = [ + "ahci" + "ehci_pci" + "rtsx_pci_sdmmc" + "sd_mod" + "sr_mod" + "usb_storage" + "xhci_pci" + ]; + }; + + powerManagement.cpuFreqGovernor = "ondemand"; + + services.fwupd.enable = true; +} diff --git a/secrets/publicKeys/aly_mossdeep.pub b/secrets/publicKeys/aly_mossdeep.pub new file mode 100644 index 00000000..88dcf195 --- /dev/null +++ b/secrets/publicKeys/aly_mossdeep.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOCrKJ8OtS2JxrPUrTM3ZRPpyo8HX++Fuv/gWIsHoXzO achac@mossdeep diff --git a/userModules/aly/default.nix b/userModules/aly/default.nix index d3e8633b..8c305eae 100644 --- a/userModules/aly/default.nix +++ b/userModules/aly/default.nix @@ -2,14 +2,11 @@ config, lib, pkgs, - self, ... }: { imports = [./syncthing.nix]; config = lib.mkIf config.ar.users.aly.enable { - home-manager.users.aly = self.homeManagerModules.aly; - users.users.aly = { description = "Aly Raffauf"; extraGroups = config.ar.users.defaultGroups; @@ -25,6 +22,7 @@ keyFiles = [ ../../secrets/publicKeys/aly_lavaridge.pub ../../secrets/publicKeys/aly_mauville.pub + ../../secrets/publicKeys/aly_mossdeep.pub ../../secrets/publicKeys/aly_petalburg.pub ../../secrets/publicKeys/aly_rustboro.pub ]; diff --git a/userModules/aly/syncthing.nix b/userModules/aly/syncthing.nix index ff15439f..463fcea2 100644 --- a/userModules/aly/syncthing.nix +++ b/userModules/aly/syncthing.nix @@ -11,6 +11,7 @@ in { services.syncthing = { enable = true; cert = cfg.certFile; + configDir = "${config.services.syncthing.dataDir}/.syncthing"; dataDir = "/home/aly"; key = cfg.keyFile; openDefaultPorts = true; @@ -29,7 +30,7 @@ in { "iphone12" = {id = "SBQNUXS-H4XDJ3E-RBHJPT5-45WDJJA-2U43M4P-23XGUJ7-E3CNNKZ-BXSGIA3";}; # iPhone 12 Pro Max "lavaridge" = {id = "TMMSCVA-MDJTDPC-PC47NUA-2VPLAIB-6S6MEU7-KALIGUJ-AWDUOUU-XD73MAY";}; # Framework 13 AMD "mauville" = {id = "52MTCMC-PKEWSAU-HADMTZU-DY5EKFO-B323P7V-OBXLNTQ-EJY7F7Y-EUWFBQX";}; # Desktop/homelab b - "mossdeep" = {id = "XRIGHMT-54OGBWP-UAAGAJS-LGTRHA2-EMKOMEB-EJEWKZN-GJFK6FO-3O6KQQ4";}; # Steam Deck OLED + "mossdeep" = {id = "3DODR5S-WU6DTH6-Y35QZX7-7OZEOGG-CYVGGCJ-TJ6AOZX-MFDSRCR-NM727A6";}; # Yoga Slim 7x "petalburg" = {id = "ECTD3LW-YZTJIXX-HLQYXT7-UGZSGST-3DDKF72-DJPMDHE-SUYDWIT-ASTKTAE";}; # Yoga 9i "rustboro" = {id = "7CXGPQN-7DYDYJN-DKELOR3-RD4HZUW-SSUDGLZ-WVXYFUT-DPT2MGD-6PO5BQF";}; # Thinkpad t440p "slateport" = {id = "MDJFDUG-UJAXQXI-AMEF2AR-PBMD5QK-Z5ZG6AA-RCJCU3M-GZHQQEA-X2JGOAK";}; # homelab a diff --git a/userModules/dustin/default.nix b/userModules/dustin/default.nix index 2d1f98a4..00b4e34f 100644 --- a/userModules/dustin/default.nix +++ b/userModules/dustin/default.nix @@ -1,12 +1,9 @@ { config, lib, - self, ... }: { config = lib.mkIf config.ar.users.dustin.enable { - home-manager.users.dustin = self.homeManagerModules.dustin; - users.users.dustin = { description = "Dustin Raffauf"; extraGroups = config.ar.users.defaultGroups;