From 29da8ca94a017423c2c6601aae81f20276000a7c Mon Sep 17 00:00:00 2001 From: cnst Date: Thu, 25 Jul 2024 19:01:42 +0200 Subject: [PATCH] configuring adampad/adam --- flake.lock | 127 +++++++++++++++--- home/core/gui/utility/default.nix | 2 +- home/core/tui/shell/adam.nix | 8 +- home/users/adam/imports.nix | 31 ++--- home/users/cnst/imports.nix | 1 + nixos/hosts/adampad/default.nix | 9 +- .../hosts/adampad/hardware-configuration.nix | 1 - nixos/hosts/adampad/imports.nix | 58 +++++--- nixos/hosts/adampad/system.nix | 6 +- nixos/services/xserver/adampad.nix | 22 +-- 10 files changed, 189 insertions(+), 76 deletions(-) diff --git a/flake.lock b/flake.lock index e3857b30..107e6d5b 100644 --- a/flake.lock +++ b/flake.lock @@ -89,11 +89,11 @@ ] }, "locked": { - "lastModified": 1721783041, - "narHash": "sha256-1QFh73X8yHqwA8hEmryXCajk3HU3NR+Q5bSf6HrSAw8=", + "lastModified": 1721869586, + "narHash": "sha256-q1UcW2tORsyev+oFFNFVUnV1Ah5BAkmEKgbiQkFGeHM=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "d6c0b8797082dafa5d0635f2bac55bdca9d10757", + "rev": "f815559dedafdb4a813dcac757085fc8d6491267", "type": "github" }, "original": { @@ -263,6 +263,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": [ @@ -339,11 +357,11 @@ }, "hardware": { "locked": { - "lastModified": 1721754224, - "narHash": "sha256-JEVfxzZRo+/zdWKBjHpAUG905SDZL9fmoLJxf9b5CGU=", + "lastModified": 1721839713, + "narHash": "sha256-apTv16L9h5ONS2VTPbKEgwAOVmWGku0MsfprjgwBFHo=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "405b654893aba16c8014de6a17e84439d3fb8e46", + "rev": "a7432ebaefc9a400dcda399d48b949230378d784", "type": "github" }, "original": { @@ -359,11 +377,11 @@ ] }, "locked": { - "lastModified": 1721804110, - "narHash": "sha256-i4jINRazBKPqlaS+qhlP+kV/UHEq3vs5itfpblqu4ZM=", + "lastModified": 1721852138, + "narHash": "sha256-JH8N5uoqoVA6erV4O40VtKKHsnfmhvMGbxMNDLtim5o=", "owner": "nix-community", "repo": "home-manager", - "rev": "af70fc502a15d7e1e4c5a4c4fc8e06c2ec561e0c", + "rev": "304a011325b7ac7b8c9950333cd215a7aa146b0e", "type": "github" }, "original": { @@ -523,11 +541,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1721548954, - "narHash": "sha256-7cCC8+Tdq1+3OPyc3+gVo9dzUNkNIQfwSDJ2HSi2u3o=", + "lastModified": 1721686456, + "narHash": "sha256-nw/BnNzATDPfzpJVTnY8mcSKKsz6BJMEFRkJ332QSN0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "63d37ccd2d178d54e7fb691d7ec76000740ea24a", + "rev": "575f3027caa1e291d24f1e9fb0e3a19c2f26d96b", "type": "github" }, "original": { @@ -569,6 +587,22 @@ "type": "github" } }, + "nixpkgs_4": { + "locked": { + "lastModified": 1716097317, + "narHash": "sha256-1UMrLtgzielG/Sop6gl6oTSM4pDt7rF9j9VuxhDWDlY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8535fb92661f37ff9f0da3007fbc942f7d134b41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "devshell": "devshell", @@ -583,11 +617,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1721772245, - "narHash": "sha256-//9p3Qm8gLbPUTsSGN2EMYkDwE5Sqq9B9P2X/z2+npw=", + "lastModified": 1721854976, + "narHash": "sha256-iWTGRfYoq0ppT3P4D2bRDVkLuTZAzuud/gsxVzPTHDg=", "owner": "nix-community", "repo": "nixvim", - "rev": "ab67ee7e8b33e788fc53d26dc6f423f9358e3e66", + "rev": "216d64c158da5523d5b3db0895e1345175c21502", "type": "github" }, "original": { @@ -634,7 +668,8 @@ "nixpkgs": "nixpkgs_3", "nixpkgs-stable": "nixpkgs-stable_2", "nixvim": "nixvim", - "systems": "systems_5" + "systems": "systems_5", + "yazi": "yazi" } }, "rust-overlay": { @@ -662,6 +697,31 @@ "type": "github" } }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "yazi", + "flake-utils" + ], + "nixpkgs": [ + "yazi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716085073, + "narHash": "sha256-3+9gI93XxszWA2+9S2xZfws1QArPX/MC6nahOGpcMB4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "cfc8776011bd83508324115d353222475e1601c0", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1689347949, @@ -737,6 +797,21 @@ "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" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -757,6 +832,26 @@ "repo": "treefmt-nix", "type": "github" } + }, + "yazi": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_4", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1721865264, + "narHash": "sha256-/VFP+pvWWQRj6FBHfZUkaLuC66e2drD87kzBZrbuaZc=", + "owner": "sxyazi", + "repo": "yazi", + "rev": "152b9ea75e12409bbe679be8a712624d1e60eb9f", + "type": "github" + }, + "original": { + "owner": "sxyazi", + "repo": "yazi", + "type": "github" + } } }, "root": "root", diff --git a/home/core/gui/utility/default.nix b/home/core/gui/utility/default.nix index eb756a69..ed522800 100644 --- a/home/core/gui/utility/default.nix +++ b/home/core/gui/utility/default.nix @@ -29,6 +29,6 @@ slurp # select region for screenshot qbittorrent networkmanagerapplet # tray icon for NetworkManager - usbimager + usbimager # write bootable usb images! ]; } diff --git a/home/core/tui/shell/adam.nix b/home/core/tui/shell/adam.nix index 3b719834..81de9c1b 100644 --- a/home/core/tui/shell/adam.nix +++ b/home/core/tui/shell/adam.nix @@ -10,10 +10,10 @@ nixdev = "nix develop ~/.nix-config -c $SHELL"; nixconfig = "cd /home/adam/.nix-config/"; ll = "ls -l"; - nixupdate = "nh os switch -v -H cnix"; - nixup = "nh os switch -H cnix"; - flakeupdate = "nh os switch -u -v -H cnix"; - flakeup = "nh os switch -u -H cnix"; + nixupdate = "nh os switch -v -H adampad"; + nixup = "nh os switch -H adampad"; + flakeupdate = "nh os switch -u -v -H adampad"; + flakeup = "nh os switch -u -H adampad"; }; history = { size = 1000; diff --git a/home/users/adam/imports.nix b/home/users/adam/imports.nix index 07a15a5e..3387c84b 100644 --- a/home/users/adam/imports.nix +++ b/home/users/adam/imports.nix @@ -3,49 +3,41 @@ # core.gui ../../core/gui/gtk ../../core/gui/waybar + # ../../core/gui/ags ../../core/gui/browsers ../../core/gui/xdg ../../core/gui/discord + ../../core/gui/hypr + ../../core/gui/utility # core.tui - ../../core/tui/git/adam.nix + ../../core/tui/git/cnst.nix ../../core/tui/shell/adam.nix ../../core/tui/foot + ../../core/tui/alacritty ../../core/tui/neovim + # ../../core/tui/yazi # core.services ../../core/services/mako ../../core/services/polkit ../../core/services/hypr + # ../../core/services/power-monitor ]; home = { packages = with pkgs; [ # misc.gui - file-roller - gnome-calculator - keepassxc - nwg-look - oculante - pavucontrol - qbittorrent virt-manager xfce.thunar + nautilus # misc.tui - alacritty - btop - calcurse - fastfetch - htop ranger + xcur2png # misc.system + bun adwaita-icon-theme - grimblast - hyprpicker - networkmanagerapplet - pamixer qt5.qtwayland qt6.qtwayland - slurp # thefuck wireguard-tools wl-clipboard @@ -57,6 +49,9 @@ BROWSER = "firefox"; EDITOR = "nvim"; TERM = "foot"; + QT_QPA_PLATFORM = "wayland"; + SDL_VIDEODRIVER = "wayland"; + XDG_SESSION_TYPE = "wayland"; }; }; } diff --git a/home/users/cnst/imports.nix b/home/users/cnst/imports.nix index adf6d1d0..c050f6fc 100644 --- a/home/users/cnst/imports.nix +++ b/home/users/cnst/imports.nix @@ -15,6 +15,7 @@ ../../core/tui/foot ../../core/tui/alacritty ../../core/tui/neovim + ../../core/tui/yazi # core.services ../../core/services/mako ../../core/services/polkit diff --git a/nixos/hosts/adampad/default.nix b/nixos/hosts/adampad/default.nix index ca8f178f..69e3e61a 100644 --- a/nixos/hosts/adampad/default.nix +++ b/nixos/hosts/adampad/default.nix @@ -9,7 +9,7 @@ }: let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; in { - users.users.adam = { + users.users.cnst = { isNormalUser = true; shell = pkgs.zsh; # openssh.authorizedKeys.keys = []; @@ -25,6 +25,7 @@ in { "qemu-libvirtd" "kvm" "network" + "gamemode" "adbusers" "rtkit" "users" @@ -72,12 +73,6 @@ in { efi.canTouchEfiVariables = true; }; - # Enable networking - networking = { - networkmanager.enable = true; - hostName = "adampad"; - }; - environment.sessionVariables = { FLAKE = "/home/adam/.nix-config"; }; diff --git a/nixos/hosts/adampad/hardware-configuration.nix b/nixos/hosts/adampad/hardware-configuration.nix index 16c85c84..6b48875a 100644 --- a/nixos/hosts/adampad/hardware-configuration.nix +++ b/nixos/hosts/adampad/hardware-configuration.nix @@ -28,7 +28,6 @@ kernelParams = [ "quiet" "splash" - "amdgpu.ppfeaturemask=0xffffffff" ]; extraModulePackages = []; }; diff --git a/nixos/hosts/adampad/imports.nix b/nixos/hosts/adampad/imports.nix index 2b3abf52..4f90a00b 100644 --- a/nixos/hosts/adampad/imports.nix +++ b/nixos/hosts/adampad/imports.nix @@ -3,32 +3,35 @@ # core ../../core/fonts.nix ../../core/hyprland.nix + ../../core/networking.nix ../../core/zsh.nix # hardware - ../../hardware/adampad.nix + ../../hardware/cnix.nix # locale ../../locale # services - ../../services/blueman.nix - ../../services/dbus.nix - ../../services/gnome-keyring.nix - ../../services/greetd.nix - ../../services/gvfs.nix - ../../services/mullvad.nix - ../../services/openssh.nix - ../../services/pipewire.nix - ../../services/udisks.nix - ../../services/xserver-adampad.nix - ../../services/locate.nix - ../../services/fwupd.nix + ../../services/blueman + ../../services/dbus + ../../services/gnome-keyring + ../../services/greetd + ../../services/gvfs + ../../services/locate + ../../services/mullvad + ../../services/openssh + ../../services/audio + ../../services/power + ../../services/samba + ../../services/udisks + ../../services/fwupd + ../../services/xserver/adampad.nix # extra + # ../../extra/gaming.nix ../../extra/android - #../../extra/gaming.nix - #../../extra/workstation + # ../../extra/workstation # ../../extra/nix-ld ]; @@ -41,13 +44,13 @@ nix-output-monitor nvd sbctl + rocmPackages.rocm-smi # Util anyrun curl fzf gnome-disk-utility - killall lazygit ntfs3g p7zip @@ -74,12 +77,33 @@ gcc gnumake cmake - hyprlang python3 python312Packages.httplib2 python312Packages.oauth2 gtk3 gtk4 + + # misc.language_servers + typescript-language-server + typescript + nixd + nil + statix + hyprlang + alejandra + nixpkgs-fmt + pyright + isort + rustfmt + rust-analyzer + clippy + lua-language-server + stylua + nodePackages_latest.nodejs + nodePackages.prettier + prettierd + black + vimPlugins.nvim-treesitter-parsers.typescript ]; }; } diff --git a/nixos/hosts/adampad/system.nix b/nixos/hosts/adampad/system.nix index 00995ab6..b47f53a5 100644 --- a/nixos/hosts/adampad/system.nix +++ b/nixos/hosts/adampad/system.nix @@ -11,7 +11,11 @@ flake = "/home/adam/.nix-config"; }; }; - security.rtkit.enable = true; + + security = { + rtkit.enable = true; + pam.services.hyprlock = {}; + }; environment.localBinInPath = true; diff --git a/nixos/services/xserver/adampad.nix b/nixos/services/xserver/adampad.nix index ab27b7d1..6c717260 100644 --- a/nixos/services/xserver/adampad.nix +++ b/nixos/services/xserver/adampad.nix @@ -2,16 +2,16 @@ services.xserver = { enable = true; videoDrivers = ["amdgpu"]; - xkb = { - extraLayouts.hhkbse = { - description = "HHKBse by cnst"; - languages = ["se"]; - symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse; - }; - layout = "hhkbse"; - # dir = "/home/cnst/.nix-config/nixos/xkb"; - variant = ""; - options = "lv3:rwin_switch"; - }; + # xkb = { + # extraLayouts.hhkbse = { + # description = "HHKBse by cnst"; + # languages = ["se"]; + # symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse; + # }; + # layout = "hhkbse"; + # # dir = "/home/cnst/.nix-config/nixos/xkb"; + # variant = ""; + # options = "lv3:rwin_switch"; + # }; }; }