[nb] Commit

This commit is contained in:
Thai Noodles 2024-01-16 19:43:56 -08:00
parent 331084c19a
commit c172f2d358
14 changed files with 158 additions and 297 deletions

View File

@ -72,10 +72,9 @@
plugins = with pkgs.vimPlugins; [
goyo-vim
limelight-vim
twilight-nvim
vim-numbertoggle
vim-nix
vimwiki
zen-mode-nvim
];
};
yt-dlp = {

View File

@ -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"
'';
};
};

View File

@ -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 = [
"<span color='#${config.colorScheme.colors.base0A}'></span>"
"<span color='#${config.colorScheme.colors.base0D}'></span>"
"<span color='#${config.colorScheme.colors.base07}'></span>"
"<span color='#${config.colorScheme.colors.base07}'></span>"
"<span color='#${config.colorScheme.colors.base0B}'></span>"
"<span color='#${config.colorScheme.colors.base0B}'></span>"
"<span color='#${config.colorScheme.colors.base09}'></span>"
"<span color='#${config.colorScheme.colors.base09}'></span>"
];
};
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 = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
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": [
"<span color='#69ff94'></span>", // green
"<span color='#2aa9ff'></span>", // blue
"<span color='#f8f8f2'></span>", // white
"<span color='#f8f8f2'></span>", // white
"<span color='#ffffa5'></span>", // yellow
"<span color='#ffffa5'></span>", // yellow
"<span color='#ff9977'></span>", // orange
"<span color='#dd532e'></span>" // 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": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}",
"interval": 1
}
}
'';
};
};
}

View File

@ -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 ];
};
};
}

View File

@ -17,7 +17,6 @@ in
efi.efiSysMountPoint = "/boot/efi";
timeout = 2;
};
tmp.cleanOnBoot = true;
};
networking = {
hostName = "${hostname}";

View File

@ -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
];
};
}

View File

@ -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}";
};
}

View File

@ -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_hash>.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";
#};
}

View File

@ -1,6 +0,0 @@
# NixOS VM home.nix
{ config, lib, pkgs, inputs, user, ... }:
{
services = {
};
}

View File

@ -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 = {

View File

@ -124,7 +124,7 @@
ssss
surfraw
tmux-xpanes
tut
toot
unrar
unzip
up

View File

@ -46,6 +46,14 @@
wtype
];
};
wayfire = {
enable = true;
plugins = with pkgs.wayfirePlugins; [
wcm
wf-shell
wayfire-plugins-extra
];
};
xwayland = {
enable = true;
};

View File

@ -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