From e1987d6461bc8ec756ed18ae9792140164939514 Mon Sep 17 00:00:00 2001 From: ISnortPennies Date: Thu, 19 Jan 2023 18:51:32 -0500 Subject: [PATCH] added formatter and reformated --- configuration.nix | 14 ++-- flake.nix | 76 +++++++++++----------- home-manager/home.nix | 2 +- home-manager/librewolf.nix | 2 +- home-manager/neovim/default.nix | 107 ++++++++++++++++--------------- home-manager/polybar.nix | 27 ++++---- home-manager/root.nix | 2 +- home-manager/sxhkd.nix | 2 +- modules/fonts.nix | 8 +-- modules/packages.nix | 5 +- modules/refreshrate.nix | 16 ++--- modules/scripts.nix | 18 ++---- modules/smb.nix | 10 +-- modules/vfio.nix | 60 ++++++++--------- modules/xserver.nix | 78 +++++++++++----------- modules/zsh.nix | 4 +- pkgs/afk-cmds/afk-cmds/shell.nix | 4 +- pkgs/afk-cmds/default.nix | 22 +++---- pkgs/parrot/default.nix | 8 +-- pkgs/t-rex-miner/default.nix | 34 +++++----- suckless/default.nix | 13 ++-- suckless/st/shell.nix | 6 +- systems/desktop.nix | 38 +++++------ systems/laptop.nix | 14 ++-- 24 files changed, 286 insertions(+), 284 deletions(-) diff --git a/configuration.nix b/configuration.nix index ee5cb38..2001c1a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ { system.stateVersion = "23.05"; environment = { - defaultPackages = []; + defaultPackages = [ ]; binsh = "${pkgs.dash}/bin/dash"; variables = { EDITOR = "nvim"; @@ -19,7 +19,7 @@ keep-outputs = false keep-derivations = false experimental-features = nix-command flakes - ''; + ''; }; networking = { firewall = { @@ -41,20 +41,20 @@ enable = true; servers = [ "time.google.com" - "time2.google.com" + "time2.google.com" ]; }; }; -# Select internationalisation properties. + # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; console = { font = "Lat2-Terminus16"; useXkbConfig = true; }; -#should be false + #should be false sound.enable = false; -# rtkit is optional but recommended + # rtkit is optional but recommended security.rtkit.enable = true; services.pipewire = { enable = true; @@ -64,7 +64,7 @@ pulse.enable = true; jack.enable = true; }; -#enable ssh + #enable ssh programs = { mtr.enable = true; gnupg.agent = { diff --git a/flake.nix b/flake.nix index 1e0a18f..777f89b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -8,43 +8,47 @@ spicetify-nix.url = "github:the-argus/spicetify-nix"; }; - outputs = {self, nixpkgs, home-manager, spicetify-nix}@inputs: + outputs = { self, nixpkgs, home-manager, spicetify-nix }@inputs: let - username = "gerg"; - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config = { - allowUnfree = true; - packageOverrides = super: let self = super.pkgs; in { - nerdfonts-overpass = self.nerdfonts.override { - fonts = [ "Overpass" ]; + username = "gerg"; + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + packageOverrides = super: + let self = super.pkgs; in { + nerdfonts-overpass = self.nerdfonts.override { + fonts = [ "Overpass" ]; + }; + }; }; + overlays = [ + (final: prev: rec { + t-rex-miner = final.callPackage ./pkgs/t-rex-miner { }; + afk-cmds = final.callPackage ./pkgs/afk-cmds { }; + parrot = final.callPackage ./pkgs/parrot { }; + discord = prev.discord.override { + withOpenASAR = true; + nss = prev.nss_latest; + }; + }) + (import ./suckless) + ]; }; - }; - overlays = [ - (final: prev: rec { - t-rex-miner = final.callPackage ./pkgs/t-rex-miner {}; - afk-cmds = final.callPackage ./pkgs/afk-cmds {}; - parrot = final.callPackage ./pkgs/parrot {}; - discord = prev.discord.override { - withOpenASAR = true; - nss = prev.nss_latest; - }; - }) - (import ./suckless) - ]; - }; - lib = nixpkgs.lib; - in { - nixosConfigurations = { - gerg-desktop = lib.nixosSystem { - inherit system pkgs; - specialArgs = {inherit inputs username;}; - modules = [ - ./configuration.nix + lib = nixpkgs.lib; + in + { + formatter.x86_64-linux = pkgs.nixpkgs-fmt; + nixosConfigurations = { + gerg-desktop = lib.nixosSystem { + inherit system pkgs; + specialArgs = { inherit inputs username; }; + modules = [ + ./configuration.nix ./systems/desktop.nix - home-manager.nixosModules.home-manager { + home-manager.nixosModules.home-manager + { home-manager = { useGlobalPkgs = true; useUserPackages = true; @@ -55,8 +59,8 @@ }; }; } - ]; + ]; + }; }; }; - }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 245be75..e3cd25d 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,4 +1,4 @@ -{config, pkgs, username, ...}: +{ config, pkgs, username, ... }: { imports = [ ./librewolf.nix diff --git a/home-manager/librewolf.nix b/home-manager/librewolf.nix index 7f12905..db61e72 100644 --- a/home-manager/librewolf.nix +++ b/home-manager/librewolf.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: +{ pkgs, ... }: { programs = { librewolf = { diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index 9ef4ade..b257e12 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -1,67 +1,70 @@ -{pkgs, ... }: +{ pkgs, ... }: let -vim-moonfly = pkgs.vimUtils.buildVimPlugin { - pname = "vim-moonfly"; - version = "1.0.0"; - src = pkgs.fetchFromGitHub { - owner = "bluz71"; - repo = "vim-moonfly-colors"; - rev = "065c99b95355b33dfaa05bde11ad758e519b04a3"; - sha256 = "sha256-TEYN8G/VNxitpPJPM7+O9AGLm6V7bPkiTlFG5op55pI="; + vim-moonfly = pkgs.vimUtils.buildVimPlugin { + pname = "vim-moonfly"; + version = "1.0.0"; + src = pkgs.fetchFromGitHub { + owner = "bluz71"; + repo = "vim-moonfly-colors"; + rev = "065c99b95355b33dfaa05bde11ad758e519b04a3"; + sha256 = "sha256-TEYN8G/VNxitpPJPM7+O9AGLm6V7bPkiTlFG5op55pI="; + }; }; -}; in { - # home.packages = with pkgs; [rustc cargo rust-analyzer clang-tools]; + # home.packages = with pkgs; [rustc cargo rust-analyzer clang-tools]; programs.neovim = { enable = true; viAlias = true; vimAlias = true; vimdiffAlias = true; - extraPackages = with pkgs; [gcc ripgrep fd]; + extraPackages = with pkgs; [ gcc ripgrep fd ]; plugins = with pkgs.vimPlugins; [ - nvim-treesitter.withAllGrammars - rainbow nvim-ts-rainbow # rainbow for tree-sitter - nvim-colorizer-lua # colors - nvim-tree-lua # file browser - nvim-web-devicons # for tree-lua - vim-smoothie #smooth scrolling - undotree # better undotree - indentLine # indentlines - vim-smoothie #smooth scrolling -#non-trash auto completion - nvim-cmp - cmp-buffer - cmp-nvim-lsp - cmp-path - cmp-spell - cmp-treesitter - cmp-vsnip - vim-vsnip - lspkind-nvim - nvim-lspconfig - nvim-autopairs # auto brackets - telescope-nvim #search feature - telescope-fzy-native-nvim # search plugin - gitsigns-nvim #in buffer git blame - vim-moonfly #color scheme - lightline-vim #bottom bar - ]; - extraConfig = let - luaRequire = module: - builtins.readFile (builtins.toString - ./config + nvim-treesitter.withAllGrammars + rainbow + nvim-ts-rainbow # rainbow for tree-sitter + nvim-colorizer-lua # colors + nvim-tree-lua # file browser + nvim-web-devicons # for tree-lua + vim-smoothie #smooth scrolling + undotree # better undotree + indentLine # indentlines + vim-smoothie #smooth scrolling + #non-trash auto completion + nvim-cmp + cmp-buffer + cmp-nvim-lsp + cmp-path + cmp-spell + cmp-treesitter + cmp-vsnip + vim-vsnip + lspkind-nvim + nvim-lspconfig + nvim-autopairs # auto brackets + telescope-nvim #search feature + telescope-fzy-native-nvim # search plugin + gitsigns-nvim #in buffer git blame + vim-moonfly #color scheme + lightline-vim #bottom bar + ]; + extraConfig = + let + luaRequire = module: + builtins.readFile (builtins.toString + ./config + "/${module}.lua"); - luaConfig = builtins.concatStringsSep "\n" (map luaRequire [ - "init" - "lspconfig" - "nvim-cmp" - ]); - in '' - lua << EOF - ${luaConfig} - EOF + luaConfig = builtins.concatStringsSep "\n" (map luaRequire [ + "init" + "lspconfig" + "nvim-cmp" + ]); + in + '' + lua << EOF + ${luaConfig} + EOF ''; }; diff --git a/home-manager/polybar.nix b/home-manager/polybar.nix index 98b5a60..aebf68d 100644 --- a/home-manager/polybar.nix +++ b/home-manager/polybar.nix @@ -1,14 +1,13 @@ - -{pkgs , ... }: +{ pkgs, ... }: { services.polybar = { - enable = true; + enable = true; package = pkgs.polybarFull; script = "polybar left & \n polybar middle & \n polybar right &"; settings = { "settings" = { screenchange.reload = true; - pseudo.transparency =false; + pseudo.transparency = false; }; "colors" = { background = "#000000"; @@ -37,7 +36,7 @@ fixed.center = false; dpi = 96; offset.y = 10; - font = [ "Overpass Nerd Font:style=Regular:size=14;4" "Material Design Icons:style=Regular:size=16;4" ]; + font = [ "Overpass Nerd Font:style=Regular:size=14;4" "Material Design Icons:style=Regular:size=16;4" ]; background = "\${colors.background}"; foreground = "\${colors.foreground}"; line.size = "3pt"; @@ -79,7 +78,7 @@ fixed.center = false; dpi = 96; offset.y = 10; - font = [ "Overpass Nerd Font:style=Regular:size=14;4" "Material Design Icons:style=Regular:size=16;4" ]; + font = [ "Overpass Nerd Font:style=Regular:size=14;4" "Material Design Icons:style=Regular:size=16;4" ]; background = "\${colors.background}"; foreground = "\${colors.foreground}"; line.size = "3pt"; @@ -134,7 +133,7 @@ background = "\${colors.background}"; padding = 2; }; - }; + }; }; "module/date" = { type = "internal/date"; @@ -167,14 +166,14 @@ unknown.as.up = true; format = { connected = "\"%{A1:networkmanager_dmenu:}%{A}\""; - disconnected = "\"%{A1:networkmanager_dmenu:}%{A}\""; + disconnected = "\"%{A1:networkmanager_dmenu:}%{A}\""; }; label.disconnected = { text = ""; padding = 0; }; ramp.signal = { - text = ["󰤯" "󰤟" "󰤢" "󰤥" "󰤨"]; + text = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; foreground = "\${colors.foreground}"; background = "\${colors.background}"; padding = 1; @@ -189,7 +188,7 @@ unknown.as.up = true; format = { connected = "\"%{A1:networkmanager_dmenu:}%{A}\""; - disconnected = "\"%{A1:networkmanager_dmenu:}%{A}\""; + disconnected = "\"%{A1:networkmanager_dmenu:}%{A}\""; }; label.connected = { text = ""; @@ -215,8 +214,8 @@ type = "internal/battery"; full.at = 100; low.at = 20; -# battery = "BAT0"; -# adapter = "ACAD"; + # battery = "BAT0"; + # adapter = "ACAD"; poll.interval = 5; format = { charging = "\"%{A1:xfce4-power-menu -c:}%{A}\""; @@ -249,13 +248,13 @@ low = { text = [ " " " " ]; framerate = 200; - foreground = "\${colors.alert}"; + foreground = "\${colors.alert}"; background = "\${colors.background}"; }; }; ramp.capacity = { text = [ "  " "  " "  " "  " "  " ]; - background = "\${colors.background}"; + background = "\${colors.background}"; }; }; "module/pulseaudio" = { diff --git a/home-manager/root.nix b/home-manager/root.nix index a8da2a5..c7d7d1f 100644 --- a/home-manager/root.nix +++ b/home-manager/root.nix @@ -1,4 +1,4 @@ -{config, pkgs, ...}: +{ config, pkgs, ... }: { imports = [ ./theme.nix diff --git a/home-manager/sxhkd.nix b/home-manager/sxhkd.nix index 507d0be..bb64469 100644 --- a/home-manager/sxhkd.nix +++ b/home-manager/sxhkd.nix @@ -7,7 +7,7 @@ "XF86AudioPause" = "playerctl play-pause"; "XF86AudioStop" = "playerctl stop"; "XF86AudioNext" = "playerctl next"; - "XF86AudioPrev" = "playerctl previous"; + "XF86AudioPrev" = "playerctl previous"; "XF86AudioRaiseVolume" = "amixer sset Master 40+"; "XF86AudioLowerVolume" = "amixer sset Master 40-"; "XF86AudioMute" = "amixer sset Master toggle "; diff --git a/modules/fonts.nix b/modules/fonts.nix index 8b8fc46..6eacf1a 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -1,13 +1,13 @@ { pkgs, ... }: { fonts = { - fonts = with pkgs; [overpass nerdfonts-overpass material-design-icons]; + fonts = with pkgs; [ overpass nerdfonts-overpass material-design-icons ]; fontconfig = { enable = true; defaultFonts = { - serif = ["Overpass" "Overpass Nerd Font" "Material Design Icons"]; - sansSerif = ["Overpass" "Overpass Nerd Font" "Material Design Icons"]; - monospace = ["Overpass Mono" "OverpassMono Nerd Font" "Material Design Icons" ]; + serif = [ "Overpass" "Overpass Nerd Font" "Material Design Icons" ]; + sansSerif = [ "Overpass" "Overpass Nerd Font" "Material Design Icons" ]; + monospace = [ "Overpass Mono" "OverpassMono Nerd Font" "Material Design Icons" ]; }; }; }; diff --git a/modules/packages.nix b/modules/packages.nix index 56e232d..dc866d8 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,6 +1,6 @@ { config, pkgs, callPackage, ... }: { - environment.systemPackages = with pkgs; [ + environment.systemPackages = with pkgs; [ bottom #view tasks efibootmgr #efi editor maim #screenshooter @@ -29,7 +29,6 @@ pcmanfm #file manager haskellPackages.squeeze #file compression nix-tree #view packages - docker - ]; + ]; } diff --git a/modules/refreshrate.nix b/modules/refreshrate.nix index eaad5e3..184efa8 100644 --- a/modules/refreshrate.nix +++ b/modules/refreshrate.nix @@ -1,26 +1,26 @@ { services.xserver = { xrandrHeads = [ - { - output = "HDMI-0"; - primary = true; - monitorConfig = '' - Option "DPMS" "false" + { + output = "HDMI-0"; + primary = true; + monitorConfig = '' + Option "DPMS" "false" ''; - } + } ]; screenSection = '' Option "metamodes" "1920x1080_144 +0+0" ''; monitorSection = '' Option "DPMS" "false" - ''; + ''; serverFlagsSection = '' Option "BlankTime" "0" Option "StandbyTime" "0" Option "SuspendTime" "0" Option "OffTime" "0" Option "DPMS" "false" - ''; + ''; }; } diff --git a/modules/scripts.nix b/modules/scripts.nix index 1044345..8c469ee 100644 --- a/modules/scripts.nix +++ b/modules/scripts.nix @@ -7,7 +7,7 @@ let exit 1 fi nix flake update /etc/nixos/# - ''; + ''; clean-store = pkgs.writeShellScriptBin "clean-store" '' if ! [ $(id -u) = 0 ]; then @@ -16,7 +16,7 @@ let fi rm /nix/var/nix/gcroots/auto/* nix-collect-garbage -d - ''; + ''; apply-system = pkgs.writeShellScriptBin "apply-system" '' if ! [ $(id -u) = 0 ]; then @@ -24,7 +24,7 @@ let exit 1 fi nixos-rebuild switch --flake /etc/nixos/# - ''; + ''; full-upgrade = pkgs.writeShellScriptBin "full-upgrade" '' if ! [ $(id -u) = 0 ]; then @@ -35,16 +35,10 @@ let apply-system ''; - polybar-tray = pkgs.writeShellScriptBin "polybar-tray" '' - u=$(xprop -name "Polybar tray window" _NET_WM_PID | awk '{print $3}') - if [ $u -Z ] - then polybar tray & - else kill $u - fi - ''; pastebin = pkgs.writeShellScriptBin "pastebin" '' curl -F 'clbin=<-' https://clbin.com ''; -in { - environment.systemPackages = [ update-system clean-store apply-system polybar-tray full-upgrade pastebin]; +in +{ + environment.systemPackages = [ update-system apply-system full-upgrade clean-store pastebin ]; } diff --git a/modules/smb.nix b/modules/smb.nix index e98f26d..8825132 100644 --- a/modules/smb.nix +++ b/modules/smb.nix @@ -1,10 +1,10 @@ -{username, ...}: +{ username, ... }: { services.samba-wsdd.enable = true; # make shares visible for windows 10 clients - networking.firewall = { - allowedTCPPorts = [ 139 445 ]; - allowedUDPPorts = [ 137 138 ]; - }; + networking.firewall = { + allowedTCPPorts = [ 139 445 ]; + allowedUDPPorts = [ 137 138 ]; + }; services.samba = { enable = true; securityType = "user"; diff --git a/modules/vfio.nix b/modules/vfio.nix index b439c2b..ba90102 100644 --- a/modules/vfio.nix +++ b/modules/vfio.nix @@ -5,7 +5,7 @@ kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; initrd.kernelModules = [ "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; extraModprobeConfig = '' - options vfio-pci ids=10de:228e,10de:2504 + options vfio-pci ids=10de:228e,10de:2504 ''; }; virtualisation = { @@ -15,41 +15,43 @@ runAsRoot = true; ovmf.enable = true; verbatimConfig = '' - user = "${username}" - group = "kvm" - namespaces = [] + user = "${username}" + group = "kvm" + namespaces = [] ''; }; }; }; - environment.systemPackages = with pkgs; [ virt-manager ]; - systemd.services.libvirtd.preStart = let - qemuHook = pkgs.writeScript "qemu-hook" '' - #!${pkgs.stdenv.shell} + environment.systemPackages = with pkgs; [ virt-manager ]; + systemd.services.libvirtd.preStart = + let + qemuHook = pkgs.writeScript "qemu-hook" '' + #!${pkgs.stdenv.shell} - GUEST_NAME="$1" - OPERATION="$2" - SUB_OPERATION="$3" + GUEST_NAME="$1" + OPERATION="$2" + SUB_OPERATION="$3" - if [ "$GUEST_NAME" == "Windows" ]; then - if [ "$OPERATION" == "start" ]; then - systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31 - systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31 - systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31 + if [ "$GUEST_NAME" == "Windows" ]; then + if [ "$OPERATION" == "start" ]; then + systemctl set-property --runtime -- user.slice AllowedCPUs=8-15,24-31 + systemctl set-property --runtime -- system.slice AllowedCPUs=8-15,24-31 + systemctl set-property --runtime -- init.scope AllowedCPUs=8-15,24-31 + fi + + if [ "$OPERATION" == "stopped" ]; then + systemctl set-property --runtime -- user.slice AllowedCPUs=0-31 + systemctl set-property --runtime -- system.slice AllowedCPUs=0-31 + systemctl set-property --runtime -- init.scope AllowedCPUs=0-31 + fi fi + ''; + in + '' + mkdir -p /var/lib/libvirt/hooks + chmod 755 /var/lib/libvirt/hooks - if [ "$OPERATION" == "stopped" ]; then - systemctl set-property --runtime -- user.slice AllowedCPUs=0-31 - systemctl set-property --runtime -- system.slice AllowedCPUs=0-31 - systemctl set-property --runtime -- init.scope AllowedCPUs=0-31 - fi - fi + # Copy hook files + ln -sf ${qemuHook} /var/lib/libvirt/hooks/qemu ''; - in '' - mkdir -p /var/lib/libvirt/hooks - chmod 755 /var/lib/libvirt/hooks - - # Copy hook files - ln -sf ${qemuHook} /var/lib/libvirt/hooks/qemu - ''; } diff --git a/modules/xserver.nix b/modules/xserver.nix index 3b85292..82e50fd 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -1,10 +1,10 @@ -{config, pkgs, username, ... }: +{ config, pkgs, username, ... }: { services.xserver = { enable = true; - videoDrivers = + videoDrivers = if (config.networking.hostName == "gerg-laptop") - then ["modesetting" "nvidia"] + then [ "modesetting" "nvidia" ] else [ "amdgpu" ]; layout = "us"; libinput.enable = true; @@ -18,47 +18,47 @@ enable = true; greeters.mini = { enable = true; - extraConfig = '' -[greeter] -user = ${username} -show-password-label = false -password-label-text = -invalid-password-text = -show-input-cursor = false -password-alignment = center -password-input-width = 19 -show-image-on-all-monitors = true + extraConfig = '' + [greeter] + user = ${username} + show-password-label = false + password-label-text = + invalid-password-text = + show-input-cursor = false + password-alignment = center + password-input-width = 19 + show-image-on-all-monitors = true -[greeter-hotkeys] -mod-key = meta -shutdown-key = s -restart-key = r -hibernate-key = h -suspend-key = u + [greeter-hotkeys] + mod-key = meta + shutdown-key = s + restart-key = r + hibernate-key = h + suspend-key = u -[greeter-theme] -font = "OverpassMono Nerd Font" -font-size = 1.1em -font-weight = bold -font-style = normal -text-color = "#7AA2F7" -error-color = "#DB4B4B" -background-image = "/etc/nixos/images/nix-stars.png" -background-color = "#000000" -window-color = "#000000" -border-color = "#000000" -border-width = 2px -layout-space = 15 -password-character = -1 -password-color = "#7AA2F7" -password-background-color = "#24283B" -password-border-color = "#000000" -password-border-width = 2px -password-border-radius = 0.341125em + [greeter-theme] + font = "OverpassMono Nerd Font" + font-size = 1.1em + font-weight = bold + font-style = normal + text-color = "#7AA2F7" + error-color = "#DB4B4B" + background-image = "/etc/nixos/images/nix-stars.png" + background-color = "#000000" + window-color = "#000000" + border-color = "#000000" + border-width = 2px + layout-space = 15 + password-character = -1 + password-color = "#7AA2F7" + password-background-color = "#24283B" + password-border-color = "#000000" + password-border-width = 2px + password-border-radius = 0.341125em - ''; + ''; }; }; }; diff --git a/modules/zsh.nix b/modules/zsh.nix index 6cec083..bc1fb68 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -17,7 +17,7 @@ enable = true; settings = { add_newline = false; - format="$sudo \n $directory$git_branch$character"; + format = "$sudo \n $directory$git_branch$character"; character = { success_symbol = "[ ](#9ece6a bold)"; error_symbol = "[ ](#db4b4b bold)"; @@ -28,7 +28,7 @@ git_branch = { style = "bold red"; }; - sudo ={ + sudo = { format = "[ ](#7aa2f7)"; disabled = false; }; diff --git a/pkgs/afk-cmds/afk-cmds/shell.nix b/pkgs/afk-cmds/afk-cmds/shell.nix index 41bd46d..a42d8ae 100644 --- a/pkgs/afk-cmds/afk-cmds/shell.nix +++ b/pkgs/afk-cmds/afk-cmds/shell.nix @@ -1,5 +1,5 @@ -let -pkgs = import {}; +let + pkgs = import { }; in with pkgs; mkShell rec { diff --git a/pkgs/afk-cmds/default.nix b/pkgs/afk-cmds/default.nix index c06f37a..dcef704 100644 --- a/pkgs/afk-cmds/default.nix +++ b/pkgs/afk-cmds/default.nix @@ -15,20 +15,20 @@ }: rustPlatform.buildRustPackage rec { pname = "afk-cmds"; - version= "1.0.0"; + version = "1.0.0"; src = ./afk-cmds; - + buildInputs = [ - libX11 - libXScrnSaver - cairo - glib - gdk-pixbuf - gtkmm3 - pango - libappindicator-gtk3 - atk + libX11 + libXScrnSaver + cairo + glib + gdk-pixbuf + gtkmm3 + pango + libappindicator-gtk3 + atk ]; nativeBuildInputs = [ diff --git a/pkgs/parrot/default.nix b/pkgs/parrot/default.nix index 48aa443..1740590 100644 --- a/pkgs/parrot/default.nix +++ b/pkgs/parrot/default.nix @@ -8,15 +8,15 @@ }: rustPlatform.buildRustPackage rec { pname = "parrot"; - version= "1.4.2"; - # buildFeatures = ["let_else"]; + version = "1.4.2"; + # buildFeatures = ["let_else"]; src = fetchFromGitHub { owner = "aquelemiguel"; repo = "parrot"; rev = "28d7db3c5b50c7ba01eec71a3177875feae44bcc"; sha256 = "sha256-G9SfaiR/KIt+Xm7vLs/EGaImZeSaUbpgAArfK6oVJeM="; }; - + buildInputs = [ yt-dlp openssl @@ -27,7 +27,7 @@ rustPlatform.buildRustPackage rec { cmake ]; cargoSha256 = "sha256-ScwyPTq9da0hst/b2FX89SP03OX3HrJT3oUKGsHEjgs="; - + RUSTC_BOOTSTRAP = 1; meta = with lib; { diff --git a/pkgs/t-rex-miner/default.nix b/pkgs/t-rex-miner/default.nix index 2d36403..b598228 100644 --- a/pkgs/t-rex-miner/default.nix +++ b/pkgs/t-rex-miner/default.nix @@ -3,13 +3,13 @@ , fetchzip , glibc }: -let -wrapper = '' - #!/bin/sh - export LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/ - exec ${glibc}/lib64/ld-linux-x86-64.so.2 \ - $out/t-rex --no-watchdog \$@ -''; +let + wrapper = '' + #!/bin/sh + export LD_LIBRARY_PATH=${stdenv.cc.cc.lib}/lib/:${glibc}/lib/:/run/opengl-driver/lib/ + exec ${glibc}/lib64/ld-linux-x86-64.so.2 \ + $out/t-rex --no-watchdog \$@ + ''; in stdenv.mkDerivation rec { pname = "t-rex-miner"; @@ -20,19 +20,19 @@ stdenv.mkDerivation rec { stripRoot = false; }; installPhase = '' - install -Dm555 $src/t-rex $out/t-rex - mkdir -p $out/bin - touch $out/bin/t-rex - echo "${wrapper}" > $out/bin/t-rex - chmod +x $out/bin/t-rex + install -Dm555 $src/t-rex $out/t-rex + mkdir -p $out/bin + touch $out/bin/t-rex + echo "${wrapper}" > $out/bin/t-rex + chmod +x $out/bin/t-rex ''; meta = with lib; { - homepage = "https://github.com/ISnortPennies/AFKCommands"; - description = ""; - license = licenses.unlicense; - maintainers = with maintainers; [ ]; - platforms = platforms.linux; + homepage = "https://github.com/ISnortPennies/AFKCommands"; + description = ""; + license = licenses.unlicense; + maintainers = with maintainers; [ ]; + platforms = platforms.linux; }; } diff --git a/suckless/default.nix b/suckless/default.nix index 90e1826..8ac0bf0 100644 --- a/suckless/default.nix +++ b/suckless/default.nix @@ -1,9 +1,10 @@ (final: super: rec { - st = (super.st.override { extraLibs = with super; [ xorg.libXcursor harfbuzz ]; - }).overrideAttrs (oldAttrs: rec { - src = ./st; + st = (super.st.override { + extraLibs = with super; [ xorg.libXcursor harfbuzz ]; + }).overrideAttrs (oldAttrs: rec { + src = ./st; + }); + dwm = (super.dwm.override { }).overrideAttrs (oldAttrs: rec { + src = ./dwm; }); - dwm = (super.dwm.override {}).overrideAttrs (oldAttrs: rec { - src = ./dwm; - }); }) diff --git a/suckless/st/shell.nix b/suckless/st/shell.nix index 2c91b32..d71f6b0 100644 --- a/suckless/st/shell.nix +++ b/suckless/st/shell.nix @@ -1,5 +1,5 @@ -let - pkgs = import {}; +let + pkgs = import { }; in with pkgs; mkShell rec { @@ -9,7 +9,7 @@ mkShell rec { xorg.libXft xorg.libXcursor ]; - nativeBuildInputs = [ + nativeBuildInputs = [ pkg-config ncurses fontconfig diff --git a/systems/desktop.nix b/systems/desktop.nix index 51395d2..5cd9a84 100644 --- a/systems/desktop.nix +++ b/systems/desktop.nix @@ -1,6 +1,6 @@ { config, pkgs, callPackage, lib, username, ... }: { -#important stuff first + #important stuff first imports = [ ../modules/amd.nix @@ -16,15 +16,15 @@ ]; networking.hostName = "gerg-desktop"; boot.kernelPackages = pkgs.linuxPackages_latest; - hardware.cpu.amd.updateMicrocode = true; -#end important stuff + hardware.cpu.amd.updateMicrocode = true; + #end important stuff environment.systemPackages = with pkgs; [ - #afk-cmds - xmrig - t-rex-miner - vscodium + #afk-cmds + xmrig + t-rex-miner + vscodium ]; -#user managment + #user managment users = { defaultUserShell = pkgs.zsh; users."${username}" = { @@ -34,12 +34,12 @@ }; boot = { initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "uas" "sd_mod" ]; - kernelModules = [ "kvm-amd" "msr"]; + kernelModules = [ "kvm-amd" "msr" ]; kernelParams = [ "iomem=relaxed" "msr.allow_writes=on" ]; }; fileSystems = { - "/" ={ + "/" = { device = "/dev/disk/by-uuid/e5c9634f-0273-4fd3-b35f-49899984340f"; fsType = "ext4"; }; @@ -52,18 +52,18 @@ #mining stuff systemd.services.mining = { enable = false; - path = with pkgs; [t-rex-miner afk-cmds st zsh dbus xmrig]; + path = with pkgs; [ t-rex-miner afk-cmds st zsh dbus xmrig ]; wantedBy = [ "graphical.target" ]; script = '' - afk-cmds -c /home/gerg/afk-cmds.json - ''; + afk-cmds -c /home/${username}/afk-cmds.json + ''; environment = { - # PATH="/run/current-system/sw/bin"; missing something with dbus - XAUTHORITY="/home/${username}/.Xauthority"; - DISPLAY=":0"; - XDG_DATA_DIRS="/nix/var/nix/profiles/default/share:/run/current-system/sw/share"; - DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; - NO_AT_BRIDGE="1"; + # PATH="/run/current-system/sw/bin"; missing something with dbus + XAUTHORITY = "/home/${username}/.Xauthority"; + DISPLAY = ":0"; + XDG_DATA_DIRS = "/nix/var/nix/profiles/default/share:/run/current-system/sw/share"; + DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus"; + NO_AT_BRIDGE = "1"; }; }; } diff --git a/systems/laptop.nix b/systems/laptop.nix index 1501ea2..1a927d7 100644 --- a/systems/laptop.nix +++ b/systems/laptop.nix @@ -1,4 +1,4 @@ -{ config, pkgs, callPackage, lib, ... }: +{ config, pkgs, callPackage, lib, username, ... }: { #important stuff first imports = @@ -14,18 +14,18 @@ ]; networking.hostName = "gerg-laptop"; boot.kernelPackages = pkgs.linuxPackages_latest; - hardware.cpu.amd.updateMicrocode = true; - + hardware.cpu.amd.updateMicrocode = true; + # end important stuff environment.systemPackages = with pkgs; [ xorg.xf86videoamdgpu ]; -# user managment + # user managment users = { defaultUserShell = pkgs.zsh; - users.gerg = { + users."${username}" = { isNormalUser = true; - extraGroups = [ "wheel" "audio" "networkmanager"]; + extraGroups = [ "wheel" "audio" "networkmanager" ]; }; }; boot = { @@ -33,7 +33,7 @@ kernelModules = [ "kvm-amd" ]; }; fileSystems = { - "/" = { + "/" = { device = "/dev/disk/by-uuid/c67796b3-d502-47db-8d0e-48f30bc91041"; fsType = "ext4"; };