From 0a3a6501c52ef3f930b83c264cccfd8d8303c26d Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 23 Jul 2024 21:41:13 +0100 Subject: mantis --- flake.nix | 12 ++++++ hosts/mantis/configuration.nix | 89 +++++++----------------------------------- programs/atuin.nix | 10 +++++ programs/tmux.nix | 2 +- scripts/battery.nix | 6 +++ 5 files changed, 44 insertions(+), 75 deletions(-) diff --git a/flake.nix b/flake.nix index 16326a5..a781e59 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,18 @@ imports = [ ./hosts/mantis/configuration.nix ]; _module.args.self = self; } + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.op = { + imports = [ ./hosts/mantis/home.nix ]; + _module.args.self = self; + _module.args.inputs = inputs; + _module.args.theme = import ./theme; + _module.args.font = import ./font.nix; + }; + } ]; }; diff --git a/hosts/mantis/configuration.nix b/hosts/mantis/configuration.nix index acc2a49..c774eef 100644 --- a/hosts/mantis/configuration.nix +++ b/hosts/mantis/configuration.nix @@ -1,6 +1,6 @@ # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, self, ... }: { imports = @@ -12,58 +12,19 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "mantis"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. - - # Set your time zone. + networking.hostName = "mantis"; time.timeZone = "Europe/London"; - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # useXkbConfig = true; # use xkb.options in tty. - # }; - - # Enable the X11 windowing system. - services.xserver.enable = true; - - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - - - # Configure keymap in X11 - # services.xserver.xkb.layout = "us"; - # services.xserver.xkb.options = "eurosign:e,caps:escape"; - - # Enable CUPS to print documents. - # services.printing.enable = true; - - # Enable sound. - # hardware.pulseaudio.enable = true; - # OR - # services.pipewire = { - # enable = true; - # pulse.enable = true; - # }; + nixpkgs.overlays = with self.overlays; [ + prompt + better-text-objs + vim-colors-plain + ]; - # Enable touchpad support (enabled default in most desktopManager). - services.xserver.libinput.enable = true; - services.tailscale.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.op = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" ]; packages = with pkgs; [ qutebrowser tree @@ -72,39 +33,19 @@ home = "/home/op"; }; - # List packages installed in system profile. To search, run: - # $ nix search wget environment.systemPackages = with pkgs; [ - vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - wget - git + man-pages + man-pages-posix + (lib.hiPrio pkgs.bashInteractive_5) ]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: + services = { + openssh.enable = true; + tailscale.enable = true; + }; - # Enable the OpenSSH daemon. - services.openssh.enable = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # Copy the NixOS configuration file and link it from the resulting system - # (/run/current-system/configuration.nix). This is useful in case you - # accidentally delete configuration.nix. - # system.copySystemConfiguration = true; - # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # diff --git a/programs/atuin.nix b/programs/atuin.nix index 2a501fc..38dac37 100644 --- a/programs/atuin.nix +++ b/programs/atuin.nix @@ -2,5 +2,15 @@ programs.atuin = { enable = true; enableBashIntegration = true; + settings = { + invert = true; + history_format = "{command}"; + theme.name = "minimal"; + style = "compact"; + inline_height = 10; + prefers_reduced_motion = true; + show_help = false; + show_tabs = false; + }; }; } diff --git a/programs/tmux.nix b/programs/tmux.nix index 43778dd..c8745c7 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -138,7 +138,7 @@ in # status left set -g status-left-length 70 set -g status-left "#[fg=colour7]#(bat -q) " - set -ag status-left "#[fg=colour15]#(${cmus-np}/bin/cmus-np) #[fg=colour8]#(${cmus-status}/bin/cmus-status)" + # set -ag status-left "#[fg=colour15]#(${cmus-np}/bin/cmus-np) #[fg=colour8]#(${cmus-status}/bin/cmus-status)" # include pwd and branch in pane border set -g pane-border-status top diff --git a/scripts/battery.nix b/scripts/battery.nix index 87b6cff..3aed4f9 100644 --- a/scripts/battery.nix +++ b/scripts/battery.nix @@ -17,6 +17,12 @@ pkgs.writeScriptBin name bat_status="" bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) + + if [ -z $bat_status ]; then + echo -ne "#[fg=color2]${symbol} #[fg=colour8]$HOSTNAME" + exit 0 + fi + charging_status=$( cat /sys/class/power_supply/BAT0/status ) health() { -- cgit v1.2.3