diff --git a/.editorconfig b/.editorconfig index 3853bb8..ce16426 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,6 @@ root=true [*] -indent_style: tab +indent_style: space indent_size: 2 +end_of_line: lf diff --git a/flake.lock b/flake.lock index 62171fe..4199ecd 100644 --- a/flake.lock +++ b/flake.lock @@ -1,8 +1,32 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1714136352, + "narHash": "sha256-BtWQ2Th/jamO1SlD+2ASSW5Jaf7JhA/JLpQHk0Goqpg=", + "owner": "ryantm", + "repo": "agenix", + "rev": "24a7ea390564ccd5b39b7884f597cfc8d7f6f44e", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ + "agenix", "nixpkgs" ] }, @@ -21,14 +45,35 @@ "type": "github" } }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713946171, + "narHash": "sha256-lc75rgRQLdp4Dzogv5cfqOg6qYc5Rp83oedF2t0kDp8=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "230a197063de9287128e2c68a7a4b0cd7d0b50a7", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -55,14 +100,14 @@ }, "flake-utils": { "inputs": { - "systems": "systems" + "systems": "systems_2" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -73,14 +118,14 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -91,14 +136,14 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -109,7 +154,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1681202837, @@ -128,15 +173,36 @@ "home-manager": { "inputs": { "nixpkgs": [ + "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1700814205, - "narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=", + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714043624, + "narHash": "sha256-Xn2r0Jv95TswvPlvamCC46wwNo8ALjRCMBJbGykdhcM=", "owner": "rycee", "repo": "home-manager", - "rev": "aeb2232d7a32530d3448318790534d196bf9427a", + "rev": "86853e31dc1b62c6eeed11c667e8cdd0285d4411", "type": "github" }, "original": { @@ -153,11 +219,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1701998434, - "narHash": "sha256-AHJchP91Lfc6LyxGoiP9zdxUVsVLWeioE+LmJbOUZMM=", + "lastModified": 1714267526, + "narHash": "sha256-92vUWmEZgINBgC2uT39Ihpbc/Ok86iOT2DjPrmrnFnA=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "4d7b6fe4e29c0529d0a5f836ba41b93baa84f9e3", + "rev": "6be0c88ffc813c82a6d3c99129c5cdaed5499468", "type": "github" }, "original": { @@ -175,11 +241,11 @@ ] }, "locked": { - "lastModified": 1701722881, - "narHash": "sha256-Wim+dqT6W6nTdifu/jmToIzD7eCQaCEhDqDp5kexyfM=", + "lastModified": 1714134704, + "narHash": "sha256-jgTn20s3qzar/IqhjQcEO+dIQbT4hBFIloVntiCURkA=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "5ee4fa3515de7b5609e6d161b800d91328a7a143", + "rev": "4fb773cffed9bf1efdabcc01b25637eaeb4e8e9c", "type": "github" }, "original": { @@ -190,27 +256,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1684570954, - "narHash": "sha256-FX5y4Sm87RWwfu9PI71XFvuRpZLowh00FQpIJ1WfXqE=", + "lastModified": 1713805509, + "narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3", + "rev": "1e1dc66fe68972a76679644a5577828b6a7e8be4", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1701952659, - "narHash": "sha256-TJv2srXt6fYPUjxgLAL0cy4nuf1OZD4KuA1TrCiQqg0=", + "lastModified": 1714272655, + "narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b4372c4924d9182034066c823df76d6eaf1f4ec4", + "rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf", "type": "github" }, "original": { @@ -221,11 +287,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1681358109, - "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", "type": "github" }, "original": { @@ -237,11 +303,11 @@ }, "nur": { "locked": { - "lastModified": 1702050342, - "narHash": "sha256-dZzPltI6K4gL9QGUdWmX3j3e2iClZb+C3wG02ksBvcM=", + "lastModified": 1714340308, + "narHash": "sha256-2uX/VxxNTvxa0FZ5yY2BZDmMCtQVocqa6wdOC8YmzDE=", "owner": "nix-community", "repo": "NUR", - "rev": "1a57d132af8e014fb4c2f30588ab61b3655d665e", + "rev": "53a8759e2675301db38ae5cc17aa9b954a936e9c", "type": "github" }, "original": { @@ -252,8 +318,9 @@ }, "root": { "inputs": { - "darwin": "darwin", - "home-manager": "home-manager", + "agenix": "agenix", + "darwin": "darwin_2", + "home-manager": "home-manager_2", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_2", @@ -270,11 +337,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1702001829, - "narHash": "sha256-6gEVidNVqzTb06zIy2Gxhz9m6/jXyAgViRxfgEpZkQ8=", + "lastModified": 1714270637, + "narHash": "sha256-sq/0YEupY9yoRpg9ft8r2sjoRo84MQipionTuk4w1YI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c2a1dd067a928624c1aab36f976758c0722c79bd", + "rev": "44f8738f4b9805f7c60118c48f85da835839311a", "type": "github" }, "original": { @@ -358,13 +425,28 @@ "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" + } + }, "unstable": { "locked": { - "lastModified": 1701718080, - "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { @@ -375,14 +457,14 @@ }, "utils": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -399,11 +481,11 @@ ] }, "locked": { - "lastModified": 1684517665, - "narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=", + "lastModified": 1713958148, + "narHash": "sha256-8PDNi/dgoI2kyM7uSiU4eoLBqUKoA+3TXuz+VWmuCOc=", "owner": "nix-community", "repo": "nixos-vscode-server", - "rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6", + "rev": "fc900c16efc6a5ed972fb6be87df018bcf3035bc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 659c618..421cee7 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,11 @@ rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; + agenix = { + url = "github:ryantm/agenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-wsl = { url = "github:nix-community/NixOS-WSL"; inputs = { @@ -39,6 +44,7 @@ nixpkgs, unstable, nur, + agenix, utils, rust-overlay, nix-vscode-extensions, @@ -98,6 +104,53 @@ specialArgs = {inherit inputs;}; }; + thinkcentre = nixpkgs.lib.nixosSystem { + system = utils.lib.system.x86_64-linux; + modules = [ + self.overlaysModule + home-manager.nixosModules.home-manager + ./modules/common.nix + ./modules/hyprland.nix + ./modules/containers.nix + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.michael = import ./user/environments/nixos/home.nix; + } + + ./machines/thinkcentre/configuration.nix + agenix.nixosModules.default + { + environment.systemPackages = [ + agenix.packages.x86_64-linux.default + ]; + } + ]; + specialArgs = {inherit inputs;}; + }; + + oracle = nixpkgs.lib.nixosSystem { + system = utils.lib.system.x86_64-linux; + modules = [ + home-manager.nixosModules.home-manager + ./modules/nix.nix + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.michael = import ./user/environments/nixos-server/home.nix; + } + agenix.nixosModules.default + { + environment.systemPackages = [ + agenix.packages.x86_64-linux.default + ]; + } + + ./machines/oracle/configuration.nix + ]; + specialArgs = {inherit inputs;}; + }; + # WSL environment work = inputs.nixpkgs.lib.nixosSystem { system = utils.lib.system.x86_64-linux; @@ -127,6 +180,7 @@ home-manager.users.michael = import ./user/environments/mac/home.nix; } + ./modules/yabai.nix ./machines/mac/configuration.nix ]; }; diff --git a/machines/kitchen/configuration.nix b/machines/kitchen/configuration.nix index 19b7d29..54d32b8 100644 --- a/machines/kitchen/configuration.nix +++ b/machines/kitchen/configuration.nix @@ -1,11 +1,4 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix diff --git a/machines/mac/configuration.nix b/machines/mac/configuration.nix index a0f76b2..71faf22 100644 --- a/machines/mac/configuration.nix +++ b/machines/mac/configuration.nix @@ -20,8 +20,6 @@ VISUAL = "nvim"; }; systemPackages = with pkgs; [ - # Terminal - git # Containers colima unstable.docker-client @@ -32,6 +30,10 @@ unstable.spicetify-cli # Java checkstyle + # XCode + cocoapods + # Android Development + android-tools ]; }; @@ -44,6 +46,7 @@ eval `/usr/libexec/path_helper -s` fi ''; + enableGlobalCompInit = false; }; }; @@ -53,35 +56,6 @@ nix-daemon.enable = true; }; - homebrew = { - enable = true; - onActivation = { - # Auto update packages - autoUpdate = true; - # Uninstall not listed packages and casks - cleanup = "zap"; - # Upgrade outdated formulae on activation - upgrade = true; - }; - taps = [ - "ddev/ddev" - "homebrew/cask-fonts" - ]; - brews = [ - "cocoapods" - "openjdk@17" - "bash" # Required for nix-shell to function properly - "ddev/ddev/ddev" - "firefoxpwa" - ]; - casks = [ - "hiddenbar" - "android-platform-tools" - "font-caskaydia-cove-nerd-font" - "gcenx/wine/wineskin" - ]; - }; - nixpkgs = { # Workaround for pyopenssl being marked broken config.allowBroken = true; @@ -95,7 +69,6 @@ options = "--delete-older-than 7d"; }; extraOptions = '' - auto-optimise-store = true experimental-features = nix-command flakes ''; settings.auto-optimise-store = false; diff --git a/machines/oracle/configuration.nix b/machines/oracle/configuration.nix new file mode 100644 index 0000000..7258b2d --- /dev/null +++ b/machines/oracle/configuration.nix @@ -0,0 +1,81 @@ +{ pkgs, config, ... }: { + imports = [ + ./hardware-configuration.nix + ]; + + boot.tmp.cleanOnBoot = true; + zramSwap.enable = true; + + networking.hostName = "oracle"; + networking.domain = "subnet08161027.vcn08161027.oraclevcn.com"; + networking.firewall = { + enable = true; + allowedUDPPorts = [ 51820 ]; + }; + + services.openssh.enable = true; + services.openssh.settings = { + PasswordAuthentication = false; + }; + + environment.systemPackages = with pkgs; [ wireguard-tools ]; + + # Wireguard tunnel + age.secrets.wireguardOracle.file = ../../secrets/wireguard-oracle.age; + networking.wg-quick.interfaces = { + wg0 = { + address = [ "10.0.10.1/24" ]; + listenPort = 51820; + privateKeyFile = config.age.secrets.wireguardOracle.path; + + peers = [ + { + publicKey = "iKJO9Q8LsdCdApapTX9CJmrtAKn1TYhg4YUiBUBPzmo="; + allowedIPs = ["10.0.10.2/32"]; + } + ]; + }; + }; + + programs.zsh.enable = true; + environment.variables.EDITOR = "nvim"; + + users.users.michael = { + isNormalUser = true; + home = "/home/michael"; + description = "Michael Thomas"; + extraGroups = [ "wheel" "networkmanager" ]; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDUYHiTel+RDzygCeNwV25cnBBNioM19EQWqxPC+xq7lNlNcAQ4wi9JIOONVGkshxPXzKZyR3F53Igs9JZr1E9088L52eUp35JhW1pthai82cw1jGkj9wxcKJnU6b7QNDKA+ejPTC/ciFFKytMyPgID0ICzBRQsnj15i4lGvGDgfTQ7qfI2J855H7S7qOpY7cbsGfeoz3f8Ye1FspJFDsNu9QhX05iunBcbni0uLoTtgS5cEBRr7H9RkKR7GCfd4Ae/sp+aeDkLU4aBkEi+A8VLfR74Juia1j/3mAAmkgJKGcBCKUv0ixBGd6XclZmkF8f2Hx0z8mDxJ7U8lsDUSKdvxK7fecsM4F/GTvjrUxV1nLD4SRQ06GtBmGQGDzIn3Nm1URd6gGT9W3486XJsqmGzjuHa5o4WhmBgh/Gs8xUcv7kWD5enrYacBr+HKVJWnnLFp+XfAYaMCT6j/4jc4D9/9hijRbhboICTDxWCWtFgz7QpsO6BQpi/wkR4Ql61vPc= michael@neptune'' + + ''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQr9lluvuGk3qU1bE7HrrZcE36x5hhD5Dat+E4My55aoh+Df/JeuWMPvzS4zLKMsIIZCUX6kbjvTtvWe7gPLflhDOUGI947MK9B01pojDn0LBugz57Ai9fPlG5+AlMWaxWitmP8JB637oxBpqesqxHdiEKW25u9t2qOvjX3kCdcoSYDlW72Xm8ZI9+qKcAlGLnFhiQxM18rjHcZYdn9ZyWRRSC1ocuTqnbh5lsYoMhD+4QWo5LmwMVjr5uix0i+ktqKzENaiDgA/MQIWQrHqUavfjvMRyyQO7bScVTe/PllKFpLOBym2SLC5hD7vG69BBo0dQUto8tAbIgI9Tmv1dx michael@venus'' + ]; + }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 4*1024; + } + ]; + + # Services + services.caddy = { + enable = true; + }; + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.uptime-kuma = { + enable = true; + settings = { + port = "3001"; + }; + }; + + services.caddy.virtualHosts."status.gringotts.michaelt.xyz".extraConfig = '' + reverse_proxy http://localhost:${config.services.uptime-kuma.settings.PORT} + ''; + + system.stateVersion = "23.11"; +} diff --git a/machines/oracle/hardware-configuration.nix b/machines/oracle/hardware-configuration.nix new file mode 100644 index 0000000..25a81a4 --- /dev/null +++ b/machines/oracle/hardware-configuration.nix @@ -0,0 +1,14 @@ +{ modulesPath, ... }: +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + fileSystems."/boot" = { device = "/dev/disk/by-uuid/97E5-76C2"; fsType = "vfat"; }; + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.kernelModules = [ "nvme" ]; + fileSystems."/" = { device = "/dev/mapper/centosvolume-root"; fsType = "xfs"; }; + +} diff --git a/machines/thinkcentre/configuration.nix b/machines/thinkcentre/configuration.nix new file mode 100644 index 0000000..e2bb2bb --- /dev/null +++ b/machines/thinkcentre/configuration.nix @@ -0,0 +1,119 @@ +{ + config, + pkgs, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + networking.hostName = "venus"; # Define your hostname. + networking.nameservers = ["1.1.1.1" "8.8.8.8"]; + networking.firewall = { + enable = true; + interfaces."wg0" = { + allowedTCPPorts = [7654]; + }; + }; + + # Wireguard tunnel to oracle + age.secrets.wireguardThinkcentre.file = ../../secrets/wireguard-thinkcentre.age; + networking.wg-quick.interfaces = { + wg0 = { + address = ["10.0.10.2/32"]; + listenPort = 51820; + privateKeyFile = config.age.secrets.wireguardThinkcentre.path; + + peers = [ + { + publicKey = "sdqT2l1HRe9rDYejJ+luQK8zdC+/KqDuQ1rpvZq/KlQ="; + endpoint = "150.136.162.107:51820"; + allowedIPs = ["10.0.10.1/24"]; + persistentKeepalive = 25; + } + ]; + }; + }; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + AllowUsers = ["michael"]; + }; + }; + + age.secrets.keycloakDb.file = ../../secrets/keycloak-db.age; + services.keycloak = { + enable = true; + settings = { + hostname-url = "https://auth.s.michaelt.xyz"; + hostname-admin-url = "https://auth.s.michaelt.xyz"; + hostname-strict = false; + hostname-strict-https = false; + # proxy-headers = "xforwarded"; + proxy = "edge"; + http-enabled = true; + http-port = 7654; + }; + database.passwordFile = config.age.secrets.keycloakDb.path; + }; + + swapDevices = [ + { + device = "/swapfile"; + priority = 0; + size = 16384; + } + ]; + + programs.zsh.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.michael = { + isNormalUser = true; + description = "Michael Thomas"; + extraGroups = ["wheel" "docker" "podman" "adbusers" "dialout"]; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + # Neptune + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDUYHiTel+RDzygCeNwV25cnBBNioM19EQWqxPC+xq7lNlNcAQ4wi9JIOONVGkshxPXzKZyR3F53Igs9JZr1E9088L52eUp35JhW1pthai82cw1jGkj9wxcKJnU6b7QNDKA+ejPTC/ciFFKytMyPgID0ICzBRQsnj15i4lGvGDgfTQ7qfI2J855H7S7qOpY7cbsGfeoz3f8Ye1FspJFDsNu9QhX05iunBcbni0uLoTtgS5cEBRr7H9RkKR7GCfd4Ae/sp+aeDkLU4aBkEi+A8VLfR74Juia1j/3mAAmkgJKGcBCKUv0ixBGd6XclZmkF8f2Hx0z8mDxJ7U8lsDUSKdvxK7fecsM4F/GTvjrUxV1nLD4SRQ06GtBmGQGDzIn3Nm1URd6gGT9W3486XJsqmGzjuHa5o4WhmBgh/Gs8xUcv7kWD5enrYacBr+HKVJWnnLFp+XfAYaMCT6j/4jc4D9/9hijRbhboICTDxWCWtFgz7QpsO6BQpi/wkR4Ql61vPc= michael@neptune" + # Oracle + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPc/HYsbpVsyoU2n0EiqQ4+3aSiFPtddjPCGK187W24f michael@oracle" + ]; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/machines/thinkcentre/hardware-configuration.nix b/machines/thinkcentre/hardware-configuration.nix new file mode 100644 index 0000000..3a46158 --- /dev/null +++ b/machines/thinkcentre/hardware-configuration.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/2b1793d6-feff-48df-9180-03e8c2bef7bf"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/2082-08EF"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/bluetooth.nix b/modules/bluetooth.nix new file mode 100644 index 0000000..d109ddb --- /dev/null +++ b/modules/bluetooth.nix @@ -0,0 +1,5 @@ +{...}: { + hardware.bluetooth.enable = true; + + services.blueman.enable = true; +} diff --git a/modules/bootloader.nix b/modules/bootloader.nix index b8c0550..760e6d2 100644 --- a/modules/bootloader.nix +++ b/modules/bootloader.nix @@ -4,4 +4,5 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = false; boot.plymouth.enable = true; + boot.kernelParams = ["quiet"]; } diff --git a/modules/common.nix b/modules/common.nix index b3bc209..f74e9ce 100644 --- a/modules/common.nix +++ b/modules/common.nix @@ -1,12 +1,12 @@ { imports = [ - ./auto-upgrades.nix ./avahi.nix + ./bluetooth.nix ./bootloader.nix ./cups.nix ./flatpak.nix ./fonts.nix - ./gnome.nix + ./hosts.nix ./nix.nix ./sound.nix ]; diff --git a/modules/hosts.nix b/modules/hosts.nix new file mode 100644 index 0000000..25b3510 --- /dev/null +++ b/modules/hosts.nix @@ -0,0 +1,5 @@ +{ + networking.hosts = { + "150.136.162.107" = ["oracle"]; + }; +} diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 0000000..0a3243c --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,44 @@ +{pkgs, ...}: { + programs.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + }; + + services.gnome.gnome-keyring.enable = true; + + environment.systemPackages = with pkgs; [ + # Theme + adw-gtk3 + + # Greeter + cage + greetd.gtkgreet + + # Applications + gnome.nautilus + gnome.sushi + gnome.eog + gnome.totem + gnome.cheese + gnome.file-roller + gnome.gnome-weather + gnome.gnome-contacts + gnome.gnome-calendar + gnome.gnome-screenshot + gnome.gnome-dictionary + gnome.gnome-font-viewer + gnome.gnome-system-monitor + ]; + + # Required for Nautilus to work outside GNOME + services.gvfs.enable = true; + + services.greetd = { + enable = true; + settings = { + default_session = { + command = "cage -s -- gtkgreet --command=Hyprland"; + }; + }; + }; +} diff --git a/modules/sound.nix b/modules/sound.nix index 8c32227..e0f7994 100644 --- a/modules/sound.nix +++ b/modules/sound.nix @@ -1,5 +1,20 @@ { # Enable sound. sound.enable = true; - hardware.pulseaudio.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + + # Enable pipewire + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; } diff --git a/modules/yabai.nix b/modules/yabai.nix new file mode 100644 index 0000000..c19a320 --- /dev/null +++ b/modules/yabai.nix @@ -0,0 +1,75 @@ +{...}: { + services.yabai = { + enable = true; + config = { + mouse_follows_focus = "off"; + focus_follows_mouse = "off"; + window_origin_display = "default"; + window_placement = "second_child"; + window_zoom_persist = "on"; + window_shadow = "on"; + window_animation_duration = 0; + window_animation_frame_rate = 120; + window_opacity_duration = 0; + active_window_opacity = 1; + normal_window_opacity = 0; + window_opacity = "off"; + insert_feedback_color = "0xffd75f5f"; + split_ratio = 0; + split_type = "auto"; + auto_balance = "off"; + top_padding = 12; + bottom_padding = 12; + left_padding = 12; + right_padding = 12; + window_gap = 06; + layout = "bsp"; + mouse_modifier = "fn"; + mouse_action1 = "move"; + mouse_action2 = "resize"; + mouse_drop_action = "swap"; + }; + }; + + services.skhd = { + enable = true; + skhdConfig = '' + ctrl + alt - h: yabai -m window --focus west + ctrl + alt - j: yabai -m window --focus south + ctrl + alt - k: yabai -m window --focus north + ctrl + alt - l: yabai -m window --focus east + + cmd + ctrl + alt - h : yabai -m window --warp west + cmd + ctrl + alt - j : yabai -m window --warp south + cmd + ctrl + alt - k : yabai -m window --warp north + cmd + ctrl + alt - l : yabai -m window --warp east + + ctrl + alt - 1 : yabai -m space --focus 1 + ctrl + alt - 2 : yabai -m space --focus 2 + ctrl + alt - 3 : yabai -m space --focus 3 + ctrl + alt - 4 : yabai -m space --focus 4 + ctrl + alt - 5 : yabai -m space --focus 5 + ctrl + alt - 6 : yabai -m space --focus 6 + ctrl + alt - 7 : yabai -m space --focus 7 + ctrl + alt - 8 : yabai -m space --focus 8 + ctrl + alt - 9 : yabai -m space --focus 9 + + ctrl + alt - q: yabai -m window --close + + # 0x21 - [ + # 0x1E - ] + ctrl + alt - 0x21 : yabai -m query --spaces --space \ + | jq -re ".index" \ + | xargs -I{} yabai -m query --windows --space {} \ + | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.y, .id) | nth(index(map(select(.focused == 1))) - 1).id" \ + | xargs -I{} yabai -m window --focus {} + + ctrl + alt - 0x1E : yabai -m query --spaces --space \ + | jq -re ".index" \ + | xargs -I{} yabai -m query --windows --space {} \ + | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.x, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \ + | xargs -I{} yabai -m window --focus {} + + ''; + }; +} diff --git a/secrets/keycloak-db.age b/secrets/keycloak-db.age new file mode 100644 index 0000000..0d2f771 --- /dev/null +++ b/secrets/keycloak-db.age @@ -0,0 +1,6 @@ +age-encryption.org/v1 +-> ssh-ed25519 jBnYqQ 0cD5v5l7JGQmlnM0q7J8VDWrObgphnv3OqSu94BWKUk +XcFJF3Z7bJq87/dbwejxvNWlyXCpXAG8zFsdccP25/Y +--- HfE3zlQE++CyJhcsZ2v9u+lwgdUmNq07ujxK9fqHEfk +?ΖZݻuv|V@sc}دIirgӦ F +{c@[$ \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 0000000..90b4180 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,12 @@ +let + venus = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKlbfu7ApeF0khvdzMSWfDaunI+5zy/BboN7qEE4jWd2 root@venus"; + oracle = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0vHE/b6tKk6I6DwEemIF5VdS/JBXW8eiYIBmnbv5LI root@oracle"; + # systems = [system1]; +in { + # Venus + "wireguard-thinkcentre.age".publicKeys = [venus]; + "keycloak-db.age".publicKeys = [venus]; + + # Oracle + "wireguard-oracle.age".publicKeys = [oracle]; +} diff --git a/secrets/wireguard-oracle.age b/secrets/wireguard-oracle.age new file mode 100644 index 0000000..40d70c6 Binary files /dev/null and b/secrets/wireguard-oracle.age differ diff --git a/secrets/wireguard-thinkcentre.age b/secrets/wireguard-thinkcentre.age new file mode 100644 index 0000000..5373bc4 --- /dev/null +++ b/secrets/wireguard-thinkcentre.age @@ -0,0 +1,6 @@ +age-encryption.org/v1 +-> ssh-ed25519 jBnYqQ 48BjRfCsPvVwt45viGe49ZHISReZTniIK59WeUibHAQ +apkw2ylpsIsiUMKa1fUTZXAoZExcjLhIlKlMehJbl8U +--- n/WIoiJtGUO2zibPTd4/yGaZfiOKjOEMyLCm0L9OxzM +O*X&jic`x::9a1ǎn,Nv3jLzoj4.xkP +̤ \ No newline at end of file diff --git a/user/environments/mac/home.nix b/user/environments/mac/home.nix index 6e16c52..736d849 100644 --- a/user/environments/mac/home.nix +++ b/user/environments/mac/home.nix @@ -1,7 +1,11 @@ {pkgs, ...}: { imports = [ + ../../modules/applications/alacritty.nix + ../../modules/applications/sioyek.nix + ../../modules/zsh.nix ../../modules/dev.nix + ../../modules/emacs.nix ../../modules/git.nix ../../modules/fonts.nix ../../modules/latex.nix @@ -12,12 +16,13 @@ home.packages = with pkgs; [ bitwarden-cli firebird-emu + git-credential-oauth ]; - # Add homebrew applications to path programs.zsh = { + # Needed for nix-shell to have the correct bash version profileExtra = '' - PATH=/opt/homebrew/bin:$PATH + PATH=/run/current-system/sw/bin:$PATH ''; prezto.pmodules = [ "osx" @@ -34,7 +39,10 @@ }; }; - programs.git.extraConfig.credential.helper = "osxkeychain"; + programs.git.extraConfig.credential.helper = [ + "osxkeychain" + "oauth" + ]; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/user/environments/nixos-server/config.nix b/user/environments/nixos-server/config.nix new file mode 100644 index 0000000..1dd1750 --- /dev/null +++ b/user/environments/nixos-server/config.nix @@ -0,0 +1,3 @@ +{ + allowUnfree = true; +} diff --git a/user/environments/nixos-server/home.nix b/user/environments/nixos-server/home.nix new file mode 100644 index 0000000..ffd76fb --- /dev/null +++ b/user/environments/nixos-server/home.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + imports = [ + ../../modules/git.nix + ../../modules/zsh.nix + ]; + + home.packages = with pkgs; [ + lazygit + ]; + + programs.neovim = { + enable = true; + }; + + home.stateVersion = "21.05"; +} diff --git a/user/environments/nixos/home.nix b/user/environments/nixos/home.nix index 0a8a1bf..f31706a 100644 --- a/user/environments/nixos/home.nix +++ b/user/environments/nixos/home.nix @@ -3,9 +3,10 @@ ../../modules/dev.nix ../../modules/firefox.nix ../../modules/fonts.nix + ../../modules/foot.nix ../../modules/git.nix ../../modules/git_nixos.nix - ../../modules/gnome.nix + ../../modules/hyprland.nix ../../modules/nvim.nix ../../modules/vscode.nix ../../modules/zsh.nix diff --git a/user/modules/applications/alacritty.nix b/user/modules/applications/alacritty.nix new file mode 100644 index 0000000..e24e878 --- /dev/null +++ b/user/modules/applications/alacritty.nix @@ -0,0 +1,28 @@ +{ + programs.alacritty = { + enable = true; + settings = { + window = { + decorations = "Buttonless"; + }; + font = { + size = 14; + offset.y = 4; + normal = { + family = "ZedMono Nerd Font"; + style = "Extended Light"; + }; + bold.style = "Extended Bold"; + italic.style = "Extended Italic"; + bold_italic.style = "Extended Bold Italic"; + }; + key_bindings = [ + { + key = "Slash"; + mods = "Control"; + chars = "\\x1f"; + } + ]; + }; + }; +} diff --git a/user/modules/applications/sioyek.nix b/user/modules/applications/sioyek.nix new file mode 100644 index 0000000..e8f5e04 --- /dev/null +++ b/user/modules/applications/sioyek.nix @@ -0,0 +1,5 @@ +{...}: { + programs.sioyek = { + enable = true; + }; +} diff --git a/user/modules/dev.nix b/user/modules/dev.nix index 63203e1..a5dad44 100644 --- a/user/modules/dev.nix +++ b/user/modules/dev.nix @@ -21,8 +21,10 @@ alejandra # Rust (rust-bin.stable.latest.default.override { - extensions = ["rust-src"]; + extensions = ["rust-src" "llvm-tools-preview"]; }) + pkg-config + openssl ]; programs.zsh.initExtra = '' @@ -34,6 +36,15 @@ enable = true; }; + programs.java = { + enable = true; + package = pkgs.jdk21; + }; + + programs.zoxide = { + enable = true; + }; + # Bun Git config programs.git = { attributes = [ diff --git a/user/modules/emacs.nix b/user/modules/emacs.nix new file mode 100644 index 0000000..6424dac --- /dev/null +++ b/user/modules/emacs.nix @@ -0,0 +1,7 @@ +{pkgs, ...}: { + programs.emacs = { + enable = true; + package = pkgs.unstable.emacs; + extraPackages = epkgs: [epkgs.vterm]; + }; +} diff --git a/user/modules/fonts.nix b/user/modules/fonts.nix index c0ddd68..724ad27 100644 --- a/user/modules/fonts.nix +++ b/user/modules/fonts.nix @@ -1,10 +1,7 @@ {pkgs, ...}: { home.packages = with pkgs; [ (nerdfonts.override {fonts = ["FiraCode"];}) - google-fonts inter cascadia-code ]; - - # fonts.fontconfig.enable = true; } diff --git a/user/modules/foot.nix b/user/modules/foot.nix new file mode 100644 index 0000000..25d5697 --- /dev/null +++ b/user/modules/foot.nix @@ -0,0 +1,10 @@ +{...}: { + programs.foot = { + enable = true; + settings = { + main = { + font = "FiraCode Nerd Font:size=12"; + }; + }; + }; +} diff --git a/user/modules/git_nixos.nix b/user/modules/git_nixos.nix index c48e043..6c76c5f 100644 --- a/user/modules/git_nixos.nix +++ b/user/modules/git_nixos.nix @@ -1,9 +1,14 @@ {pkgs, ...}: { - # Use pkgs.gitAndTools.gitFull in order to get libsecret support programs.git = { package = pkgs.gitAndTools.gitFull; extraConfig = { - credential.helper = "libsecret"; + credential.helper = "manager"; + credential.credentialStore = "secretservice"; + credential."git.thomasfmly.org".provider = "generic"; }; }; + + home.packages = with pkgs; [ + git-credential-manager + ]; } diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix new file mode 100644 index 0000000..6e525a9 --- /dev/null +++ b/user/modules/hyprland.nix @@ -0,0 +1,104 @@ +{pkgs, ...}: { + imports = [ + ./waybar + ./wofi + ]; + + home.packages = with pkgs; [ + pavucontrol + swaynotificationcenter + ]; + + wayland.windowManager.hyprland = { + enable = true; + package = pkgs.unstable.hyprland; + settings = { + "$mod" = "SUPER"; + general = { + gaps_in = 5; + gaps_out = 10; + }; + input = { + follow_mouse = 2; + }; + exec-once = [ + "hyprctl setcursor Adwaita 24" + "waybar" + "swaync" + ]; + bind = + [ + # Program launcher + "$mod, SPACE, exec, wofi --show drun" + # Program shortcuts + "$mod, F, exec, firefox" + "$mod, Q, killactive" + "$mod, T, exec, foot" + ", Print, exec, grimblast copy area" + # Windows + "$mod, H, movefocus, l" + "$mod, J, movefocus, d" + "$mod, K, movefocus, u" + "$mod, L, movefocus, r" + # Moving windows + "$mod SHIFT, H, movewindow, l" + "$mod SHIFT, J, movewindow, d" + "$mod SHIFT, K, movewindow, u" + "$mod SHIFT, L, movewindow, r" + ] + ++ ( + # workspaces + # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} + 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) + ); + }; + extraConfig = '' + # will switch to a submap called resize + bind=$mod,R,submap,resize + + # will start a submap called "resize" + submap=resize + + # sets repeatable binds for resizing the active window + binde=,h,resizeactive,-10 0 + binde=,j,resizeactive,0 10 + binde=,k,resizeactive,0 -10 + binde=,l,resizeactive,10 0 + + # use reset to go back to the global submap + bind=,escape,submap,reset + + # will reset the submap, meaning end the current one and return to the global one + submap=reset + ''; + }; + + gtk = { + enable = true; + font.name = "Inter 11"; + theme = { + name = "adw-gtk3-dark"; + package = pkgs.adw-gtk3; + }; + iconTheme = { + name = "Papirus"; + package = pkgs.papirus-icon-theme; + }; + cursorTheme = { + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + size = 24; + }; + }; +} diff --git a/user/modules/latex.nix b/user/modules/latex.nix index a8b8d57..bc6dd01 100644 --- a/user/modules/latex.nix +++ b/user/modules/latex.nix @@ -1,5 +1,13 @@ {pkgs, ...}: { - home.packages = [ - pkgs.texlive.combined.scheme-medium - ]; + programs.texlive = { + enable = true; + extraPackages = tpkgs: { + inherit + (tpkgs) + scheme-medium + csquotes + exam + ; + }; + }; } diff --git a/user/modules/nvim.nix b/user/modules/nvim.nix index 522417e..28678a1 100644 --- a/user/modules/nvim.nix +++ b/user/modules/nvim.nix @@ -20,5 +20,7 @@ ripgrep gnumake gcc + eslint_d + prettierd ]; } diff --git a/user/modules/nvim/lazy-lock.json b/user/modules/nvim/lazy-lock.json index 8fa1bf1..92b61d1 100644 --- a/user/modules/nvim/lazy-lock.json +++ b/user/modules/nvim/lazy-lock.json @@ -1,53 +1,55 @@ { - "LazyVim": { "branch": "main", "commit": "e996eed750aabdfaa976357450f9ccbcd333a785" }, - "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, - "bufferline.nvim": { "branch": "main", "commit": "357cc8f8eeb64702e6fcf2995e3b9becee99a5d3" }, - "catppuccin": { "branch": "main", "commit": "dcef0a062de380885193fb0f919217d58b979753" }, + "LazyVim": { "branch": "main", "commit": "9b4675ddde38fdae09978bd7dbdba83ec91f4d80" }, + "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, + "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, + "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "7f5ff6d253ae3543f186787bccafdc411d3f4b0a" }, - "dashboard-nvim": { "branch": "master", "commit": "c71cab740e2add248c54c458b5ca9d6e77c30fa6" }, - "dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" }, + "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, + "dashboard-nvim": { "branch": "master", "commit": "6d06924b562de6f0bb136edf1bf549afbf6b7d00" }, + "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, - "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" }, - "indent-blankline.nvim": { "branch": "master", "commit": "2546441840172cc41e70f67c52e205cc7aa3e6ed" }, - "lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" }, - "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "09be3766669bfbabbe2863c624749d8da392c916" }, - "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, - "mini.ai": { "branch": "main", "commit": "10ad2ed049fb681a829b44aeb23443c0a9c910ae" }, - "mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" }, - "mini.comment": { "branch": "main", "commit": "e4320af992cd053a7da2f33d9f63a86c2ab6ce59" }, - "mini.indentscope": { "branch": "main", "commit": "cbc07203ca8faae952ca373c1f6cc5881ce97af0" }, - "mini.pairs": { "branch": "main", "commit": "6f6bd7ed5757b40bc29c73dac0d743e4e6978124" }, - "mini.surround": { "branch": "main", "commit": "68ce058ef9716d7d955b79363845d2dd003d6500" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "0b9a83e6dc47513a81fd9086440d5638683f4f17" }, - "neoconf.nvim": { "branch": "main", "commit": "00dcf2b81c45de1768b4171faa16729f0888cfb8" }, - "neodev.nvim": { "branch": "main", "commit": "d617d9eb27e73e701e446874c6ea2cb528719260" }, - "noice.nvim": { "branch": "main", "commit": "8f1b53ab85f83e0687d0f267085ad781ec240432" }, - "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, - "nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" }, - "nvim-lint": { "branch": "master", "commit": "a4b0511a9e757e78c8c9f9d3f201e0d8ff158b42" }, - "nvim-lspconfig": { "branch": "master", "commit": "6428fcab6f3c09e934bc016c329806314384a41e" }, - "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, - "nvim-spectre": { "branch": "master", "commit": "696cff781a4a7ecc91549736835e2acbd00fe859" }, - "nvim-treesitter": { "branch": "master", "commit": "0b50cf159283855b72f4c6b22f5ba3c9cf813b37" }, - "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" }, - "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, - "nvim-web-devicons": { "branch": "master", "commit": "f0267921c845c42685968401bc49aa65e18d3e09" }, - "persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" }, - "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "master", "commit": "4522d7e3ea75ffddabdc39957168a8a7060b5df0" }, - "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, - "tokyonight.nvim": { "branch": "main", "commit": "531b04704fc9ff994d8b9c0720428fdc3c7d49d1" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, - "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "mini.ai": { "branch": "main", "commit": "98e45e6832351354e41e82b32a80ce7537c20746" }, + "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, + "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, + "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, + "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, + "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, + "monokai-pro.nvim": { "branch": "master", "commit": "aafde73a622435891d36b411d8623e705ead6293" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, + "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, + "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, + "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, + "nvim-lspconfig": { "branch": "master", "commit": "3224b099845c24ca456d1e77a9268a788f106f0b" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, + "nvim-treesitter": { "branch": "master", "commit": "19f69a5b434470723c32311cdc4d8d0e8db76358" }, + "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, + "nvim-web-devicons": { "branch": "master", "commit": "27eac98fd6675d29d0e19d4d0622fd7a3968483a" }, + "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, + "tree-sitter-asm": { "branch": "main", "commit": "b0306e9bb2ebe01c6562f1aef265cc42ccc53070" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, + "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/user/modules/nvim/lazyvim.json b/user/modules/nvim/lazyvim.json index ff6a139..f03853f 100644 --- a/user/modules/nvim/lazyvim.json +++ b/user/modules/nvim/lazyvim.json @@ -3,7 +3,7 @@ ], "news": { - "NEWS.md": "2123" + "NEWS.md": "3314" }, - "version": 2 + "version": 3 } \ No newline at end of file diff --git a/user/modules/nvim/lua/plugins/colors.lua b/user/modules/nvim/lua/plugins/colors.lua new file mode 100644 index 0000000..c0bd750 --- /dev/null +++ b/user/modules/nvim/lua/plugins/colors.lua @@ -0,0 +1,11 @@ +return { + { + "loctvl842/monokai-pro.nvim", + + config = function() + require("monokai-pro").setup() + + vim.cmd([[colorscheme monokai-pro]]) + end, + }, +} diff --git a/user/modules/nvim/lua/plugins/lsp.lua b/user/modules/nvim/lua/plugins/lsp.lua index 6fd65ce..1a581a9 100644 --- a/user/modules/nvim/lua/plugins/lsp.lua +++ b/user/modules/nvim/lua/plugins/lsp.lua @@ -6,6 +6,10 @@ return { ---@type lspconfig.options ---@diagnostic disable-next-line: missing-fields servers = { + ---@diagnostic disable-next-line: missing-fields + tsserver = {}, + ---@diagnostic disable-next-line: missing-fields + eslint = {}, nil_ls = {}, }, }, @@ -49,7 +53,14 @@ return { ---@type table formatters_by_ft = { nix = { "alejandra" }, + javascript = { { "prettierd", "prettier" } }, + javascriptreact = { { "prettierd", "prettier" } }, + typescript = { { "prettierd", "prettier" } }, + typescriptreact = { { "prettierd", "prettier" } }, }, }, }, + { + "rush-rs/tree-sitter-asm", + }, } diff --git a/user/modules/vscode.nix b/user/modules/vscode.nix index 1181571..c0455d9 100644 --- a/user/modules/vscode.nix +++ b/user/modules/vscode.nix @@ -38,6 +38,7 @@ in { vscodevim.vim pkgs.vscode-marketplace.miguelsolorio.min-theme streetsidesoftware.code-spell-checker + mkhl.direnv # Git mhutchie.git-graph @@ -50,7 +51,8 @@ in { astro-build.astro-vscode redwan-hossain.auto-rename-tag-clone bradlc.vscode-tailwindcss - johnsoncodehk.volar + vue.volar + pkgs.vscode-marketplace.vue.vscode-typescript-vue-plugin svelte.svelte-vscode dbaeumer.vscode-eslint esbenp.prettier-vscode @@ -61,6 +63,9 @@ in { # Dart / Flutter dart-code.dart-code + # Go + golang.go + # Java redhat.java vscjava.vscode-java-debug @@ -71,6 +76,9 @@ in { # Nix jnoortheen.nix-ide kamadorueda.alejandra + + # Rust + rust-lang.rust-analyzer ]; }; }; diff --git a/user/modules/vscode/settings.json b/user/modules/vscode/settings.json index 34b080c..aa53396 100644 --- a/user/modules/vscode/settings.json +++ b/user/modules/vscode/settings.json @@ -130,7 +130,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[vue]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[markdown]": { "editor.wordWrap": "bounded" diff --git a/user/modules/waybar/default.nix b/user/modules/waybar/default.nix new file mode 100644 index 0000000..20cc504 --- /dev/null +++ b/user/modules/waybar/default.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkMerge; + + theme = builtins.readFile ./styles/catppuccin.css; + style = builtins.readFile ./styles/style.css; + notificationsStyle = builtins.readFile ./styles/notifications.css; + powerStyle = builtins.readFile ./styles/power.css; + statsStyle = builtins.readFile ./styles/stats.css; + workspacesStyle = builtins.readFile ./styles/workspaces.css; + + custom-modules = import ./modules/custom-modules.nix {inherit config lib pkgs;}; + default-modules = import ./modules/default-modules.nix {inherit lib pkgs;}; + group-modules = import ./modules/group-modules.nix; + hyprland-modules = import ./modules/hyprland-modules.nix {inherit config lib;}; + + allModules = mkMerge [ + custom-modules + default-modules + group-modules + hyprland-modules + ]; +in { + programs.waybar = { + enable = true; + style = "${theme}${style}${notificationsStyle}${powerStyle}${statsStyle}${workspacesStyle}"; + settings = { + mainBar = mkMerge [ + { + name = "main"; + "margin-top" = 10; + "margin-left" = 10; + "margin-right" = 10; + layer = "top"; + # Choose the order of the modules + "modules-left" = [ + "group/power" + "hyprland/workspaces" + ]; + "modules-center" = [ + "clock" + ]; + "modules-right" = [ + "group/tray-drawer" + "group/stats-drawer" + "group/notifications" + "hyprland/submap" + "custom/weather" + ]; + } + allModules + ]; + }; + }; +} diff --git a/user/modules/waybar/modules/custom-modules.nix b/user/modules/waybar/modules/custom-modules.nix new file mode 100644 index 0000000..f954291 --- /dev/null +++ b/user/modules/waybar/modules/custom-modules.nix @@ -0,0 +1,107 @@ +{ config +, lib +, pkgs +, ... +}: +let + inherit (lib) getExe getExe'; + + githubHelper = pkgs.writeShellScriptBin "githubHelper" /* bash */ '' + #!/usr/bin/env bash + + NOTIFICATIONS="$(${getExe pkgs.gh} api notifications)" + COUNT="$(echo "$NOTIFICATIONS" | ${getExe pkgs.jq} 'length')" + + echo '{"text":'"$COUNT"',"tooltip":"'"$COUNT"' Notifications","class":""}' + ''; +in +{ + "custom/ellipses" = { + "format" = ""; + "tooltip" = false; + }; + + "custom/github" = { + "format" = " {}"; + "return-type" = "json"; + "interval" = 60; + "exec" = "${getExe githubHelper}"; + "on-click" = "${getExe' pkgs.coreutils "sleep"} 0.1 && ${getExe' pkgs.xdg-utils "xdg-open"} https://github.com/notifications"; + }; + + "custom/lock" = { + "format" = "󰍁"; + "tooltip" = false; + "on-click" = "${getExe config.programs.swaylock.package}"; + }; + + "custom/media" = { + "format" = "{icon} {}"; + "return-type" = "json"; + "max-length" = 40; + "format-icons" = { + "spotify" = ""; + "default" = "🎜"; + }; + "escape" = true; + "exec" = "$HOME/.config/waybar/mediaplayer.py 2> /dev/null"; + }; + + "custom/notification" = { + "tooltip" = true; + "format" = "{icon} {}"; + "format-icons" = { + "notification" = ""; + "none" = ""; + "dnd-notification" = ""; + "dnd-none" = ""; + "inhibited-notification" = ""; + "inhibited-none" = ""; + "dnd-inhibited-notification" = ""; + "dnd-inhibited-none" = ""; + }; + "return-type" = "json"; + "exec-if" = "which ${getExe' pkgs.swaynotificationcenter "swaync-client"}"; + "exec" = "${getExe' pkgs.swaynotificationcenter "swaync-client"} -swb"; + "on-click" = "${getExe' pkgs.coreutils "sleep"} 0.1 && ${getExe' pkgs.swaynotificationcenter "swaync-client"} -t -sw"; + "on-click-right" = "${getExe' pkgs.coreutils "sleep"} 0.1 && ${getExe' pkgs.swaynotificationcenter "swaync-client"} -d -sw"; + "escape" = true; + }; + + "custom/power" = { + "format" = ""; + "tooltip" = false; + "on-click" = "shutdown now"; + }; + + "custom/reboot" = { + "format" = "󰜉"; + "tooltip" = false; + "on-click" = "reboot"; + }; + + "custom/separator-right" = { + "format" = ""; + "tooltip" = false; + }; + + "custom/separator-left" = { + "format" = ""; + "tooltip" = false; + }; + + "custom/weather" = { + "exec" = "${getExe pkgs.wttrbar} --location $(${getExe pkgs.jq} -r '.wttr | (.location)' ~/weather_config.json) --fahrenheit --main-indicator temp_F"; + "return-type" = "json"; + "format" = "{}"; + "tooltip" = true; + "interval" = 3600; + }; + + "custom/wlogout" = { + "format" = ""; + "interval" = "once"; + "tooltip" = false; + "on-click" = "${getExe' pkgs.coreutils "sleep"} 0.1 && ${getExe pkgs.wlogout} -c 5 -r 5 -p layer-shell"; + }; +} diff --git a/user/modules/waybar/modules/default-modules.nix b/user/modules/waybar/modules/default-modules.nix new file mode 100644 index 0000000..44a3422 --- /dev/null +++ b/user/modules/waybar/modules/default-modules.nix @@ -0,0 +1,166 @@ +{ + lib, + pkgs, + ... +}: let + inherit (lib) getExe getExe'; +in { + "clock" = { + "tooltip-format" = "{:%Y %B}\n{calendar}"; + "format" = "{:%A, %b %d %I:%M %p }"; + "format-alt" = "{:%Y-%m-%d}"; + }; + + "cpu" = { + "format" = " {usage}%"; + "tooltip" = true; + }; + + "disk" = { + "format" = " {percentage_used}%"; + }; + + "idle_inhibitor" = { + "format" = "{icon} "; + "format-icons" = { + "activated" = "󰅶"; + "deactivated" = "󰛊"; + }; + }; + + "keyboard-state" = { + "numlock" = true; + "capslock" = true; + "format" = "{icon} {name}"; + "format-icons" = { + "locked" = ""; + "unlocked" = ""; + }; + }; + + "memory" = { + "format" = "󰍛 {}%"; + }; + + "mpris" = { + "format" = "{player_icon} {status_icon} {dynamic}"; + "format-paused" = "{player_icon} {status_icon} {dynamic}"; + "max-length" = 45; + "player-icons" = { + "chromium" = ""; + "default" = ""; + "firefox" = ""; + "mopidy" = ""; + "mpv" = ""; + "spotify" = ""; + }; + "status-icons" = { + "paused" = ""; + "playing" = ""; + "stopped" = ""; + }; + }; + + "mpd" = { + "format" = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% "; + "format-disconnected" = "Disconnected "; + "format-stopped" = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped "; + "unknown-tag" = "N/A"; + "interval" = 2; + "consume-icons" = { + "on" = " "; + }; + "random-icons" = { + "off" = " "; + "on" = " "; + }; + "repeat-icons" = { + "on" = " "; + }; + "single-icons" = { + "on" = "1 "; + }; + "state-icons" = { + "paused" = ""; + "playing" = ""; + }; + "tooltip-format" = "MPD (connected)"; + "tooltip-format-disconnected" = "MPD (disconnected)"; + }; + + "network" = { + "interval" = 1; + "format-wifi" = " 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}"; + "format-ethernet" = "󰈀 󰜮 {bandwidthDownBytes} 󰜷 {bandwidthUpBytes}"; + "tooltip-format" = " {ifname} via {gwaddr}"; + "format-linked" = "󰈁 {ifname} (No IP)"; + "format-disconnected" = " Disconnected"; + "format-alt" = "{ifname}: {ipaddr}/{cidr}"; + }; + + "pulseaudio" = { + "format" = "{volume}% {icon}"; + "format-bluetooth" = "{volume}% {icon}"; + "format-muted" = ""; + "format-icons" = { + "headphone" = ""; + "hands-free" = ""; + "headset" = ""; + "phone" = ""; + "portable" = ""; + "car" = ""; + "default" = [ + "" + "" + ]; + }; + "scroll-step" = 1; + "on-click" = "pavucontrol"; + "ignored-sinks" = [ + "Easy Effects Sink" + ]; + }; + + "pulseaudio/slider" = { + "min" = 0; + "max" = 100; + "orientation" = "horizontal"; + }; + + "temperature" = { + "hwmon-path-abs" = "/sys/devices/pci0000:00/0000:00:18.3/hwmon"; + "input-filename" = "temp3_input"; + "critical-threshold" = 80; + "format-critical" = "{temperatureC}°C {icon}"; + "format" = "{icon} {temperatureC}°C"; + "format-icons" = [ + "" + "" + "" + ]; + "interval" = "5"; + }; + + "tray" = { + "spacing" = 10; + }; + + "user" = { + "format" = "{user}"; + "interval" = 60; + "height" = 30; + "width" = 30; + "icon" = true; + }; + + "wireplumber" = { + "format" = "{volume}% {icon}"; + "format-muted" = ""; + "on-click" = "${getExe' pkgs.coreutils "sleep"} 0.1 && ${getExe pkgs.helvum}"; + "format-icons" = [ + "" + "" + "" + ]; + }; +} diff --git a/user/modules/waybar/modules/group-modules.nix b/user/modules/waybar/modules/group-modules.nix new file mode 100644 index 0000000..e9db523 --- /dev/null +++ b/user/modules/waybar/modules/group-modules.nix @@ -0,0 +1,84 @@ +{ + "group/audio" = { + "orientation" = "horizontal"; + "drawer" = { + "transition-duration" = 500; + "transition-left-to-right" = false; + }; + "modules" = [ + "pulseaudio" + "pulseaudio/slider" + ]; + }; + + "group/power" = { + "orientation" = "horizontal"; + "drawer" = { + "transition-duration" = 500; + "children-class" = "not-power"; + "transition-left-to-right" = false; + }; + "modules" = [ + "custom/wlogout" + # "custom/quit" + # "custom/lock" + # "custom/reboot" + ]; + }; + + "group/notifications" = { + "orientation" = "horizontal"; + "modules" = [ + "idle_inhibitor" + "custom/notification" + "custom/github" + "group/audio" + ]; + }; + + "group/tray" = { + "orientation" = "horizontal"; + "modules" = [ + "tray" + ]; + }; + + "group/stats" = { + "orientation" = "horizontal"; + "modules" = [ + "network" + "cpu" + "memory" + "disk" + "temperature" + ]; + }; + + "group/stats-drawer" = { + "orientation" = "horizontal"; + "drawer" = { + "transition-duration" = 500; + "transition-left-to-right" = false; + }; + "modules" = [ + "custom/separator-right" + "network" + "cpu" + "memory" + "disk" + "temperature" + ]; + }; + + "group/tray-drawer" = { + "orientation" = "horizontal"; + "drawer" = { + "transition-duration" = 500; + "transition-left-to-right" = true; + }; + "modules" = [ + "custom/separator-right" + "tray" + ]; + }; +} diff --git a/user/modules/waybar/modules/hyprland-modules.nix b/user/modules/waybar/modules/hyprland-modules.nix new file mode 100644 index 0000000..1bb5386 --- /dev/null +++ b/user/modules/waybar/modules/hyprland-modules.nix @@ -0,0 +1,95 @@ +{ + config, + lib, + ... +}: let + inherit (lib) getExe'; +in { + "custom/quit" = { + "format" = "󰗼"; + "tooltip" = false; + "on-click" = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch exit"; + }; + + "hyprland/submap" = { + "format" = "✌️ {}"; + "max-length" = 8; + "tooltip" = false; + }; + + "hyprland/window" = { + "format" = "{}"; + "separate-outputs" = true; + }; + + "hyprland/workspaces" = { + "all-outputs" = false; + "active-only" = "false"; + "on-scroll-up" = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch workspace e+1"; + "on-scroll-down" = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch workspace e-1"; + "format" = "{icon} {windows}"; + "format-icons" = { + "1" = "󰎤"; + "2" = "󰎧"; + "3" = "󰎪"; + "4" = "󰎭"; + "5" = "󰎱"; + "6" = "󰎳"; + "7" = "󰎶"; + "8" = "󰎹"; + "9" = "󰎼"; + "10" = "󰽽"; + "urgent" = "󱨇"; + "default" = ""; + "empty" = "󱓼"; + }; + "persistent-workspaces" = { + "*" = [ + 2 + 3 + 4 + 5 + 6 + 7 + 8 + ]; + "DP-3" = [ + 1 + ]; + }; + # "format-window-separator" = "->"; + "window-rewrite-default" = ""; + "window-rewrite" = { + "class<1Password>" = "󰢁"; + "class" = "󰈎"; + "class" = "󰊤"; + "class" = ""; + "class" = ""; + "class" = "󰒱"; + "class" = "󰨞"; + "code-url-handler" = "󰨞"; + "class" = "󰙯"; + "class" = "󰈹"; + "class title<.*github.*>" = ""; + "class title<.*twitch|youtube|plex|tntdrama|bally sports.*>" = ""; + "class" = ""; + "class" = ""; + "class" = "󱂷"; + "class" = "󰄄"; + "class" = ""; + "class<.pitivi-wrapped>" = "󱄢"; + "class" = ""; + "class" = ""; + "class" = "󰢹"; + "class" = "󰕼"; + "class" = "󰉋"; + "class" = "󰉋"; + "class" = ""; + "title" = ""; + "class" = "󰽉"; + "class" = ""; + "class" = "󱎏"; + "class" = "󱎐"; + }; + }; +} diff --git a/user/modules/waybar/modules/wlr-modules.nix b/user/modules/waybar/modules/wlr-modules.nix new file mode 100644 index 0000000..5bda91a --- /dev/null +++ b/user/modules/waybar/modules/wlr-modules.nix @@ -0,0 +1,46 @@ +{ + "wlr/workspaces" = { + "all-outputs" = false; + "active-only" = "false"; + "on-click" = "activate"; + "format" = "{icon}"; + "format-icons" = { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + "5" = ""; + "6" = ""; + "7" = ""; + "8" = "󰢹"; + "urgent" = ""; + "default" = ""; + }; + "persistent_workspaces" = { + "1" = [ + "DP-3" + ]; + "2" = [ + "DP-1" + ]; + "3" = [ + "DP-1" + ]; + "4" = [ + "DP-1" + ]; + "5" = [ + "DP-1" + ]; + "6" = [ + "DP-1" + ]; + "7" = [ + "DP-1" + ]; + "8" = [ + "DP-1" + ]; + }; + }; +} diff --git a/user/modules/waybar/styles/catppuccin.css b/user/modules/waybar/styles/catppuccin.css new file mode 100644 index 0000000..e662b6a --- /dev/null +++ b/user/modules/waybar/styles/catppuccin.css @@ -0,0 +1,36 @@ +/* +* +* Catppuccin Macchiato palette +* +*/ + +@define-color base #24273a; +@define-color mantle #1e2030; +@define-color crust #181926; + +@define-color text #cad3f5; +@define-color subtext0 #b8c0e0; +@define-color subtext1 #a5adcb; + +@define-color surface0 #363a4f; +@define-color surface1 #494d64; +@define-color surface2 #5b6078; + +@define-color overlay0 #6e738d; +@define-color overlay1 #8087a2; +@define-color overlay2 #939ab7; + +@define-color blue #8aadf4; +@define-color lavender #b7bdf8; +@define-color sapphire #7dc4e4; +@define-color sky #91d7e3; +@define-color teal #8bd5ca; +@define-color green #a6da95; +@define-color yellow #eed49f; +@define-color peach #f5a97f; +@define-color maroon #ee99a0; +@define-color red #ed8796; +@define-color mauve #c6a0f6; +@define-color pink #f5bde6; +@define-color flamingo #f0c6c6; +@define-color rosewater #f4dbd6; diff --git a/user/modules/waybar/styles/notifications.css b/user/modules/waybar/styles/notifications.css new file mode 100644 index 0000000..1fc9e51 --- /dev/null +++ b/user/modules/waybar/styles/notifications.css @@ -0,0 +1,82 @@ +#notifications { + margin: 0.4em; + padding-left: 5px; + padding-right: 5px; + color: @peach; + font-weight: bold; + background-color: @surface0; + border: 2px solid @surface1; +} +#custom-notification, +#custom-updates, +#custom-github, +#idle_inhibitor, +#wireplumber, +#pulseaudio + { + padding: 0 0.5em; +} + +#custom-updates.updated { + padding-left: 0; + padding-right: 1em; +} + +/* Unique colors for modules */ + +#custom-pipewire { + color: @green; +} + +#custom-github { + color: @blue; +} + +#custom-updates { + color: @red; +} + +#custom-pipewire.muted, +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#keyboard-state { + padding: 0 0px; + min-width: 16px; + color: @mauve; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#pulseaudio-slider { + padding: 0 12px; +} + +#pulseaudio-slider slider { + min-height: 0px; + min-width: 0px; + opacity: 0; + background-image: none; + border: none; + box-shadow: none; +} +#pulseaudio-slider trough { + min-height: 10px; + min-width: 80px; + border-radius: 5px; + background-color: @base; +} +#pulseaudio-slider highlight { + min-width: 10px; + border-radius: 5px; + background-color: @green; +} + diff --git a/user/modules/waybar/styles/power.css b/user/modules/waybar/styles/power.css new file mode 100644 index 0000000..bcd483f --- /dev/null +++ b/user/modules/waybar/styles/power.css @@ -0,0 +1,14 @@ +/* Custom styling for the logout icon on end */ +#custom-wlogout { + font-size: 1.75em; + padding: 0 0.5em; + color: @blue; +} + +#power { + margin-right: 0.25em; +} + +#power .not-power { + color: @red; +} diff --git a/user/modules/waybar/styles/stats.css b/user/modules/waybar/styles/stats.css new file mode 100644 index 0000000..456ea66 --- /dev/null +++ b/user/modules/waybar/styles/stats.css @@ -0,0 +1,43 @@ +#stats, +#stats-drawer { + margin: 0.4em; + padding-left: 5px; + padding-right: 5px; + color: @peach; + font-weight: bold; + background-color: @surface0; + border: 2px solid @surface1; +} +#battery, +#cpu, +#memory, +#temperature, +#disk, +#network { + padding: 0 0.5em; +} + +/* Unique colors for modules */ +#cpu { + color: @red; +} + +#memory { + color: @yellow; +} +#temperature { + color: @green; +} + +#network { + color: @blue; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#temperature.critical { + background-color: #eb4d4b; +} + diff --git a/user/modules/waybar/styles/style.css b/user/modules/waybar/styles/style.css new file mode 100644 index 0000000..fd8e1c9 --- /dev/null +++ b/user/modules/waybar/styles/style.css @@ -0,0 +1,77 @@ +/** +* Global configuration for theme +* */ +* { + font-family: FiraCode Nerd Font; + font-size: 16px; + border-radius: 0.75em; +} + +window#waybar { + border: 2px solid @surface1; + background: @theme_base_color; + box-shadow: 1px 1px 10px 10px @mantle; + color: @theme_text_color; + transition-property: background-color; + transition-duration: 0.5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +tooltip { + background: @base; + border: 1px solid @blue; +} + +tooltip label { + color: white; +} + +label:focus { + background-color: #000000; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* Remove border from parent waybar */ +box { + border: none; +} + +/* Add spacing for right side modules */ +#tray, +#user, +#custom-weather, +#keyboard-state, +#mpd { + padding: 0 1em; +} + +#clock { + font-size: 16px; + font-weight: 900; + padding: 0 1em; +} + +#custom-separator-right, +#custom-separator-left { + font-size: 20px; + padding-left: 1em; + padding-right: 1em; + color: @text; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} diff --git a/user/modules/waybar/styles/workspaces.css b/user/modules/waybar/styles/workspaces.css new file mode 100644 index 0000000..83372c2 --- /dev/null +++ b/user/modules/waybar/styles/workspaces.css @@ -0,0 +1,42 @@ +#workspaces { + margin: 0.4em; + padding-left: 5px; + padding-right: 5px; + color: @peach; + font-weight: bold; + background-color: @surface0; + border: 2px solid @surface1; +} + +#workspaces label { + font-family: MonaspiceNe Nerd Font; + font-size: 20px; +} + +#workspaces button { + padding: 0 0.5em; + background-color: @surface0; + color: @text; + margin: 0.2em; +} + +#workspaces button.empty { + /* background-color: @surface2; */ + color: @overlay0; +} + +#workspaces button.visible { + /* background-color: @surface2; */ + color: @blue; +} + +#workspaces button.active { + /* background-color: @surface2; */ + color: @green; +} + +#workspaces button.urgent { + box-shadow: 2px 2px 2px 2px; + border-radius: 1em; + color: @red; +} diff --git a/user/modules/wofi.nix b/user/modules/wofi.nix new file mode 100644 index 0000000..e96db9a --- /dev/null +++ b/user/modules/wofi.nix @@ -0,0 +1,5 @@ +{...}: { + programs.wofi = { + enable = true; + }; +} diff --git a/user/modules/zsh.nix b/user/modules/zsh.nix index 7e48014..6172308 100644 --- a/user/modules/zsh.nix +++ b/user/modules/zsh.nix @@ -5,6 +5,36 @@ }: { programs.zsh = { enable = true; + + enableAutosuggestions = true; + # autosuggestion.enable = true; + syntaxHighlighting.enable = true; + historySubstringSearch.enable = true; + autocd = true; + enableCompletion = true; + + # Enable pure prompt + initExtra = '' + fpath+=${pkgs.pure-prompt}/share/zsh/site-functions + autoload -U promptinit; + promptinit + prompt pure + ''; + + envExtra = '' + # Do not load global configuration + setopt no_global_rcs + ''; + + loginExtra = '' + setopt correct + ''; + + sessionVariables = { + # Make ls colorful on MacOS + CLICOLOR = 1; + }; + plugins = [ { name = "zsh-nix-shell"; @@ -12,37 +42,10 @@ src = pkgs.fetchFromGitHub { owner = "chisui"; repo = "zsh-nix-shell"; - rev = "v0.1.0"; - sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx"; + rev = "v0.8.0"; + sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7"; }; } - { - name = "powerlevel10k-config"; - src = lib.cleanSource ./p10k-config; - file = "p10k.zsh"; - } ]; - prezto = { - enable = true; - pmodules = [ - "archive" - "docker" - "environment" - "git" - "terminal" - "editor" - "history" - "directory" - "spectrum" - "utility" - "completion" - "command-not-found" - "syntax-highlighting" - "history-substring-search" - "autosuggestions" - "prompt" - ]; - prompt.theme = "powerlevel10k"; - }; }; }