diff --git a/home-manager/cli.nix b/home-manager/cli.nix index 6ec32c2..a1f1b04 100644 --- a/home-manager/cli.nix +++ b/home-manager/cli.nix @@ -72,10 +72,9 @@ plugins = with pkgs.vimPlugins; [ goyo-vim limelight-vim - twilight-nvim + vim-numbertoggle vim-nix vimwiki - zen-mode-nvim ]; }; yt-dlp = { diff --git a/home-manager/dots/river.nix b/home-manager/dots/river.nix index c239655..76859d6 100644 --- a/home-manager/dots/river.nix +++ b/home-manager/dots/river.nix @@ -1,10 +1,9 @@ { pkgs, config, ... }: { xdg.configFile = { - "init" = { + "river/init" = { enable = true; executable = true; - target = "river/init"; text = '' #!/usr/bin/env sh # See the river(1), riverctl(1), and rivertile(1) man pages for complete @@ -22,10 +21,11 @@ riverctl spawn "wl-paste --type text --watch cliphist store" riverctl spawn "wl-paste --type image --watch cliphist store" riverctl spawn "mullvad-gui" + riverctl spawn "nm-applet" # Theme riverctl background-color 0x${config.colorScheme.colors.base00} - riverctl border-color-focused 0x${config.colorScheme.colors.base0D} + riverctl border-color-focused 0x${config.colorScheme.colors.base0C} riverctl border-color-unfocused 0x${config.colorScheme.colors.base00} # Launch Shortcuts @@ -162,6 +162,11 @@ riverctl hide-cursor when-typing enabled riverctl set-cursor-warp on-focus-change riverctl focus-follows-cursor always + + riverctl focus-output DP-1 + riverctl send-layout-cmd rivertile "main-location right" + riverctl focus-output DP-2 + riverctl send-layout-cmd rivertile "main-location left" ''; }; }; diff --git a/home-manager/dots/waybar.nix b/home-manager/dots/waybar.nix index 3ec3c8a..ee965e1 100644 --- a/home-manager/dots/waybar.nix +++ b/home-manager/dots/waybar.nix @@ -1,111 +1,110 @@ { pkgs, config, ... }: { - programs.waybar = { - enable = true; - settings = [ - { - mainBar = { - exclusive = false; - position = "top"; - height = 22; - spacing = 16; - fixed-center = false; - }; - modules-left = [ - "user" - "cpu" - "memory" - "network" - "disk#root" - "disk#home" - "river/mode" - ]; - modules-center = [ - "cava" - ]; - modules-right = [ - "tray" - "clock" - ]; - user = { - format = " {work_d}:{work_H}:{work_M}:{work_S} uptime"; - interval = 1; - }; - cpu = { - interval = 1; - format = "cpu {load} {icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}{icon20}{icon21}{icon22}{icon23}"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - ]; - }; - memory = { - interval = 30; - format = "mem {used:0.1f}G / {total:0.1f}G"; - }; - network = { - interval = 10; - interface = "enp4s0"; - format = "{ifname} {bandwidthUpBits} up / {bandwidthDownBits} down"; - format-disconnected = ""; - tooltip-format = "{ipaddr}/{cidr} via {gwaddr}"; - }; - "disk#root" = { - interval = 60; - format = "{free} free on {path}"; - path = "/"; - }; - "disk#home" = { - interval = 60; - format = "{free} free on {path}"; - path = "/home"; - }; - cava = { - cava_config = "$XDG_CONFIG_HOME/cava/config"; - framerate = 30; - autosens = 1; - bars = 64; - lower_cutoff_freq = 50; - higher_cutoff_freq = 10000; - method = "pulse"; - source = "auto"; - stereo = true; - reverse = false; - bar_delimiter = 0; - monstercat = false; - waves = false; - noise_reduction = 0.77; - input_delay = 1; - format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; - }; - tray = { - icon-size = 18; - spacing = 4; - }; - clock = { - format = "{:%H:%M:%S}"; - tooltip-format = "{:%Y %B}\n{calendar}"; - format-alt = "{:%Y-%m-%d}"; - interval = 1; - }; - } - ]; - style = '' - * { - border: none; - border-radius: 0; - font-family: Comic Mono 12; - } - window#waybar { - background: "#${config.colorScheme.colors.base00}"; - foreground: "#${config.colorScheme.colors.base07}"; - } - ''; + xdg.configFile = { + "waybar/config" = { + enable = true; + executable = false; + text = '' + { + "exclusive": false, + "position": "bottom", + "height": 22, + "spacing": 16, + "fixed-center": false, + "modules-left": [ + "user", + "cpu", + "memory", + "network", + "disk#root", + "disk#home", + "river/mode", + ], + "modules-center": [ + "cava", + ], + "modules-right": [ + "tray", + "clock" + ], + "user": { + "format": " {work_d}:{work_H}:{work_M}:{work_S} uptime", + "interval": 1, + }, + "cpu": { + "interval": 1, + "format": "cpu {load} {icon0}{icon1}{icon2}{icon3}{icon4}{icon5}{icon6}{icon7}{icon8}{icon9}{icon10}{icon11}{icon12}{icon13}{icon14}{icon15}{icon16}{icon17}{icon18}{icon19}{icon20}{icon21}{icon22}{icon23}", + "format-icons": [ + "", // green + "", // blue + "", // white + "", // white + "", // yellow + "", // yellow + "", // orange + "" // red + ] + }, + "memory": { + "interval": 30, + "format": "mem {used:0.1f}G / {total:0.1f}G", + }, + "network": { + "interval": 10, + "interface": "enp4s0", + "format": "{ifname} {bandwidthUpBits} up / {bandwidthDownBits} down", + "format-disconnected": "", + "tooltip-format": "{ipaddr}/{cidr} via {gwaddr}" + }, + "disk#root": { + "interval": 60, + "format": "{free} free on {path}", + "path": "/" + }, + "disk#home": { + "interval": 60, + "format": "{free} free on {path}", + "path": "/home" + }, + "systemd-failed-units": { + "hide-on-ok": false, // Do not hide if there is zero failed units. + "format": "✗ {nr_failed}", + "format-ok": "✓", + "system": true, // Monitor failed systemwide units. + "user": false // Ignore failed user units. + }, + "river/mode": { + }, + "cava": { + // "cava_config": "$XDG_CONFIG_HOME/cava/cava.conf", + "framerate": 30, + "autosens": 1, + "bars": 64, + "lower_cutoff_freq": 50, + "higher_cutoff_freq": 10000, + "method": "pulse", + "source": "auto", + "stereo": true, + "reverse": false, + "bar_delimiter": 0, + "monstercat": false, + "waves": false, + "noise_reduction": 0.77, + "input_delay": 1, + "format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], + }, + "tray": { + "icon-size": 18, + "spacing": 4 + }, + "clock": { + "format": "{:%H:%M:%S}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}", + "interval": 1 + } + } + ''; + }; }; } diff --git a/hosts/base/configuration.nix b/hosts/base/configuration.nix new file mode 100644 index 0000000..082b2f6 --- /dev/null +++ b/hosts/base/configuration.nix @@ -0,0 +1,26 @@ +# Base configuration.nix +{ config, lib, pkgs, inputs, user, ... }: +let + hostname="nixos"; +in +{ + imports = [ + ./hardware-configuration.nix + ]; + boot = { + loader.grub = { + enable = true; + device = "/dev/vda"; + useOSProber = true; + }; + # Hardware-configuration edits + kernel.sysctl."net.ipv4.ip_forward" = 1; + }; + networking = { + hostName = "${hostname}"; + firewall = { + allowedTCPPorts = [ 445 139 ]; + allowedUDPPorts = [ 137 138 ]; + }; + }; +} diff --git a/hosts/vm/hardware-configuration.nix b/hosts/base/hardware-configuration.nix similarity index 100% rename from hosts/vm/hardware-configuration.nix rename to hosts/base/hardware-configuration.nix diff --git a/hosts/buckwheat/configuration.nix b/hosts/buckwheat/configuration.nix index ebb376e..d909bd0 100644 --- a/hosts/buckwheat/configuration.nix +++ b/hosts/buckwheat/configuration.nix @@ -17,7 +17,6 @@ in efi.efiSysMountPoint = "/boot/efi"; timeout = 2; }; - tmp.cleanOnBoot = true; }; networking = { hostName = "${hostname}"; diff --git a/hosts/default.nix b/hosts/default.nix index a90abe3..3700506 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -43,20 +43,19 @@ } ]; }; - vm = lib.nixosSystem { + base = lib.nixosSystem { inherit system; specialArgs = { inherit user inputs; }; modules = [ - ../nixos/cli.nix - ./vm/configuration.nix + ../nixos/base.nix + ./base/configuration.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user.name} = { imports = [ - ../home-manager/cli.nix - ./vm/home.nix + ../home-manager/base.nix ]; }; } diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix deleted file mode 100644 index 56d3367..0000000 --- a/hosts/vm/configuration.nix +++ /dev/null @@ -1,47 +0,0 @@ -# NixOS VM configuration.nix -{ config, lib, pkgs, inputs, user, ... }: -let - hostname="nixos"; -in -{ - imports = [ - ./hardware-configuration.nix - ]; - boot = { - loader.grub = { - enable = true; - device = "/dev/vda"; - useOSProber = true; - }; - - # Hardware-configuration edits - kernel.sysctl."net.ipv4.ip_forward" = 1; - - # Clean /tmp at boot - tmp.cleanOnBoot = true; - }; - networking = { - hostName = "${hostname}"; # Define your hostname. - firewall = { - # To disable the firewall altogether: - # enable = false; - allowedTCPPorts = [ 445 139 ]; - allowedUDPPorts = [ 137 138 ]; - }; - # Proxy configuration - # proxy = { - # default = "http://user:password@proxy:port/"; - # noProxy = "127.0.0.1,localhost,internal.domain"; - # }; - }; - users.users.${user.name} = { - extraGroups = [ - ]; - packages = with pkgs; [ - ]; - }; - services = { - # Enable automatic login for the user. - getty.autologinUser = "${user.name}"; - }; -} diff --git a/hosts/vm/configuration.nix_ b/hosts/vm/configuration.nix_ deleted file mode 100644 index 5b1f0e5..0000000 --- a/hosts/vm/configuration.nix_ +++ /dev/null @@ -1,123 +0,0 @@ -# Buckwheat configuration.nix -{ config, lib, pkgs, inputs, user, ... }: -let - hostname="buckwheat"; -in -{ - imports = [ - ./hardware-configuration.nix - ]; - boot = { - loader = { - systemd-boot = { - enable = true; - configurationLimit = 10; - }; - efi.canTouchEfiVariables = true; - efi.efiSysMountPoint = "/boot/efi"; - timeout = 2; - }; - - # Hardware-configuration edits - kernel.sysctl."net.ipv4.ip_forward" = 1; - - # Clean /tmp at boot - tmp.cleanOnBoot = true; - }; - networking = { - hostName = "${hostname}"; # Define your hostname. - firewall = { - # To disable the firewall altogether: - # enable = false; - allowedTCPPorts = [ 445 139 ]; - allowedUDPPorts = [ 137 138 ]; - }; - # Proxy configuration - # proxy = { - # default = "http://user:password@proxy:port/"; - # noProxy = "127.0.0.1,localhost,internal.domain"; - # }; - }; - users.users.${user.name} = { - extraGroups = [ "davfs2" "libvirtd" "transmission" ]; - packages = with pkgs; [ - mixxx - virt-manager - ]; - }; - services = { - davfs2 = { - enable = true; - }; - mullvad-vpn = { - enable = true; - package = pkgs.mullvad-vpn; - }; - transmission = { - enable = true; - openFirewall = true; - }; - udisks2 = { - enable = true; - mountOnMedia = true; - }; - # Enable automatic login for the user. - # getty.autologinUser = "${user.name}"; - }; - - virtualisation.libvirtd.enable = true; - - # Borg backup configuration - services.borgbackup.jobs."daily" = { - paths = [ - "/home" - ]; - exclude = [ - "/home/*/go/bin" - "/home/*/go/pkg" - ]; - repo = "/mnt/daily/buckwheat"; - encryption = { - mode = "repokey-blake2"; - passCommand = "cat /root/borgbackup/passphrase"; - }; - compression = "auto,lzma"; - startAt = "daily"; - prune.keep = { - within = "7d"; - }; - }; - services.borgbackup.jobs."weekly" = { - paths = [ - "/home" - ]; - exclude = [ - "/home/*/go/bin" - "/home/*/go/pkg" - ]; - repo = "/mnt/weekly/buckwheat"; - encryption = { - mode = "repokey-blake2"; - passCommand = "cat /root/borgbackup/passphrase"; - }; - compression = "auto,lzma"; - startAt = "weekly"; - }; - #services.borgbackup.jobs."borgbase" = { - # paths = [ - # "/home" - # ]; - # exclude = [ - # "/home/*/go/bin" - # "/home/*/go/pkg" - # ]; - # repo = ".repo.borgbase.com:repo"; - # encryption = { - # mode = "repokey-blake2"; - # passCommand = "cat /root/borgbackup/passphrase"; - # }; - # environment.BORG_RSH = "ssh -i /root/borgbackup/ssh_key"; - # compression = "auto,lzma"; - # startAt = "daily"; - #}; -} diff --git a/hosts/vm/home.nix b/hosts/vm/home.nix deleted file mode 100644 index b091fde..0000000 --- a/hosts/vm/home.nix +++ /dev/null @@ -1,6 +0,0 @@ -# NixOS VM home.nix -{ config, lib, pkgs, inputs, user, ... }: -{ - services = { - }; -} diff --git a/nixos/base.nix b/nixos/base.nix index 841b40f..b573945 100644 --- a/nixos/base.nix +++ b/nixos/base.nix @@ -18,10 +18,11 @@ keep-derivations = true ''; }; + boot = { + tmp.cleanOnBoot = true; + }; nixpkgs.config.allowUnfree = true; - networking.networkmanager.enable = true; - time.timeZone = "America/Los_Angeles"; i18n.defaultLocale = "en_US.UTF-8"; i18n.extraLocaleSettings = { diff --git a/nixos/cli.nix b/nixos/cli.nix index 95f2495..8423489 100644 --- a/nixos/cli.nix +++ b/nixos/cli.nix @@ -124,7 +124,7 @@ ssss surfraw tmux-xpanes - tut + toot unrar unzip up diff --git a/nixos/wayland.nix b/nixos/wayland.nix index 1011f54..e5527d8 100644 --- a/nixos/wayland.nix +++ b/nixos/wayland.nix @@ -46,6 +46,14 @@ wtype ]; }; + wayfire = { + enable = true; + plugins = with pkgs.wayfirePlugins; [ + wcm + wf-shell + wayfire-plugins-extra + ]; + }; xwayland = { enable = true; }; diff --git a/todos/20240114221429.todo.md b/todos/20240114221429.todo.md index 1003230..210ca2e 100644 --- a/todos/20240114221429.todo.md +++ b/todos/20240114221429.todo.md @@ -6,3 +6,4 @@ - [Handling Secrets in NixOS](https://lgug2z.com/articles/handling-secrets-in-nixos-an-overview/) - [NixOS Secrets Management](https://onion.tube/watch?v=G5f6GC7SnhU) - https://www.youtube.com/watch?v=G5f6GC7SnhU +- This is needed for borg backup key