commit e706230566f47fd01fc1f97ced490f652c9e5971 Author: Jurn Wubben Date: Fri Feb 14 19:40:27 2025 +0000 Working config for fw13 amd diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a10d2fb --- /dev/null +++ b/flake.lock @@ -0,0 +1,450 @@ +{ + "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1736852337, + "narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1736899990, + "narHash": "sha256-S79Hqn2EtSxU4kp99t8tRschSifWD4p/51++0xNWUxw=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "91ca1f82d717b02ceb03a3f423cbe8082ebbb26d", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1738453229, + "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "stylix", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735882644, + "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "stylix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1732369855, + "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "47.2", + "repo": "gnome-shell", + "type": "github" + } + }, + "hm": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1739470101, + "narHash": "sha256-NxNe32VB4XI/xIXrsKmIfrcgtEx5r/5s52pL3CpEcA4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5031c6d2978109336637977c165f82aa49fa16a7", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737630279, + "narHash": "sha256-wJQCxyMRc4P26zDrHmZiRD5bbfcJpqPG3e2djdGG3pk=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0db5c8bfcce78583ebbde0b2abbc95ad93445f7c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1739478914, + "narHash": "sha256-qljqSeAWOFbd6HNg8Ey28RdZYdVN8bMb6HJK7uqCKZ0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6f9b8ea84c04411c48ab5aab4620ab204936d9fc", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1738452942, + "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1736798957, + "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "hm": "hm", + "nixpkgs": "nixpkgs", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "git-hooks": "git-hooks", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2", + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1739375014, + "narHash": "sha256-0fNbvZ1Dod4rDIfwGnC7CzJ3wRFSF1v5AvNCmNkVgXo=", + "owner": "danth", + "repo": "stylix", + "rev": "e86de61bb8f5f2b6459d0be3e3291ad16db4b777", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1737565458, + "narHash": "sha256-y+9cvOA6BLKT0WfebDsyUpUa/YxKow9hTjBp6HpQv68=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "ae31625ba47aeaa4bf6a98cf11a8d4886f9463d9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1735737224, + "narHash": "sha256-FO2hRBkZsjlIRqzNHCPc/52yxg11kHGA8MEtSun9RwE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "aead506a9930c717ebf81cc83a2126e9ca08fa64", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..dd80b50 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "Nix is here, nix is everywhere, nix is everything."; + + outputs = inputs: + inputs.flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux"]; + imports = [ + ./hosts + ]; + + perSystem = { + config, + pkgs, + ... + }: { + devShells.default = pkgs.mkShell { + packages = [ + pkgs.alejandra + pkgs.git + ]; + name = "dots"; + DIRENV_LOG_FORMAT = ""; + }; + + formatter = pkgs.alejandra; + }; + }; + + inputs = { + # Nixpkgs and other core shit + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small"; # build error unrelated to config. + flake-parts.url = "github:hercules-ci/flake-parts"; + + hm = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Ricing + stylix.url = "github:danth/stylix"; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..7a64878 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,14 @@ +{osConfig, ...}: { + imports = [ + ./wayland + ./shell + ./style + ]; + + home = { + inherit (osConfig.system) stateVersion; + username = "jsw"; + }; + + programs.home-manager.enable = true; +} diff --git a/home/shell/default.nix b/home/shell/default.nix new file mode 100644 index 0000000..799dac2 --- /dev/null +++ b/home/shell/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./fish.nix + ./starship.nix + ./yazi.nix + ./zoxide.nix + ]; +} diff --git a/home/shell/fish.nix b/home/shell/fish.nix new file mode 100644 index 0000000..958da57 --- /dev/null +++ b/home/shell/fish.nix @@ -0,0 +1,3 @@ +{ + programs.fish.enable = true; +} diff --git a/home/shell/starship.nix b/home/shell/starship.nix new file mode 100644 index 0000000..796f0ea --- /dev/null +++ b/home/shell/starship.nix @@ -0,0 +1,3 @@ +{ + programs.starship.enable = true; +} diff --git a/home/shell/yazi.nix b/home/shell/yazi.nix new file mode 100644 index 0000000..2ae4438 --- /dev/null +++ b/home/shell/yazi.nix @@ -0,0 +1,3 @@ +{ + programs.yazi.enable = true; +} diff --git a/home/shell/zoxide.nix b/home/shell/zoxide.nix new file mode 100644 index 0000000..c4b4530 --- /dev/null +++ b/home/shell/zoxide.nix @@ -0,0 +1,3 @@ +{ + programs.zoxide.enable = true; +} diff --git a/home/style/default.nix b/home/style/default.nix new file mode 100644 index 0000000..003aa8f --- /dev/null +++ b/home/style/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + #./pointer.nix + ./stylix.nix + ]; +} diff --git a/home/style/pointer.nix b/home/style/pointer.nix new file mode 100644 index 0000000..2367ce0 --- /dev/null +++ b/home/style/pointer.nix @@ -0,0 +1,12 @@ +# Migrated to stylix. +#{pkgs, ...}: { + # home.pointerCursor = { + # gtk.enable = true; + # x11.enable = true; + # + # name = "Bibata-Modern-Ice"; + # package = pkgs.bibata-cursors; + # size = 21; + # }; + +#} diff --git a/home/style/stylix.nix b/home/style/stylix.nix new file mode 100644 index 0000000..2213ec3 --- /dev/null +++ b/home/style/stylix.nix @@ -0,0 +1,27 @@ +{ + config, + inputs, + pkgs, + ... +}: { + imports = [ + inputs.stylix.homeManagerModules.stylix + ]; + + stylix = { + enable = true; + polarity = "dark"; + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + size = 21; + }; + fonts.monospace = { + name = "DejaVuSansMNerdFontMono-Regular"; + package = pkgs.nerd-fonts.dejavu-sans-mono; + }; + + # base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-frappe.yaml"; + image = ./background.png; + }; +} diff --git a/home/wayland/default.nix b/home/wayland/default.nix new file mode 100644 index 0000000..19458c3 --- /dev/null +++ b/home/wayland/default.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: { + imports = [ + ./fuzzel.nix + ./hyprlock.nix + ./hyprland + ./waybar.nix + ]; + + home.packages = with pkgs; [ + grim + slurp + wl-clipboard + wlr-randr + ]; + + home.sessionVariables = { + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + XDG_SESSION_TYPE = "wayland"; + }; +} diff --git a/home/wayland/fuzzel.nix b/home/wayland/fuzzel.nix new file mode 100644 index 0000000..ba6b182 --- /dev/null +++ b/home/wayland/fuzzel.nix @@ -0,0 +1,13 @@ +{ + config, + pkgs, + lib, + ... +}: { + programs.fuzzel = { + enable = true; + settings.main = { + launch-prefix = "${lib.getExe pkgs.uwsm} app --"; + }; + }; +} diff --git a/home/wayland/hyprland/binds.nix b/home/wayland/hyprland/binds.nix new file mode 100644 index 0000000..2069904 --- /dev/null +++ b/home/wayland/hyprland/binds.nix @@ -0,0 +1,102 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) getExe; + + runOnce = program: "pgrep ${program} || uwsm app -- ${program}"; + uwsm = getExe pkgs.uwsm; + hyprlock = runOnce (getExe pkgs.hyprlock); + + #TODO: Move these functions into a separate lib file. + #TODO: Possibly migrate some of these applications into an option. + #TODO: Stylix + app = app: "${uwsm} app -- ${app}"; + appE = appE: app (getExe appE); + termapp = termapp: "${foot} '${termapp}'"; + termappE = termappE: termapp (getExe termappE); + + foot = appE pkgs.foot; + fuzzel = appE config.programs.fuzzel.package; + firefox = appE pkgs.firefox; + playerctl = appE pkgs.playerctl; + brightnessctl = appE pkgs.brightnessctl; + wpctl = app "${pkgs.wireplumber}/bin/wpctl"; + + pulsemixer = termappE pkgs.pulsemixer; + bluetui = termappE pkgs.bluetui; + nmtui = termapp "${pkgs.networkmanager}/bin/nmtui"; + + # toggle = program: let + # prog = builtins.substring 0 14 program; + # in "pkill ${prog} || ${uwsm} app -- ${program}"; + + workspaces = builtins.concatLists (builtins.genList ( + x: let + ws = let + c = (x + 1) / 10; + in + builtins.toString (x + 1 - (c * 10)); + in [ + "$mod, ${ws}, workspace, ${toString (x + 1)}" + "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) + 10); +in { + wayland.windowManager.hyprland.settings = { + "$mod" = "ALT"; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + + bind = + [ + "$mod SHIFT, E, exec, uwsm stop" + "$mod, Q, killactive," + "$mod, F, fullscreen," + "$mod, SPACE, togglefloating," + "$mod, O, pseudo," + "$mod ALT, ,resizeactive," + + "$mod, D, exec, ${fuzzel}" + "$mod, Return, exec, ${foot}" + "$mod Shift, Return, exec, ${firefox}" + "$mod, Escape, exec, ${hyprlock}" + + "$mod, A, exec, ${pulsemixer}" + "$mod, B, exec, ${bluetui}" + "$mod, N, exec, ${nmtui}" + + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + ] + ++ workspaces; + + bindl = [ + # media controls + ", XF86AudioPlay, exec, ${playerctl} play-pause" + ", XF86AudioPrev, exec, ${playerctl} previous" + ", XF86AudioNext, exec, ${playerctl} next" + + # volume + ", XF86AudioMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ]; + + bindle = [ + # volume + ", XF86AudioRaiseVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%+" + ", XF86AudioLowerVolume, exec, ${wpctl} set-volume -l '1.0' @DEFAULT_AUDIO_SINK@ 6%-" + ",XF86MonBrightnessUp, exec, ${brightnessctl} s 10%+" + ",XF86MonBrightnessDown, exec, ${brightnessctl} s 10%-" + ]; + }; +} diff --git a/home/wayland/hyprland/default.nix b/home/wayland/hyprland/default.nix new file mode 100644 index 0000000..8364acf --- /dev/null +++ b/home/wayland/hyprland/default.nix @@ -0,0 +1,28 @@ +{ + lib, + pkgs, + ... +}: let + inherit (lib) getExe; + + uwsm = getExe pkgs.uwsm; + hyprlock = getExe pkgs.hyprlock; +in { + imports = [ + ./binds.nix + ./settings.nix + ]; + + wayland.windowManager.hyprland = { + enable = true; + settings = { + env = [ + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + ]; + exec-once = [ + "${uwsm} finalize" + "${hyprlock}" # Lock screen + ]; + }; + }; +} diff --git a/home/wayland/hyprland/settings.nix b/home/wayland/hyprland/settings.nix new file mode 100644 index 0000000..beba136 --- /dev/null +++ b/home/wayland/hyprland/settings.nix @@ -0,0 +1,88 @@ +{ + wayland.windowManager.hyprland.settings = { + general = { + gaps_in = 5; + gaps_out = 5; + border_size = 1; + + resize_on_border = true; + }; + + decoration = { + rounding = 10; + rounding_power = 3; + blur = { + enabled = true; + brightness = 1.0; + contrast = 1.0; + noise = 0.01; + + vibrancy = 0.2; + vibrancy_darkness = 0.5; + + passes = 4; + size = 7; + + popups = true; + popups_ignorealpha = 0.2; + }; + + shadow = { + enabled = true; + ignore_window = true; + offset = "0 15"; + range = 100; + render_power = 2; + scale = 0.97; + }; + }; + + animations = { + enabled = true; + animation = [ + "border, 1, 2, default" + "fade, 1, 4, default" + "windows, 1, 3, default, popin 80%" + "workspaces, 1, 2, default, slide" + ]; + }; + + group = { + groupbar = { + font_size = 10; + gradients = false; + }; + }; + + input = { + repeat_rate = 60; + repeat_delay = 200; + kb_layout = "us"; + follow_mouse = 1; + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + kb_options = "compose:ralt"; + + touchpad = { + natural_scroll = false; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_forever = true; + workspace_swipe_direction_lock = false; + }; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + misc = { + disable_autoreload = true; + force_default_wallpaper = 0; + animate_mouse_windowdragging = false; + vrr = 1; + }; + }; +} diff --git a/home/wayland/hyprlock.nix b/home/wayland/hyprlock.nix new file mode 100644 index 0000000..f79f7eb --- /dev/null +++ b/home/wayland/hyprlock.nix @@ -0,0 +1,88 @@ +{ + config, + inputs, + pkgs, + ... +}: { + programs.hyprlock = { + enable = true; + + settings = { + general = { + disable_loading_bar = true; + immediate_render = true; + hide_cursor = false; + no_fade_in = true; + }; + + # background = [ + # { + # monitor = ""; + # path = config.theme.wallpaper; + # } + # ]; + + # input-field = [ + # { + # size = "300, 50"; + # valign = "bottom"; + # position = "0%, 10%"; + # + # outline_thickness = 1; + # + # # font_color = "rgb(b6c4ff)"; + # # outer_color = "rgba(180, 180, 180, 0.5)"; + # # inner_color = "rgba(200, 200, 200, 0.1)"; + # # check_color = "rgba(247, 193, 19, 0.5)"; + # # fail_color = "rgba(255, 106, 134, 0.5)"; + # + # fade_on_empty = false; + # placeholder_text = "Enter Password"; + # + # dots_spacing = 0.2; + # dots_center = true; + # dots_fade_time = 100; + # + # # shadow_color = "rgba(0, 0, 0, 0.1)"; + # shadow_size = 7; + # shadow_passes = 2; + # } + # ]; + + label = [ + { + monitor = ""; + text = "$TIME"; + font_size = 150; + color = "rgb(b6c4ff)"; + + position = "0%, 30%"; + + valign = "center"; + halign = "center"; + + shadow_color = "rgba(0, 0, 0, 0.1)"; + shadow_size = 20; + shadow_passes = 2; + shadow_boost = 0.3; + } + { + monitor = ""; + text = "cmd[update:3600000] date +'%a %b %d'"; + font_size = 20; + color = "rgb(b6c4ff)"; + + position = "0%, 40%"; + + valign = "center"; + halign = "center"; + + shadow_color = "rgba(0, 0, 0, 0.1)"; + shadow_size = 20; + shadow_passes = 2; + shadow_boost = 0.3; + } + ]; + }; + }; +} diff --git a/home/wayland/waybar.nix b/home/wayland/waybar.nix new file mode 100644 index 0000000..313eceb --- /dev/null +++ b/home/wayland/waybar.nix @@ -0,0 +1,328 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) getExe; + + #TODO: UWSM library mentioned in binds.nix. + hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; + fuzzel = getExe pkgs.fuzzel; + kitty = getExe pkgs.kitty; + + pulsemixer = "${kitty} ${getExe pkgs.pulsemixer}"; + nmtui = "${kitty} ${pkgs.networkmanager}/bin/nmtui"; +in { + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "bottom"; + position = "bottom"; + mod = "dock"; + exclusive = true; + gtk-layer-shell = true; + margin-bottom = -1; + passthrough = false; + height = 41; + modules-left = [ + "custom/os_button" + "hyprland/workspaces" + "wlr/taskbar" + ]; + modules-center = [ + ]; + modules-right = [ + "cpu" + "memory" + "disk" + "tray" + "pulseaudio" + "network" + "battery" + "clock" + ]; + "hyprland/language" = { + format = "{}"; + format-en = "ENG"; + format-ru = "РУС"; + }; + "hyprland/workspaces" = { + icon-size = 32; + spacing = 14; + align = "center"; + justify = "center"; + on-scroll-up = "${hyprctl} dispatch workspace r+1"; + on-scroll-down = "${hyprctl} dispatch workspace r-1"; + }; + "custom/os_button" = { + format = ""; + on-click = fuzzel; + tooltip = false; + }; + cpu = { + interval = 5; + format = " {usage}%"; + max-length = 10; + }; + disk = { + interval = 30; + format = "󰋊 {percentage_used}%"; + path = "/"; + tooltip = true; + unit = "GB"; + tooltip-format = "Available {free} of {total}"; + }; + memory = { + interval = 10; + format = " {percentage}%"; + max-length = 10; + tooltip = true; + tooltip-format = "RAM - {used:0.1f}GiB used"; + }; + "wlr/taskbar" = { + format = "{icon} {title:.17}"; + icon-size = 28; + spacing = 3; + on-click-middle = "close"; + tooltip-format = "{title}"; + ignore-list = [ + ]; + on-click = "activate"; + }; + tray = { + icon-size = 18; + spacing = 3; + }; + clock = { + format = " {:%R\n %d.%m.%Y}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + network = { + format-wifi = " {icon}"; + format-ethernet = " "; + format-disconnected = "󰌙"; + format-icons = [ + "󰤯 " + "󰤟 " + "󰤢 " + "󰤢 " + "󰤨 " + ]; + on-click = nmtui; + }; + battery = { + states = { + good = 95; + warning = 30; + critical = 20; + }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-alt = "{time} {icon}"; + format-icons = [ + "󰂎" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + }; + pulseaudio = { + max-volume = 150; + scroll-step = 10; + format = "{icon}"; + tooltip-format = "{volume}%"; + format-muted = " "; + format-icons = { + default = [ + " " + " " + " " + ]; + }; + on-click = pulsemixer; + }; + }; + }; + style = '' + * { + text-shadow: none; + box-shadow: none; + border: none; + border-radius: 0; + font-family: "DejaVuSansM Nerd Font:style=Regular"; + font-weight: 600; + font-size: 12.7px; + } + + window#waybar { + background: @base00; + border-top: 1px solid @base01; + color: @base05; + } + + tooltip { + background: @base01; + border-radius: 5px; + border-width: 1px; + border-style: solid; + border-color: @base01; + } + tooltip label{ + color: @base05; + } + + #custom-os_button { + font-size: 24px; + padding-left: 12px; + padding-right: 20px; + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + #custom-os_button:hover { + background: @base03; + color: @base05; + } + + #workspaces { + color: transparent; + margin-right: 1.5px; + margin-left: 1.5px; + } + #workspaces button { + padding: 3px; + color: @base04; + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + #workspaces button.active { + color: @base05; + border-bottom: 3px solid white; + } + #workspaces button.focused { + color: @base02; + } + #workspaces button.urgent { + background: rgba(255, 200, 0, 0.35); + border-bottom: 3px dashed @warning_color; + color: @warning_color; + } + #workspaces button:hover { + background: @base03; + color: @base05; + } + + + #taskbar button { + min-width: 130px; + border-bottom: 3px solid rgba(255, 255, 255, 0.3); + margin-left: 2px; + margin-right: 2px; + padding-left: 8px; + padding-right: 8px; + color: white; + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + + #taskbar button.active { + border-bottom: 3px solid white; + background: @base02; + } + + #taskbar button:hover { + border-bottom: 3px solid white; + background: @base03; + color: @base05; + } + + #cpu, #disk, #memory { + padding:3px; + } + + + #window { + border-radius: 10px; + margin-left: 20px; + margin-right: 20px; + } + + #tray{ + margin-left: 5px; + margin-right: 5px; + } + #tray > .passive { + border-bottom: none; + } + #tray > .active { + border-bottom: 3px solid white; + } + #tray > .needs-attention { + border-bottom: 3px solid @warning_color; + } + #tray > widget { + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + #tray > widget:hover { + background: @base03; + } + + #pulseaudio { + font-family: "JetBrainsMono Nerd Font"; + padding-left: 3px; + padding-right: 3px; + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + #pulseaudio:hover { + background: @base03; + } + + #network { + padding-left: 3px; + padding-right: 3px; + } + + #language { + padding-left: 5px; + padding-right: 5px; + } + + #clock { + padding-right: 5px; + padding-left: 5px; + transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1); + } + #clock:hover { + background: @base03; + } + ''; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..58832fd --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,61 @@ +{ + self, + inputs, + lib, + ... +}: let + inherit (inputs.nixpkgs.lib) nixosSystem genAttrs; + + specialArgs = {inherit inputs self;}; + modules = [ + inputs.hm.nixosModules.home-manager + + ../system + ]; +in { + flake = let + systems = [ + "laptop" + ]; + in { + # Systems + nixosConfigurations = genAttrs systems (hostName: + nixosSystem { + inherit specialArgs; + modules = + modules + ++ [ + { + imports = [./${hostName}]; + networking = {inherit hostName;}; + } + ]; + }); + }; + + perSystem = { + # Allows running 'nix run github:jsw08/NixOS' and it'll spin up a vm. + config, + pkgs, + ... + }: let + nixos-vm = nixosSystem { + inherit specialArgs; + modules = + modules + ++ [ + { + networking.hostName = "vm"; + nixpkgs.hostPlatform = pkgs.system; + + boot.plymouth.enable = lib.mkForce false; + } + ]; + }; + in { + apps.default = { + type = "app"; + program = "${nixos-vm.config.system.build.vm}/bin/run-vm-vm"; + }; + }; +} diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix new file mode 100644 index 0000000..2fecfd8 --- /dev/null +++ b/hosts/laptop/default.nix @@ -0,0 +1,23 @@ +{ + imports = [ + ./hardware-configuration.nix + ]; + + services = { + fprintd.enable = true; + udev.extraRules = '' + # Ethernet expansion card support + ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" + ''; + }; + hardware.sensor.iio.enable = true; # brightness sensor + + boot.kernelParams = [ + # There seems to be an issue with panel self-refresh (PSR) that + # causes hangs for users. + # + # https://community.frame.work/t/fedora-kde-becomes-suddenly-slow/58459 + # https://gitlab.freedesktop.org/drm/amd/-/issues/3647 + "amdgpu.dcdebugmask=0x10" + ]; +} diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix new file mode 100644 index 0000000..e7192b8 --- /dev/null +++ b/hosts/laptop/hardware-configuration.nix @@ -0,0 +1,44 @@ +# 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" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/59540469-ecb9-4a68-829b-4cd3ad6e95c3"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/83C9-84B1"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/65190d84-4e34-4905-a317-d750591933e2";} + ]; + + # 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.wlp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/system/core/boot.nix b/system/core/boot.nix new file mode 100644 index 0000000..3851a18 --- /dev/null +++ b/system/core/boot.nix @@ -0,0 +1,33 @@ +{ + pkgs, + config, + ... +}: { + boot = { + bootspec.enable = true; + + initrd = { + systemd.enable = true; + supportedFilesystems = ["ext4"]; + }; + + # use latest kernel + kernelPackages = pkgs.linuxPackages_latest; + + consoleLogLevel = 3; + kernelParams = [ + "quiet" + "systemd.show_status=auto" + "rd.udev.log_level=3" + "plymouth.use-simpledrm" + ]; + + loader = { + # systemd-boot on UEFI + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; + + plymouth.enable = true; + }; +} diff --git a/system/core/default.nix b/system/core/default.nix new file mode 100644 index 0000000..cfc0580 --- /dev/null +++ b/system/core/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./boot.nix + ./users.nix + ]; +} diff --git a/system/core/users.nix b/system/core/users.nix new file mode 100644 index 0000000..aec816d --- /dev/null +++ b/system/core/users.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + users.users.jsw = { + isNormalUser = true; + shell = pkgs.fish; + initialPassword = "changeme"; + extraGroups = [ + "libvirtd" + "NetworkManager" + "plugdev" + "dialout" + "wheel" + ]; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..32849dd --- /dev/null +++ b/system/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./core + ./hardware + ./network + ./nix + ./programs + ./services + ]; +} diff --git a/system/hardware/bluetooth.nix b/system/hardware/bluetooth.nix new file mode 100644 index 0000000..b53e260 --- /dev/null +++ b/system/hardware/bluetooth.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + hardware.bluetooth = { + enable = true; + }; + environment.systemPackages = [pkgs.bluetui]; +} diff --git a/system/hardware/commonGraphics.nix b/system/hardware/commonGraphics.nix new file mode 100644 index 0000000..33907ba --- /dev/null +++ b/system/hardware/commonGraphics.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + hardware.graphics = { + enable = true; + enable32Bit = true; + + extraPackages = with pkgs; [ + libva + vaapiVdpau + libvdpau-va-gl + ]; + extraPackages32 = with pkgs.pkgsi686Linux; [ + vaapiVdpau + libvdpau-va-gl + ]; + }; +} diff --git a/system/hardware/default.nix b/system/hardware/default.nix new file mode 100644 index 0000000..ba5e415 --- /dev/null +++ b/system/hardware/default.nix @@ -0,0 +1,9 @@ +{ + hardware.enableRedistributableFirmware = true; + + imports = [ + ./bluetooth.nix + ./commonGraphics.nix + ./fwupd.nix + ]; +} diff --git a/system/hardware/fwupd.nix b/system/hardware/fwupd.nix new file mode 100644 index 0000000..a62f709 --- /dev/null +++ b/system/hardware/fwupd.nix @@ -0,0 +1,3 @@ +{ + services.fwupd.enable = true; +} diff --git a/system/network/avahi.nix b/system/network/avahi.nix new file mode 100644 index 0000000..c885e9c --- /dev/null +++ b/system/network/avahi.nix @@ -0,0 +1,12 @@ +{ + # network discovery, mDNS + services.avahi = { + enable = true; + nssmdns4 = true; + publish = { + enable = true; + domain = true; + userServices = true; + }; + }; +} diff --git a/system/network/default.nix b/system/network/default.nix new file mode 100644 index 0000000..c169ca9 --- /dev/null +++ b/system/network/default.nix @@ -0,0 +1,28 @@ +# networking configuration +{pkgs, ...}: { + networking = { + # use quad9 with DNS over TLS + nameservers = ["9.9.9.9#dns.quad9.net"]; + + networkmanager = { + enable = true; + dns = "systemd-resolved"; + wifi.powersave = true; + }; + }; + + services = { + openssh = { + enable = true; + settings.UseDns = true; + }; + + # DNS resolver + resolved = { + enable = true; + dnsovertls = "opportunistic"; + }; + }; + + systemd.services.NetworkManager-wait-online.serviceConfig.ExecStart = ["" "${pkgs.networkmanager}/bin/nm-online -q"]; +} diff --git a/system/network/tailscale.nix b/system/network/tailscale.nix new file mode 100644 index 0000000..7ac6b3a --- /dev/null +++ b/system/network/tailscale.nix @@ -0,0 +1,13 @@ +{ + networking.firewall = { + trustedInterfaces = ["tailscale0"]; + # required to connect to Tailscale exit nodes + checkReversePath = "loose"; + }; + + # inter-machine VPN + services.tailscale = { + enable = true; + openFirewall = true; + }; +} diff --git a/system/nix/default.nix b/system/nix/default.nix new file mode 100644 index 0000000..cfcdec5 --- /dev/null +++ b/system/nix/default.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + inputs, + lib, + ... +}: { + imports = [ + ./nh.nix + ./nixpkgs.nix + ./substituters.nix + ]; + + # we need git for flakes + environment.systemPackages = [pkgs.git]; + + nix = let + flakeInputs = lib.filterAttrs (_: v: lib.isType "flake" v) inputs; + in { + package = pkgs.lix; + + # pin the registry to avoid downloading and evaling a new nixpkgs version every time + registry = lib.mapAttrs (_: v: {flake = v;}) flakeInputs; + + # set the path for channels compat + nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + + settings = { + auto-optimise-store = true; + builders-use-substitutes = true; + experimental-features = ["nix-command" "flakes"]; + flake-registry = "/etc/nix/registry.json"; + + # for direnv GC roots + keep-derivations = true; + keep-outputs = true; + + trusted-users = ["root" "@wheel"]; + + accept-flake-config = false; + }; + }; + system.stateVersion = "25.05"; +} diff --git a/system/nix/nh.nix b/system/nix/nh.nix new file mode 100644 index 0000000..df849b8 --- /dev/null +++ b/system/nix/nh.nix @@ -0,0 +1,11 @@ +{ + programs.nh = { + enable = true; + # weekly cleanup + clean = { + enable = true; + extraArgs = "--keep-since 30d"; + }; + flake = "/home/jsw/NixOS"; + }; +} diff --git a/system/nix/nixpkgs.nix b/system/nix/nixpkgs.nix new file mode 100644 index 0000000..d3422e6 --- /dev/null +++ b/system/nix/nixpkgs.nix @@ -0,0 +1,5 @@ +{self, ...}: { + nixpkgs = { + config.allowUnfree = true; + }; +} diff --git a/system/nix/substituters.nix b/system/nix/substituters.nix new file mode 100644 index 0000000..f9d38ef --- /dev/null +++ b/system/nix/substituters.nix @@ -0,0 +1,28 @@ +{ + nix.settings = { + substituters = [ + # high priority since it's almost always used + "https://cache.nixos.org?priority=10" + + # "https://anyrun.cachix.org" + # "https://fufexan.cachix.org" + # "https://helix.cachix.org" + # "https://hyprland.cachix.org" + # "https://nix-community.cachix.org" + # "https://nix-gaming.cachix.org" + # "https://yazi.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + + # "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" + # "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY=" + # "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + # "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + # "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + # "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + # "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" + ]; + }; +} diff --git a/system/programs/default.nix b/system/programs/default.nix new file mode 100644 index 0000000..452a60c --- /dev/null +++ b/system/programs/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ + ./fish.nix + ./fonts.nix + ./games.nix + ./home-manager.nix + ./hyprland.nix + ./xdg.nix + ]; +} diff --git a/system/programs/fish.nix b/system/programs/fish.nix new file mode 100644 index 0000000..958da57 --- /dev/null +++ b/system/programs/fish.nix @@ -0,0 +1,3 @@ +{ + programs.fish.enable = true; +} diff --git a/system/programs/fonts.nix b/system/programs/fonts.nix new file mode 100644 index 0000000..0db7b78 --- /dev/null +++ b/system/programs/fonts.nix @@ -0,0 +1,42 @@ +{} +# Migrated to home-manager stylix. +# {pkgs, ...}: { +# fonts = { +# packages = with pkgs; [ +# # icon fonts +# material-symbols +# +# # Sans(Serif) fonts +# libertinus +# noto-fonts +# noto-fonts-cjk-sans +# noto-fonts-emoji +# roboto +# (google-fonts.override {fonts = ["Inter"];}) +# +# # monospace fonts +# jetbrains-mono +# +# # nerdfonts +# nerd-fonts.jetbrains-mono +# nerd-fonts.symbols-only +# ]; +# +# # causes more issues than it solves +# enableDefaultPackages = false; +# +# # user defined fonts +# # the reason there's Noto Color Emoji everywhere is to override DejaVu's +# # B&W emojis that would sometimes show instead of some Color emojis +# fontconfig.defaultFonts = let +# addAll = builtins.mapAttrs (_: v: v ++ ["Noto Color Emoji"]); +# in +# addAll { +# serif = ["Libertinus Serif"]; +# sansSerif = ["Inter"]; +# monospace = ["JetBrains Mono Nerd Font"]; +# emoji = []; +# }; +# }; +# } + diff --git a/system/programs/games.nix b/system/programs/games.nix new file mode 100644 index 0000000..bc9d3ec --- /dev/null +++ b/system/programs/games.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + programs = { + gamescope = { + enable = true; + capSysNice = true; + args = [ + "--rt" + "--expose-wayland" + ]; + }; + + steam = { + enable = true; + + extraCompatPackages = [ + pkgs.proton-ge-bin + ]; + + gamescopeSession.enable = true; + }; + }; +} diff --git a/system/programs/home-manager.nix b/system/programs/home-manager.nix new file mode 100644 index 0000000..35db2a1 --- /dev/null +++ b/system/programs/home-manager.nix @@ -0,0 +1,15 @@ +{inputs, specialArgs, config, ...}: { + imports = [ + inputs.hm.nixosModules.default + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = specialArgs; + + users.jsw = import ../../home; + }; + + programs.dconf.enable = true; # else gtk-managed stuff won't work +} diff --git a/system/programs/hyprland.nix b/system/programs/hyprland.nix new file mode 100644 index 0000000..6b132c1 --- /dev/null +++ b/system/programs/hyprland.nix @@ -0,0 +1,10 @@ +{pkgs, ...}: { + programs.hyprland = { + enable = true; + withUWSM = true; + }; + environment.systemPackages = [ + pkgs.kitty # This is the default config's terminal and also my main one. + ]; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland. +} diff --git a/system/programs/xdg.nix b/system/programs/xdg.nix new file mode 100644 index 0000000..209796f --- /dev/null +++ b/system/programs/xdg.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + config = { + common.default = ["gtk"]; + hyprland.default = ["gtk" "hyprland"]; + }; + + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + }; +} diff --git a/system/services/default.nix b/system/services/default.nix new file mode 100644 index 0000000..401cbb3 --- /dev/null +++ b/system/services/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./greetd.nix + ./kanata.nix + ./pipewire.nix + ./power.nix + ]; +} diff --git a/system/services/greetd.nix b/system/services/greetd.nix new file mode 100644 index 0000000..47a5684 --- /dev/null +++ b/system/services/greetd.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: { + # greetd display manager + services.greetd = let + session = { + command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop"; + user = "jsw"; + }; + in { + enable = true; + + settings = { + terminal.vt = 1; + default_session = session; + initial_session = session; + }; + }; + + programs.uwsm.enable = true; +} diff --git a/system/services/kanata.nix b/system/services/kanata.nix new file mode 100644 index 0000000..22143a1 --- /dev/null +++ b/system/services/kanata.nix @@ -0,0 +1,39 @@ +{ + # keyboard remapping + services.kanata = { + enable = true; + + keyboards.default = { + # i know this config is aweful but it does the job. + config = '' + (defsrc + caps d w e b h j k l + ) + + (deflayer default + @cap _ _ _ _ _ _ _ _ + ) + + (deflayer arrows + _ @tablayer @nextword @nextword @prevword left down up right + ) + + (deflayer tabs + _ _ _ _ _ @tableft _ _ @tabright + ) + + + (defalias + cap (tap-hold-press 170 170 esc (layer-toggle arrows)) + + nextword (multi lctrl right) + prevword (multi lctrl left) + + tablayer (layer-while-held tabs) + tableft (multi lctrl lshift tab) + tabright (multi lctrl tab) + ) + ''; + }; + }; +} diff --git a/system/services/pipewire.nix b/system/services/pipewire.nix new file mode 100644 index 0000000..c715467 --- /dev/null +++ b/system/services/pipewire.nix @@ -0,0 +1,11 @@ +{lib, ...}: { + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + jack.enable = true; + pulse.enable = true; + }; + + services.pulseaudio.enable = lib.mkForce false; +} diff --git a/system/services/power.nix b/system/services/power.nix new file mode 100644 index 0000000..390611b --- /dev/null +++ b/system/services/power.nix @@ -0,0 +1,10 @@ +{ + services = { + logind = { + powerKey = "suspend-then-hibernate"; + powerKeyLongPress = "poweroff"; + }; + upower.enable = true; + power-profiles-daemon.enable = true; + }; +}