From 23942b961e72f4489269fe1a64cee7694914165b Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Wed, 12 Feb 2025 13:08:02 +1000 Subject: [PATCH] no idea what I changed but im sure its fine --- README | 15 +++++++ homes/me/default.nix | 11 ++++++ homes/modules/btop.nix | 79 +++++++++++++++++++++++++++++++++++++ homes/modules/fish.nix | 3 +- hosts/hyrule/default.nix | 83 +++++++++++++++++++++++++++++++++++++++ hosts/myputer/default.nix | 22 ++++++++++- modules/wishlist.nix | 72 +++++++++++++++++++++++++++++++++ modules/wishlist.nix.bak | 22 +++++++++++ 8 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 README create mode 100644 homes/modules/btop.nix create mode 100755 hosts/hyrule/default.nix create mode 100644 modules/wishlist.nix create mode 100644 modules/wishlist.nix.bak diff --git a/README b/README new file mode 100644 index 0000000..64fb0f3 --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +## Users + +#### me +My main personal account, used on my PC and laptop. +Contains a hyprland graphical environment by default. + +#### ae +Primary account on my servers. Contains the bare +essentials for my work, no graphical environment. + + +#### friends +A simple account I let me friends connect to. +Limited functionality, mostly just for letting +them test small things or for giving them files. diff --git a/homes/me/default.nix b/homes/me/default.nix index 743afa4..362ebf1 100755 --- a/homes/me/default.nix +++ b/homes/me/default.nix @@ -16,6 +16,7 @@ ../modules/fish.nix ../modules/editor/helix.nix + ../modules/btop.nix ../modules/rio.nix ../modules/firefox.nix ../modules/nixcord.nix @@ -89,6 +90,16 @@ # these are both required for home-manager to work home-manager.enable = true; + # DEBUG: testing if my xdg-desktop-portal-hyprland is working or not + obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; + # I want to use fish as my login shell but it always # goes terrible cause it isn't POSIX compliant, so # instead Bash is my login and it will just exec fish diff --git a/homes/modules/btop.nix b/homes/modules/btop.nix new file mode 100644 index 0000000..119da4f --- /dev/null +++ b/homes/modules/btop.nix @@ -0,0 +1,79 @@ +{config, ...}: { + programs.btop = { + enable = true; + + settings = { + # Theming + color_theme = "dracula"; + theme_background = true; + truecolor = true; + force_tty = false; + vim_keys = false; # allow vim keybindings + # Units + clock_format = "%I:%M %p, %b %d"; + temp_scale = "celsius"; + base_10_sizes = false; # use KB or KiB + + # UI + background_update = true; + update_ms = 2000; + rounded_corners = false; + graph_symbol = "braille"; # braille/block/tty + graph_symbol_cpu = "default"; + graph_symbol_mem = "default"; + graph_symbol_net = "default"; + graph_symbol_proc = "default"; + + # Processes Window + proc_left = true; # show on left side of window + proc_colors = true; + proc_gradient = true; + proc_per_core = false; # false: % of ALL cores + proc_mem_bytes = false; # show mem usage as % + proc_sorting = "cpu lazy"; + proc_filter_kernel = false; # hide kernel child processes + proc_tree = false; + + # CPU Window + cpu_bottom = false; # display at bottom of window + show_uptime = true; + show_cpu_freq = true; + check_temp = true; # show cpu temp + show_coretemp = true; # show temp per core + cpu_graph_upper = "total"; # upper graph shows total CPU usage + cpu_graph_lower = "user"; # lower graph shows user's CPU usage + cpu_invert_lower = true; + cpu_single_graph = false; # disable lower graph + show_gpu_info = "Off"; # Auto/On/Off + gpu_mirror_graph = false; # horizontally mirror gpu graph + + # Memory Window + mem_below_net = false; # show below net window + mem_graphs = true; # show graphs not meters + show_swap = true; # show swap memory usage + # Disks Subwindow + show_disks = true; # split mem box to show disk info + swap_disk = true; # show swap memory as disk + show_io_stat = true; + io_graph_combined = false; # combine read/write stats + io_mode = true; # show io stat as graph + use_fstab = true; # read disk list from /etc/fstab + only_physical = false; # ignore non-physical disks + + # Network Window + net_iface = ""; # default network interface to monitor + net_auto = true; # overrides net_download/net_upload (below) + net_sync = false; # sync download/upload graph scales + net_download = 100; # max download speed graphed + net_upload = 100; # max upload speed graphed + + # Battery + show_battery = true; + selected_battery = "Auto"; + show_battery_watts = true; + + # Other + log_level = "WARNING"; # ERROR/WARNING/INFO/DEBUG + }; + }; +} diff --git a/homes/modules/fish.nix b/homes/modules/fish.nix index 3cb9bc7..e46175d 100755 --- a/homes/modules/fish.nix +++ b/homes/modules/fish.nix @@ -6,7 +6,8 @@ programs.fish = { enable = true; interactiveShellInit = '' - set -g fish_greeting "Welcome weary traveler to my shop" + #set -g fish_greeting "Welcome weary traveler to my shop" + cat ~/banner ''; plugins = [ { diff --git a/hosts/hyrule/default.nix b/hosts/hyrule/default.nix new file mode 100755 index 0000000..d8f3e55 --- /dev/null +++ b/hosts/hyrule/default.nix @@ -0,0 +1,83 @@ +{ + pkgs, + inputs, + lib, + ... +}: let + home-manager = builtins.fetchTarball { + url = "https://github.com/nix-community/home-manager/archive/master.tar.gz"; + sha256 = "19w63qccz78v0spx03911z98w1bvlxvd07hb0ma14a4vdzi4ninj"; + }; +in { + # TODO: + # - add github:charmbracelet/soft-serve + # - add forgejo + + imports = [ + #../modules/server/nginx.nix + #../modules/server/ssh.nix + #../modules/server/fail2ban.nix + ]; + + system.stateVersion = "24.11"; # DO NOT MODIFY + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + time.timeZone = "Australia/Brisbane"; + + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + }; + + boot.loader = { + # TODO + }; + + networking = { + hostName = "imbored"; + networkmanager.enable = true; + firewall.allowedTCPPorts = [ + 22 # sshd + ] + }; + + users = { + defaultUserShell = pkgs.bash; + + users = { + # primary user + dev = { + isNormalUser = true; + extraGroups = ["wheel"]; + shell = pkgs.bash; + packages = with pkgs; [ + ]; + }; + + # user for friends to ssh into + friends = { + isNormalUser = true; + shell = pkgs.bash; + packages = with pkgs; [ + ]; + }; + }; + }; + + #home-manager = { + # users = { + # dev = import ../../homes/dev; + # friends = import ../../homes/friends; + # }; + #}; + + environment.SystemPackages = with pkgs; [ + ]; + + programs = { + }; +} diff --git a/hosts/myputer/default.nix b/hosts/myputer/default.nix index 4be5679..3759e9e 100755 --- a/hosts/myputer/default.nix +++ b/hosts/myputer/default.nix @@ -142,12 +142,16 @@ in { ]; }; + # Hint Electrons apps to use Wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + # ---- SYSTEM PACKAGES ----- environment.systemPackages = with pkgs; [ # User Environment inputs.swww.packages.${pkgs.system}.swww helvum easyeffects + pavucontrol ani-cli wl-clipboard # clipboard for wayland hyprpicker @@ -167,7 +171,7 @@ in { zoxide doggo tldr - btop + #btop # Pretty necessary git @@ -181,6 +185,22 @@ in { unzip ]; + # DEBUG: configuring xdg portal here instead? + # REFERENCE: https://discourse.nixos.org/t/hyprland-screen-sharing/43658 + #xdg.portal = { + # enable = true; + # xdgOpenUsePortal = true; + # config = { + # common.default = ["gtk"]; + # hyprland.default = ["gtk" "hyprland"]; + # }; + # extraPortals = with pkgs; [ + # #xdg-desktop-portal-gtk + # #xdg-desktop-portal-wlr + # xdg-desktop-portal-hyprland + # ]; + #}; + # Enable the use of certain programs programs = { hyprland = { diff --git a/modules/wishlist.nix b/modules/wishlist.nix new file mode 100644 index 0000000..62cc408 --- /dev/null +++ b/modules/wishlist.nix @@ -0,0 +1,72 @@ +{ + description = "Wishlist: Your SSH directory." + + inputs = { + + }; + + outputs = { + self + }: let + nixosModule = { + config, + lib, + pkgs, + ... + }: { + options.services.wishlist = { + enable = lib.mkEnableOption "Your SSH directory."; + + port = lib.mkOption { + type = lib.types.port; + default = 22; + description = "Port to listen on"; + }; + }; + + config = lib.mkIf config.services.wishlist.enable { + # configure the systemd service + systemd.services.wishlist = { + description = "Your SSH directory."; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + ExecStart = "${self.packages.${pkgs.system}.default}/bin/wishlist"; + Restart = "always"; + Type = "simple"; + DynamicUser = "yes"; + }; + # environment variables + environment = { + + }; + }; + }; + }; + in + (flake-utils.lib.eachDefaultSystem (system: let + gopkg = go-nixpkgs.legacyPackages.${system}; + in { + packages.default = gopkg.buildGoModule ############################ + })) + buildGoModule rec { # is rec necessary? + pname = "wishlist"; + version = "0.15.1" + + src = fetchFromGithub { + owner = "charmbracelet"; + repo = "wishlist"; + rev = "v${version}"; + hash = "0c9g1s8j9znzd1mw61d0klc6sqri0wx6hljibxdwzi3cabfy3ld6"; + }; + + vendorSha256 = lib.fakeSha256; + + meta = with lib; { + homepage = "https://github.com/charmbracelet/wishlist"; + description = "Your SSH directory."; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ caarlos0 ]; + }; + }; +} diff --git a/modules/wishlist.nix.bak b/modules/wishlist.nix.bak new file mode 100644 index 0000000..3f190ad --- /dev/null +++ b/modules/wishlist.nix.bak @@ -0,0 +1,22 @@ +{lib}: { + buildGoModule rec { # is rec necessary? + pname = "wishlist"; + version = "0.15.1" + + src = fetchFromGithub { + owner = "charmbracelet"; + repo = "wishlist"; + rev = "v${version}"; + hash = "0c9g1s8j9znzd1mw61d0klc6sqri0wx6hljibxdwzi3cabfy3ld6"; + }; + + vendorSha256 = lib.fakeSha256; + + meta = with lib; { + homepage = "https://github.com/charmbracelet/wishlist"; + description = "Your SSH directory."; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ caarlos0 ]; + }; + }; +}