diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2025-10-26 23:39:33 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2025-10-26 23:39:33 +0530 |
| commit | b0d6c3079183602e5d010f958f370570d069a157 (patch) | |
| tree | 56b0a3fd602d916270d1e4473dbe12bcfae4b3cb | |
| parent | 9aa0070e137ac3e2b90284ed82f1751a601e18e1 (diff) | |
home manager symlink + vlc + screen recorder (incomplete)
| -rw-r--r-- | flake.nix | 5 | ||||
| -rw-r--r-- | hardware-configuration.nix | 2 | ||||
| -rw-r--r-- | home-manager/home.nix | 42 | ||||
| -rw-r--r-- | hypr/hyprland/keybinds.conf | 1 | ||||
| -rw-r--r-- | hypr/wf-recorder/record.sh | 12 | ||||
| -rwxr-xr-x | nix.sh | 1 | ||||
| -rw-r--r-- | nixos/apps.nix | 1 | ||||
| -rw-r--r-- | nixos/environment.nix | 1 |
8 files changed, 60 insertions, 5 deletions
@@ -15,6 +15,7 @@ system = "x86_64-linux"; username = "aargh"; hostname = "pegasus"; + symlinkRoot = self; pkgs = import nixpkgs { inherit system; config.allowUnfree = true; @@ -26,7 +27,7 @@ in { nixosConfigurations.main = nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { inherit inputs username hostname unstable; }; + specialArgs = { inherit inputs username hostname unstable symlinkRoot; }; modules = [ ./nixos/configuration.nix @@ -34,7 +35,7 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit username unstable; }; + home-manager.extraSpecialArgs = { inherit username unstable symlinkRoot; }; home-manager.backupFileExtension = "hm-backup"; home-manager.users.${username} = import ./home-manager/home.nix; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 9ac5330..11531cb 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -8,7 +8,7 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usbhid" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; diff --git a/home-manager/home.nix b/home-manager/home.nix index aec1491..80ebd26 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,5 +1,43 @@ -{ config, pkgs, username, ... }: -{ +{ config, lib, pkgs, symlinkRoot, username, ... }: +let + inherit (config.lib.file) mkOutOfStoreSymlink; + inherit (lib) flatten flip map mergeAttrsList; + + pipe = flip lib.pipe; + flatMerge = pipe [flatten mergeAttrsList]; + + toSrcFile = name: "${symlinkRoot}/${name}"; + link = pipe [toSrcFile mkOutOfStoreSymlink]; + + linkFile = name: {${name}.source = link name;}; + linkDir = name: { + ${name} = { + source = link name; + recursive = true; + }; + }; + + linkConfFiles = map linkFile; + linkConfDirs = map linkDir; + + confFiles = linkConfFiles [ + "starship.toml" + ]; + + confDirs = linkConfDirs [ + "foot" + "hypr" + "nvim" + "tmux" + "waybar" + "wofi" + "yazi" + ]; + + links = flatMerge [confFiles confDirs]; +in { + xdg.configFile = links; + home.username = username; home.homeDirectory = "/home/${username}"; home.stateVersion = "25.05"; diff --git a/hypr/hyprland/keybinds.conf b/hypr/hyprland/keybinds.conf index a83f449..5803061 100644 --- a/hypr/hyprland/keybinds.conf +++ b/hypr/hyprland/keybinds.conf @@ -12,6 +12,7 @@ bind = $mainMod, R, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = CTRL SHIFT, escape, exec, $taskManager +# bind = $mainMod SHIFT, R, exec, ~/.config/hypr/wf-recorder/record.sh # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l diff --git a/hypr/wf-recorder/record.sh b/hypr/wf-recorder/record.sh new file mode 100644 index 0000000..a9ef87a --- /dev/null +++ b/hypr/wf-recorder/record.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +notify-send "mkc" +# Check if a recording is already in progress +if pgrep -x wf-recorder > /dev/null +then + # If recording, stop it + notify-send -h string:wf-recorder:record -t 1000 "Recording Stopped" && pkill wf-recorder +else + # If not recording, start it + notify-send -h string:wf-recorder:record -t 1000 "Recording Started" && wf-recorder -a [audio_device] -f /path/to/your/video.mp4 +fi @@ -0,0 +1 @@ +sudo nixos-rebuild switch --flake .#main diff --git a/nixos/apps.nix b/nixos/apps.nix index 13d9135..7b6ba07 100644 --- a/nixos/apps.nix +++ b/nixos/apps.nix @@ -12,6 +12,7 @@ libreoffice-qt6-fresh kdePackages.dolphin wineWowPackages.stable + vlc ]; xdg = { diff --git a/nixos/environment.nix b/nixos/environment.nix index 58da2ec..19daedc 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -9,6 +9,7 @@ yazi scrcpy cloc + wf-recorder wget git |
