diff --git a/common/files.nix b/common/files.nix index 0c3366e..91e3f11 100644 --- a/common/files.nix +++ b/common/files.nix @@ -1,4 +1,10 @@ -{ config }: rec{ +{ + config, + cpkg, +}: +let +in +{ lazygit = { recursive = true; source = ../dotfiles/lazygit; @@ -37,6 +43,10 @@ source = ../dotfiles/rofi; target = "./.config/rofi"; }; + scripts = { + source = "${cpkg.scripts}"; + target = ".scripts"; + }; # # Building this configuration will create a copy of 'dotfiles/screenrc' in # # the Nix store. Activating the configuration will then make '~/.screenrc' a # # symlink to the Nix store copy. diff --git a/common/pkgs.nix b/common/pkgs.nix index bdecc9d..73c4b09 100644 --- a/common/pkgs.nix +++ b/common/pkgs.nix @@ -1,10 +1,14 @@ -{ pkgs, config }: +{ + pkgs, + config, + inputs, + cpkg, +}: let - cpkg = import ../customPackages { inherit pkgs; }; pinned = import ./pinned.nix { inherit pkgs config; }; in { - dev = with pkgs;[ + dev = with pkgs; [ meson deno rustup @@ -46,7 +50,7 @@ in ])) nodejs_22 ]; - gui = with pkgs;[ + gui = with pkgs; [ cpkg.frog legcord obsidian @@ -137,6 +141,9 @@ in lutris ]; scripts = [ + (pkgs.writeShellScriptBin "hashi18n" '' + xsel -ob | node ${cpkg.scripts}/hash.js | tr -d '\n' | xsel -ib + '') (pkgs.writeShellScriptBin "paste" '' command -v xsel > /dev/null if [[ $? -eq 0 ]]; then @@ -160,8 +167,7 @@ in URL=''${URL/https:\/\//git@}; URL=''${URL/\//:}; git remote set-url $1 $URL; - '' - ) + '') (pkgs.writeShellScriptBin "copy" '' command -v xsel > /dev/null if [[ $? -eq 0 ]]; then @@ -194,14 +200,8 @@ in set -e python3 -c "print($*)" '') - (pkgs.writeShellScriptBin "ocr" '' - set -euo pipefail - TEMP=$(mktemp) - flameshot gui -s -r > $TEMP - (tesseract $TEMP --oem 1 -l eng | copy )|| copy "OCR RETUNRED NON-ZERO" - '') ]; - wsl = with pkgs;[ + wsl = with pkgs; [ wslu ]; } diff --git a/common/shell.nix b/common/shell.nix index 2910e58..4cd84d5 100644 --- a/common/shell.nix +++ b/common/shell.nix @@ -1,4 +1,5 @@ -{ config, pkgs }: rec { +{ config, pkgs, cpkg }: +rec { dev = { env = common.env // { PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine"; diff --git a/common/users/meyer/home.nix b/common/users/meyer/home.nix index f12654e..0bf6a4d 100644 --- a/common/users/meyer/home.nix +++ b/common/users/meyer/home.nix @@ -1,9 +1,22 @@ -{ config, pkgs, ... }: +{ + config, + pkgs, + inputs, + ... +}: let - file = import ../../files.nix { inherit config; }; - shell = import ../../shell.nix { inherit config pkgs; }; - pkgTypes = import ../../pkgs.nix { inherit pkgs config; }; + file = import ../../files.nix { inherit config cpkg; }; + shell = import ../../shell.nix { inherit config pkgs cpkg; }; + cpkg = import ../../../customPackages { inherit pkgs inputs; }; + pkgTypes = import ../../pkgs.nix { + inherit + pkgs + config + inputs + cpkg + ; + }; packages = pkgTypes.dev ++ pkgTypes.gui ++ pkgTypes.general ++ pkgTypes.scripts ++ pkgTypes.gaming; in { @@ -27,7 +40,6 @@ in home.username = "meyer"; home.homeDirectory = "/home/meyer"; - # The home.packages option allows you to install Nix packages into your # environment. home = { diff --git a/customPackages/default.nix b/customPackages/default.nix index 094a305..bbd6ecc 100644 --- a/customPackages/default.nix +++ b/customPackages/default.nix @@ -1,10 +1,9 @@ -{ pkgs }: -let -in -rec{ +{ pkgs, inputs }: +rec { # discord = nixpkgs.callPackage ./discord { }; discord = pkgs.callPackage ./discord/default.nix { }; vesktop = pkgs.callPackage ./vesktop/default.nix { inherit vencord; }; vencord = pkgs.callPackage ./vencord/package.nix { }; - frog = pkgs.callPackage ./frog {}; + frog = pkgs.callPackage ./frog { }; + scripts = inputs.scripts.flakePackage pkgs; } diff --git a/customPackages/frog/default.nix b/customPackages/frog/default.nix index fced2c1..8a75257 100644 --- a/customPackages/frog/default.nix +++ b/customPackages/frog/default.nix @@ -30,8 +30,8 @@ python3Packages.buildPythonApplication rec { src = ( fetchFromGitHub { owner = "sadan4"; repo = "frog"; - rev = "4e43c19701032de6dc741c92ed505f8fe660fbbb"; - hash = "sha256-olQofXrUF97NvY/lYBic/u50zuFvuOm4XrWUKn83xac="; + rev = "e4b48239238e1947e74b919fd85609b6500aca31"; + hash = "sha256-0/ZFmcaMKM/GpS8Q35e0joHTq4D0IEKdsCBJ16P8JZs="; }); format = "other"; diff --git a/flake.nix b/flake.nix index b35d237..6ca2784 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,10 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + scripts = { + inputs.scripts.follows = "nixpkgs"; + url = "github:sadan4/scripts"; + }; stylix = { url = "github:danth/stylix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -37,11 +41,28 @@ desktopIso = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; modules = [ - ({ pkgs, modulesPath,lib, ... }: { - imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" "ext4" ]; - }) + ( + { + pkgs, + modulesPath, + lib, + ... + }: + { + imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.supportedFilesystems = lib.mkForce [ + "btrfs" + "reiserfs" + "vfat" + "f2fs" + "xfs" + "ntfs" + "cifs" + "ext4" + ]; + } + ) ]; }; nix-desktop-evo4b5 = nixpkgs.lib.nixosSystem { @@ -59,7 +80,9 @@ }; wsl = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit inputs; }; + specialArgs = { + inherit inputs; + }; modules = [ ./boxes/wsl/configuration.nix inputs.home-manager.nixosModules.default