From 8a2c922b274187bdb09a60cafdf9b46cca49b196 Mon Sep 17 00:00:00 2001 From: Henry Hiles Date: Tue, 26 Dec 2023 13:01:54 -0500 Subject: [PATCH] add wrappers --- flake.lock | 53 ++++++++++++++++------- flake.nix | 60 ++++++++++++++------------ home-manager.nix | 1 - home-manager/neofetch.nix | 60 -------------------------- modules/common-desktop/packages.nix | 2 - modules/common/fish.nix | 1 - wrappers/common-desktop/vesktop.nix | 6 +++ wrappers/common/neofetch/default.nix | 9 ++++ wrappers/common/neofetch/neofetch.conf | 56 ++++++++++++++++++++++++ wrappers/default.nix | 14 ++++++ 10 files changed, 154 insertions(+), 108 deletions(-) delete mode 100644 home-manager/neofetch.nix create mode 100644 wrappers/common-desktop/vesktop.nix create mode 100644 wrappers/common/neofetch/default.nix create mode 100644 wrappers/common/neofetch/neofetch.conf create mode 100644 wrappers/default.nix diff --git a/flake.lock b/flake.lock index 5ba6b58..817c75e 100755 --- a/flake.lock +++ b/flake.lock @@ -201,11 +201,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1703368619, - "narHash": "sha256-ZGPMYL7FMA6enhuwby961bBANmoFX14EA86m2/Jw5Jo=", + "lastModified": 1703527373, + "narHash": "sha256-AjypRssRtS6F3xkf7rE3/bXkIF2WJOZLbTIspjcE1zM=", "owner": "nix-community", "repo": "home-manager", - "rev": "a2523ea0343b056ba240abbac90ab5f116a7aa7b", + "rev": "80679ea5074ab7190c4cce478c600057cfb5edae", "type": "github" }, "original": { @@ -240,11 +240,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1703380831, - "narHash": "sha256-JqptMO/EPgeeJOeyzF0whENAbKoN2DpMcr07fwwYy44=", + "lastModified": 1703553195, + "narHash": "sha256-4iOPcdDwGsiVhHM26a+uSkLmdlrZGCBUabpp4NuCEdU=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "e12595103fee68cc57a9a16a6288c00f3d7ab828", + "rev": "219145d5cba3b597de446fc0ee1d7213713aef43", "type": "github" }, "original": { @@ -255,11 +255,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702312524, - "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", + "lastModified": 1703255338, + "narHash": "sha256-Z6wfYJQKmDN9xciTwU3cOiOk+NElxdZwy/FiHctCzjU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a9bf124c46ef298113270b1f84a164865987a91c", + "rev": "6df37dc6a77654682fe9f071c62b4242b5342e04", "type": "github" }, "original": { @@ -358,11 +358,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1703423749, - "narHash": "sha256-riAEcZJCVbUhfC5aAL+gJ6nC/IE3P/W2w7MGLNFxsio=", + "lastModified": 1703540559, + "narHash": "sha256-QjOHZc8z2ULBbecRPszSZXBk36+A6Oy/MPmrQNQ9Mgk=", "owner": "wamserma", "repo": "flake-programs-sqlite", - "rev": "0b7ded98747dfb565baebe5aa0177e71264558ee", + "rev": "b00c2a2d12a2df83ad575b81195ed4215dcdac4c", "type": "github" }, "original": { @@ -379,7 +379,8 @@ "nixpkgs": "nixpkgs_3", "nixpkgs-local": "nixpkgs-local", "programsdb": "programsdb", - "stylix": "stylix" + "stylix": "stylix", + "wrapper-manager": "wrapper-manager" } }, "stylix": { @@ -397,11 +398,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1703334881, - "narHash": "sha256-T7O1fbBXg4eq+4Bi+SDN9p4xgOHeZWOXQWTq0U8ximA=", + "lastModified": 1703528325, + "narHash": "sha256-ajoMmEPbLhp9xsReDDQFaY7xX+ayIqwfMlZNg8YxHnw=", "owner": "danth", "repo": "stylix", - "rev": "96f0794dbd4b2ea499fe3c496a8e659bd4ffd68a", + "rev": "7ccd1293a48f01eace7d0ce8d82af51919105b76", "type": "github" }, "original": { @@ -424,6 +425,26 @@ "repo": "flake-utils", "type": "github" } + }, + "wrapper-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702396227, + "narHash": "sha256-JTgwZK6m3Lt1LrjgWdl5+9RyDlAI9mzH3QHFMY8RwVY=", + "owner": "viperML", + "repo": "wrapper-manager", + "rev": "3a4c510ffb9f01fc7cab5e23f5ae818d72a66e1a", + "type": "github" + }, + "original": { + "owner": "viperML", + "repo": "wrapper-manager", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c92f73f..c4719a9 100755 --- a/flake.nix +++ b/flake.nix @@ -12,10 +12,10 @@ url = "github:wamserma/flake-programs-sqlite"; inputs.nixpkgs.follows = "nixpkgs"; }; - # wrapper-manager = { - # url = "github:viperML/wrapper-manager"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + wrapper-manager = { + url = "github:viperML/wrapper-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # wrapper-manager-hm-compat = { # url = "github:nrabulinski/wrapper-manager-hm-compat"; # inputs.nixpkgs.follows = "nixpkgs"; @@ -30,33 +30,37 @@ home-manager, ... } @ inputs: let - opt = nixpkgs.lib.optionals; - dirFiles = dir: map (file: "${dir}/${file}") (builtins.attrNames (builtins.readDir dir)); + dirUtils = { + opt = nixpkgs.lib.optionals; + dirFiles = dir: map (file: "${dir}/${file}") (builtins.attrNames (builtins.readDir dir)); + }; system = hostname: isDesktop: - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs self; - }; + with dirUtils; + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs self isDesktop dirUtils; + }; - modules = - [ - "${self}/${hostname}/configuration.nix" - "${self}/${hostname}/hardware-configuration.nix" - inputs.nix-gaming.nixosModules.pipewireLowLatency - ] - ++ dirFiles ./modules/common - ++ opt isDesktop ( - (dirFiles ./modules/common-desktop) - ++ [ - stylix.nixosModules.stylix - ./stylix.nix - - home-manager.nixosModules.home-manager - ./home-manager.nix + modules = + [ + ./wrappers + "${self}/${hostname}/configuration.nix" + "${self}/${hostname}/hardware-configuration.nix" + inputs.nix-gaming.nixosModules.pipewireLowLatency ] - ); - }; + ++ dirFiles ./modules/common + ++ opt isDesktop ( + (dirFiles ./modules/common-desktop) + ++ [ + stylix.nixosModules.stylix + ./stylix.nix + + home-manager.nixosModules.home-manager + ./home-manager.nix + ] + ); + }; in { nixosConfigurations = { "quadraticpc" = system "quadraticpc" true; diff --git a/home-manager.nix b/home-manager.nix index 4e4e78b..4165b3f 100755 --- a/home-manager.nix +++ b/home-manager.nix @@ -19,7 +19,6 @@ ./home-manager/vscode.nix ./home-manager/direnv.nix ./home-manager/firefox.nix - ./home-manager/neofetch.nix ./home-manager/mangohud.nix ./home-manager/sway.nix ]; diff --git a/home-manager/neofetch.nix b/home-manager/neofetch.nix deleted file mode 100644 index 1638cea..0000000 --- a/home-manager/neofetch.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - xdg.configFile."neofetch/config.conf".text = '' - print_info() { - prin " ''${cl7}┌─────────''${cl0}\n Hardware Information \n''${cl7}──────────" - info "├" cpu - info "├─󰍹" gpu - info "├" memory - prin " ''${cl7}├─────────''${cl0}\n Software Information \n''${cl7}──────────" - info "├" distro - info "├" kernel - info "├" de - info "├" shell - info "├󰆍" term - info "├" theme - info "├󰏖" packages - prin " ''${cl7}└────────────────────────────────────────" - prin "\n \n \n \n \n ''${cl3} \n \n ''${cl5} \n \n ''${cl2} \n \n ''${cl6} \n \n ''${cl4} \n \n ''${cl1} \n \n ''${cl7} \n \n ''${cl0}" - } - - magenta="\033[1;35m" - green="\033[1;32m" - white="\033[1;37m" - blue="\033[1;34m" - red="\033[1;31m" - black="\033[1;40;30m" - yellow="\033[1;33m" - cyan="\033[1;36m" - reset="\033[0m" - bgyellow="\033[1;43;33m" - bgwhite="\033[1;47;37m" - cl0="''${reset}" - cl1="''${magenta}" - cl2="''${green}" - cl3="''${white}" - cl4="''${blue}" - cl5="''${red}" - cl6="''${yellow}" - cl7="''${cyan}" - cl8="''${black}" - cl9="''${bgyellow}" - cl10="''${bgwhite}" - color_blocks="off" - os_arch="off" - memory_percent="on" - package_managers="on" - shell_version="off" - speed_shorthand="on" - cpu_brand="on" - cpu_speed="off" - cpu_cores="off" - gtk_shorthand="on" - de_version="off" - separator="​" - memory_display="on" - disk_display="on" - colors=(0 0 0 6 6 7) - ascii_colors=(6 6 6 6 6 6) - image_size="250px" - ''; -} diff --git a/modules/common-desktop/packages.nix b/modules/common-desktop/packages.nix index d66e0cf..bd1ffdf 100644 --- a/modules/common-desktop/packages.nix +++ b/modules/common-desktop/packages.nix @@ -12,8 +12,6 @@ aspell killall ripgrep - vesktop - hyfetch inkscape r2modman pciutils diff --git a/modules/common/fish.nix b/modules/common/fish.nix index 748693d..8ab79b6 100644 --- a/modules/common/fish.nix +++ b/modules/common/fish.nix @@ -4,7 +4,6 @@ interactiveShellInit = "neofetch"; }; environment = { - systemPackages = [pkgs.hyfetch]; sessionVariables.fish_greeting = ""; shells = [pkgs.fish]; shellAliases = { diff --git a/wrappers/common-desktop/vesktop.nix b/wrappers/common-desktop/vesktop.nix new file mode 100644 index 0000000..b049c2f --- /dev/null +++ b/wrappers/common-desktop/vesktop.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + wrappers.vesktop = { + basePackage = pkgs.vesktop; + env.NIXOS_OZONE_WL.value = null; + }; +} diff --git a/wrappers/common/neofetch/default.nix b/wrappers/common/neofetch/default.nix new file mode 100644 index 0000000..1609014 --- /dev/null +++ b/wrappers/common/neofetch/default.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + wrappers.neofetch = { + basePackage = pkgs.hyfetch; + flags = [ + "--config" + ./neofetch.conf + ]; + }; +} diff --git a/wrappers/common/neofetch/neofetch.conf b/wrappers/common/neofetch/neofetch.conf new file mode 100644 index 0000000..77130bb --- /dev/null +++ b/wrappers/common/neofetch/neofetch.conf @@ -0,0 +1,56 @@ +print_info() { + prin " ${cl7}┌─────────${cl0}\n Hardware Information \n${cl7}──────────" + info "├" cpu + info "├─󰍹" gpu + info "├" memory + prin " ${cl7}├─────────${cl0}\n Software Information \n${cl7}──────────" + info "├" distro + info "├" kernel + info "├" de + info "├" shell + info "├󰆍" term + info "├" theme + info "├󰏖" packages + prin " ${cl7}└────────────────────────────────────────" + prin "\n \n \n \n \n ${cl3} \n \n ${cl5} \n \n ${cl2} \n \n ${cl6} \n \n ${cl4} \n \n ${cl1} \n \n ${cl7} \n \n ${cl0}" +} + +magenta="\033[1;35m" +green="\033[1;32m" +white="\033[1;37m" +blue="\033[1;34m" +red="\033[1;31m" +black="\033[1;40;30m" +yellow="\033[1;33m" +cyan="\033[1;36m" +reset="\033[0m" +bgyellow="\033[1;43;33m" +bgwhite="\033[1;47;37m" +cl0="${reset}" +cl1="${magenta}" +cl2="${green}" +cl3="${white}" +cl4="${blue}" +cl5="${red}" +cl6="${yellow}" +cl7="${cyan}" +cl8="${black}" +cl9="${bgyellow}" +cl10="${bgwhite}" +color_blocks="off" +os_arch="off" +memory_percent="on" +package_managers="on" +shell_version="off" +speed_shorthand="on" +cpu_brand="on" +cpu_speed="off" +cpu_cores="off" +gtk_shorthand="on" +de_version="off" +separator="​" +memory_display="on" +disk_display="on" +colors=(0 0 0 6 6 7) +ascii_colors=(6 6 6 6 6 6) +image_size="250px" \ No newline at end of file diff --git a/wrappers/default.nix b/wrappers/default.nix new file mode 100644 index 0000000..c80b3dd --- /dev/null +++ b/wrappers/default.nix @@ -0,0 +1,14 @@ +{ + pkgs, + inputs, + dirUtils, + isDesktop, + ... +}: { + environment.systemPackages = with dirUtils; [ + (inputs.wrapper-manager.lib.build { + inherit pkgs; + modules = dirFiles ./common ++ opt isDesktop (dirFiles ./common-desktop); + }) + ]; +}