From 375a6dc02fa26db4f5275dae1b26fe374708a815 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Tue, 6 Jun 2023 16:26:04 -0400 Subject: [PATCH] trying to get this shit to build --- flake.lock | 18 +----- flake.nix | 26 ++++---- homeConfig/home.nix | 4 +- .../modules/alacritty/config/alacritty.nix | 61 +++++++++---------- homeConfig/modules/bash/config/alias.nix | 8 +-- homeConfig/modules/browsers/config/bryan.nix | 12 ++-- homeConfig/modules/browsers/default.nix | 2 +- homeConfig/modules/default.nix | 2 +- homeConfig/modules/gpg/default.nix | 10 +-- homeConfig/modules/gui/config/rofi.nix | 5 +- homeConfig/modules/gui/config/sway.nix | 43 +++++++------ homeConfig/modules/gui/default.nix | 6 +- homeConfig/modules/neovim/config/plugins.nix | 10 ++- homeConfig/modules/security/default.nix | 4 +- homeConfig/modules/utils/default.nix | 6 +- sysConfig/desktop/hardware.nix | 5 +- sysConfig/desktop/system.nix | 4 +- 17 files changed, 111 insertions(+), 115 deletions(-) diff --git a/flake.lock b/flake.lock index 81fb4d2..aaca325 100644 --- a/flake.lock +++ b/flake.lock @@ -57,27 +57,11 @@ "type": "github" } }, - "nur": { - "locked": { - "lastModified": 1686076172, - "narHash": "sha256-FA0RCy8AkxWCfhdCfTNjHG2IMM14HZ50IUIkVbJRVF0=", - "owner": "nix-community", - "repo": "NUR", - "rev": "b2adbf0149922d8503a89bccf099ffdc22907d51", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "root": { "inputs": { "disko": "disko", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "nur": "nur" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 8e4745b..9243630 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,9 @@ -{ description = "Fully Declarative YOLO"; +{ + description = "Fully Declarative YOLO"; - inputs = - { + inputs = + { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nur.url = "github:nix-community/NUR"; home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; @@ -14,21 +14,25 @@ }; }; - outputs = { self, nixpkgs, nur, home-manager, disko }: + outputs = { self, nixpkgs, home-manager, disko }: let system = "x86_64-linux"; + overlays = [ + (self: super: { + nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") + {inherit self;}; + }) + ]; pkgs = import nixpkgs { - inherit system; + inherit system overlays; config = { allowUnfree = true; - packageOverrides = pkgs: { - nur = import nur { inherit pkgs; }; - }; }; }; - in - { nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { + in + { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { inherit system; modules = [ ./sysConfig/desktop diff --git a/homeConfig/home.nix b/homeConfig/home.nix index cfe66cf..91144a1 100644 --- a/homeConfig/home.nix +++ b/homeConfig/home.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ ... }: { programs.home-manager.enable = true; @@ -8,7 +8,7 @@ home.username = "bryan"; home.homeDirectory = "/home/bryan"; - config.modules = { + modules = { gui.enable = true; browsers.enable = true; alacritty.enable = true; diff --git a/homeConfig/modules/alacritty/config/alacritty.nix b/homeConfig/modules/alacritty/config/alacritty.nix index 28053c8..92ca48f 100644 --- a/homeConfig/modules/alacritty/config/alacritty.nix +++ b/homeConfig/modules/alacritty/config/alacritty.nix @@ -1,6 +1,5 @@ { pkgs, lib, ... }: -with lib; { enable = true; settings = { @@ -15,63 +14,63 @@ with lib; colors = { primary = { - background = 0x0d1117; - foreground = 0xb3b1ad; + background = "#0d1117"; + foreground = "#b3b1ad"; }; normal = { - black = 0x484f58; - red = 0xff7b72; - green = 0x3fb950; - yellow = 0xd29922; - blue = 0x58a6ff; - magenta = 0xbc8cff; - cyan = 0x39c5cf; - white = 0xb1bac4; + black = "#484f58"; + red = "#ff7b72"; + green = "#3fb950"; + yellow = "#d29922"; + blue = "#58a6ff"; + magenta = "#bc8cff"; + cyan = "#39c5cf"; + white = "#b1bac4"; }; bright = { - black = 0x6e7681; - red = 0xffa198; - green = 0x56d364; - yellow = 0xe3b341; - blue = 0x79c0ff; - magenta = 0xd2a8ff; - cyan = 0x56d4dd; - white = 0xf0f6fc; + black = "#6e7681"; + red = "#ffa198"; + green = "#56d364"; + yellow = "#e3b341"; + blue = "#79c0ff"; + magenta = "#d2a8ff"; + cyan = "#56d4dd"; + white = "#f0f6fc"; }; }; font = { normal = { - family = terminus-nerdfont; - style = Medium; + family = "Terminus (TTF)"; + style = "Regular"; }; bold = { - family = terminus-nerdfont; - style = Bold; + family = "Terminus (TTF)"; + style = "Bold"; }; italic = { - family = terminus-nerdfont; - style = Medium Italic; + family = "Terminus (TTF)"; + style = "Italic"; }; bold_italic = { - family = terminus-nerdfont; - style = Bold Italic; + family = "Terminus (TTF)"; + style = "Bold Italic"; }; }; size = 14; cursor = { - color = 0xffffff; + color = "#ffffff"; style = { - shape = Block; - blinking = Always; - blink-interval = 750; + shape = "Block"; + blinking = "Always"; + blink_interval = 750; }; }; }; diff --git a/homeConfig/modules/bash/config/alias.nix b/homeConfig/modules/bash/config/alias.nix index b647675..9d452d3 100644 --- a/homeConfig/modules/bash/config/alias.nix +++ b/homeConfig/modules/bash/config/alias.nix @@ -1,4 +1,4 @@ -'' -hmup = "home-manager switch --flake '$HOME/Documents/projects/nixos#bryan'"; -nixup = "sudo nixos-rebuild switch --flake '$HOME/Documents/projects/nixos#socratesV2'"; -'' +{ + hmup = "home-manager switch --flake '$HOME/Documents/projects/nixos#bryan'"; + nixup = "sudo nixos-rebuild switch --flake '$HOME/Documents/projects/nixos#socratesV2'"; +} diff --git a/homeConfig/modules/browsers/config/bryan.nix b/homeConfig/modules/browsers/config/bryan.nix index 5677953..84589f9 100644 --- a/homeConfig/modules/browsers/config/bryan.nix +++ b/homeConfig/modules/browsers/config/bryan.nix @@ -3,12 +3,12 @@ { isDefault = true; search.default = "Startpage"; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - ublock-origin - darkreader - keepassxc-browser - multi-account-containers - ]; +# extensions = with pkgs.nur.repos.rycee.firefox-addons; [ +# ublock-origin +# darkreader +# keepassxc-browser +# multi-account-containers +# ]; settings = { "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org"; diff --git a/homeConfig/modules/browsers/default.nix b/homeConfig/modules/browsers/default.nix index e139a6b..27e5d01 100644 --- a/homeConfig/modules/browsers/default.nix +++ b/homeConfig/modules/browsers/default.nix @@ -12,7 +12,7 @@ in profiles.bryan = import config/bryan.nix { inherit pkgs; }; }; - home.packages = [ + home.packages = with pkgs; [ google-chrome (tor-browser-bundle-bin.override { useHardenedMalloc = false; # NixOS bug requires this diff --git a/homeConfig/modules/default.nix b/homeConfig/modules/default.nix index 77e83b1..3d47edb 100644 --- a/homeConfig/modules/default.nix +++ b/homeConfig/modules/default.nix @@ -13,5 +13,5 @@ ./neovim/default.nix ./security/default.nix ./utils/default.nix - ] { inherit pkgs; }; + ]; } diff --git a/homeConfig/modules/gpg/default.nix b/homeConfig/modules/gpg/default.nix index 6ebb47a..bffa714 100644 --- a/homeConfig/modules/gpg/default.nix +++ b/homeConfig/modules/gpg/default.nix @@ -8,10 +8,12 @@ in config = mkIf cfg.enable { programs.gpg = { enable = true; - publicKeys."bryan@ramos.codes" = { - trust = 5; - text = import ./config/pubKey.nix; - }; + publicKeys = [ + { + text = import ./config/pubKey.nix; + trust = 5; + } + ]; }; programs.ssh.enable = true; diff --git a/homeConfig/modules/gui/config/rofi.nix b/homeConfig/modules/gui/config/rofi.nix index f86ca4e..1987a12 100644 --- a/homeConfig/modules/gui/config/rofi.nix +++ b/homeConfig/modules/gui/config/rofi.nix @@ -1,5 +1,8 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, config, ... }: +let + inherit (config.lib.formats.rasi) mkLiteral; +in with lib; { enable = true; package = pkgs.rofi-wayland; diff --git a/homeConfig/modules/gui/config/sway.nix b/homeConfig/modules/gui/config/sway.nix index 624e057..67fac8a 100644 --- a/homeConfig/modules/gui/config/sway.nix +++ b/homeConfig/modules/gui/config/sway.nix @@ -7,6 +7,16 @@ in { enable = true; xwayland = true; wrapperFeatures.gtk = true; + + extraOptions = [ + "--unsupported-gpu" + "--my-next-gpu-wont-be-nvidia" + ]; + + extraSessionCommands = '' + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + config = { modifier = "Mod1"; menu = "\${pkgs.rofi-wayland}/bin/rofi -show drun -show-icons -drun-icon-theme Qogir -font 'Noto Sans 14'"; @@ -24,16 +34,20 @@ in }; }; - bars.sway-bar = { - position = "top"; - statusCommand = ''while :; do echo "$(free -h | awk '/^Mem/ {print $3}') '|' $(date +'%I:%M:%S %p') '|' $(date +'%m-%d-%Y')"; sleep 1; done''; - fonts = { - names = [ "Noto Sans" "Noto Emoji" "Noto Color Emoji" ]; - size = 10.0; - }; - colors.background = "#0A0E14"; - colors.statusline = "#FFFFFF"; - }; + bars = [ + { + position = "top"; + statusCommand = ''while :; do echo "$(free -h | awk '/^Mem/ {print $3}') '|' $(date +'%I:%M:%S %p') '|' $(date +'%m-%d-%Y')"; sleep 1; done''; + fonts = { + names = [ "Noto Sans" "Noto Emoji" "Noto Color Emoji" ]; + size = 10.0; + }; + colors = { + background = "#0A0E14"; + statusline = "#FFFFFF"; + }; + } + ]; gaps = { smartGaps = false; @@ -51,14 +65,5 @@ in "${modifier}+Shift+f" = "exec alacritty -e ranger"; "${modifier}+Shift+d" = "exec emote"; }; - - extraOptions = [ - "--unsupported-gpu" - "--my-next-gpu-wont-be-nvidia" - ]; - - extraSessionCommands = '' - export _JAVA_AWT_WM_NONREPARENTING=1 - ''; }; } diff --git a/homeConfig/modules/gui/default.nix b/homeConfig/modules/gui/default.nix index 9f9a30f..64a4d51 100644 --- a/homeConfig/modules/gui/default.nix +++ b/homeConfig/modules/gui/default.nix @@ -3,12 +3,12 @@ with lib; let cfg = config.modules.gui; - + in { options.modules.gui = { enable = mkEnableOption "gui"; }; config = mkIf cfg.enable { wayland.windowManager.sway = import ./config/sway.nix { inherit pkgs config lib; }; - programs.rofi = import ./config/rofi.nix { inherit pkgs lib; }; + programs.rofi = import ./config/rofi.nix { inherit pkgs config lib; }; gtk = { enable = true; @@ -21,7 +21,7 @@ in programs.btop.enable = true; fonts.fontconfig.enable = true; - home.packages = [ + home.packages = with pkgs; [ xdg-utils grim slurp diff --git a/homeConfig/modules/neovim/config/plugins.nix b/homeConfig/modules/neovim/config/plugins.nix index e36d324..be0a373 100644 --- a/homeConfig/modules/neovim/config/plugins.nix +++ b/homeConfig/modules/neovim/config/plugins.nix @@ -3,11 +3,9 @@ let github-theme = pkgs.vimUtils.buildVimPlugin { name = "github-theme"; - src = pkgs.fetchFromGithub { - owner = "projekt0n"; - repo = "github-nvim-theme"; - rev = "ea713c37691b2519f56cd801a2330bdf66393d0f"; - sha256 = "0cwr3b5r2ac7aizxmwb3mlhdc2sh0pw670vcwps79x9jp52yrj2y"; + src = builtins.fetchTarball { + url = "https://github.com/projekt0n/github-nvim-theme/archive/refs/tags/v1.0.0.tar.gz"; + sha256 = "15c65qw1sgw3v5wrwbg5f1fqb82qq1yr44g2nrwb7b7m134jyr1h"; }; }; @@ -23,7 +21,7 @@ with pkgs.vimPlugins; ''; } - { plugin = lazygit.nvim; } + { plugin = lazygit-nvim; } { plugin = LazyVim; diff --git a/homeConfig/modules/security/default.nix b/homeConfig/modules/security/default.nix index 529ada8..c536f4a 100644 --- a/homeConfig/modules/security/default.nix +++ b/homeConfig/modules/security/default.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ pkgs, lib, config, ... }: with lib; let @@ -7,7 +7,7 @@ let in { options.modules.security = { enable = mkEnableOption "security"; }; config = mkIf cfg.enable { - home.packages = [ + home.packages = with pkgs; [ keepassxc wireguard-tools ipscan ]; }; diff --git a/homeConfig/modules/utils/default.nix b/homeConfig/modules/utils/default.nix index e6b904b..3fd1c07 100644 --- a/homeConfig/modules/utils/default.nix +++ b/homeConfig/modules/utils/default.nix @@ -12,11 +12,11 @@ in home.packages = with pkgs; [ wget curl tree neofetch - unzip fping calc qrendcode + unzip fping calc qrencode fd pkg-config pciutils neofetch mdbook rsync - android-studio docker - gcc gnumake + docker gcc gnumake + android-studio ]; }; } diff --git a/sysConfig/desktop/hardware.nix b/sysConfig/desktop/hardware.nix index 7922d74..da1084f 100644 --- a/sysConfig/desktop/hardware.nix +++ b/sysConfig/desktop/hardware.nix @@ -53,8 +53,8 @@ }; # Virtualisation - nix.settings.system-features = "kvm"; - environment.systemPackages = pkgs.virt-manager; + nix.settings.system-features = [ "kvm" ]; + environment.systemPackages = [ pkgs.virt-manager ]; virtualisation.libvirtd = { enable = true; @@ -66,6 +66,7 @@ }; # CPU + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/sysConfig/desktop/system.nix b/sysConfig/desktop/system.nix index 528283a..703f5ae 100644 --- a/sysConfig/desktop/system.nix +++ b/sysConfig/desktop/system.nix @@ -80,7 +80,7 @@ # Networking networking = { - hostName = "socratesV2"; + hostName = "socrates"; useDHCP = lib.mkDefault true; networkmanager.enable = true; firewall = { @@ -93,7 +93,7 @@ enable = true; startWhenNeeded = true; settings = { - permitRootLogin = false; +# permitRootLogin = false; X11Forwarding = true; PasswordAuthentication = false; };