Compare commits
No commits in common. "main" and "beefcake-revival" have entirely different histories.
main
...
beefcake-r
71 changed files with 3644 additions and 9691 deletions
34
.sops.yaml
34
.sops.yaml
|
@ -1,20 +1,7 @@
|
|||
keys:
|
||||
# list any public keys here
|
||||
|
||||
# if you need the private key, refer to the readme
|
||||
# pass age-key | rg '# pub'
|
||||
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
|
||||
|
||||
# per-host keys can be derived from a target host's ssh keys like so:
|
||||
# ssh host "nix shell nixpkgs#ssh-to-age -c $SHELL -c 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
|
||||
- &sshd-at-beefcake age1etv56f7kf78a55lxqtydrdd32dpmsjnxndf4u28qezxn6p7xt9esqvqdq7
|
||||
- &sshd-at-router age1zd7c3g5d20shdftq8ghqm0r92488dg4pdp4gulur7ex3zx2yq35ssxawpn
|
||||
- &sshd-at-dragon age14ewl97x5g52ajf269cmmwzrgf22m9dsr7mw7czfa356qugvf4gvq5dttfv
|
||||
- &ssh-foxtrot age1njnet9ltjuxasqv3ckn67r5natke6xgd8wlx8psf64pyc4duvurqhedw80
|
||||
|
||||
# after updating this file, you may need to update the keys for any associated files like so:
|
||||
# sops updatekeys secrets.file
|
||||
|
||||
# after updating this, you will need to `sops updatekeys secrets.file` for any files that need the new key(s)
|
||||
- &daniel age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45 # pass age-key | rg '# pub'
|
||||
- &sshd-at-beefcake age1etv56f7kf78a55lxqtydrdd32dpmsjnxndf4u28qezxn6p7xt9esqvqdq7 # ssh beefcake "nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'"
|
||||
creation_rules:
|
||||
- path_regex: secrets/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
|
@ -25,18 +12,3 @@ creation_rules:
|
|||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-beefcake
|
||||
- path_regex: secrets/router/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-router
|
||||
- path_regex: secrets/dragon/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *sshd-at-dragon
|
||||
- path_regex: secrets/foxtrot/[^/]+\.(ya?ml|json|env|ini)$
|
||||
key_groups:
|
||||
- age:
|
||||
- *daniel
|
||||
- *ssh-foxtrot
|
||||
|
|
|
@ -1,56 +1,38 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.attrsets) mapAttrs' filterAttrs;
|
||||
ESP = inputs @ {
|
||||
size ? "4G",
|
||||
label ? "ESP",
|
||||
name ? "ESP",
|
||||
}:
|
||||
{
|
||||
priority = 1;
|
||||
start = "1M";
|
||||
label = label;
|
||||
name = name;
|
||||
end = size;
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"umask=0077"
|
||||
];
|
||||
};
|
||||
}
|
||||
// inputs;
|
||||
in rec {
|
||||
in {
|
||||
standardWithHibernateSwap = {
|
||||
esp ? {
|
||||
label = "ESP";
|
||||
size = "4G";
|
||||
name = "ESP";
|
||||
},
|
||||
rootfsName ? "/rootfs",
|
||||
homeName ? "/home",
|
||||
disk,
|
||||
disks ? ["/dev/sda"],
|
||||
swapSize,
|
||||
...
|
||||
}: {
|
||||
/*
|
||||
this is my standard partitioning scheme for my machines which probably want hibernation capabilities
|
||||
a UEFI-compatible boot partition
|
||||
it includes an LUKS-encrypted btrfs volume
|
||||
a swap partition big enough to dump all the machine's RAM into
|
||||
*/
|
||||
# this is my standard partitioning scheme for my machines which probably want hibernation capabilities
|
||||
# a UEFI-compatible boot partition
|
||||
# it includes an LUKS-encrypted btrfs volume
|
||||
# a swap partition big enough to dump all the machine's RAM into
|
||||
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = ESP esp;
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "4G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = swapSize;
|
||||
content = {
|
||||
|
@ -64,6 +46,7 @@ in rec {
|
|||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = ["--allow-discards"];
|
||||
# if you want to use the key for interactive login be sure there is no trailing newline
|
||||
# for example use `echo -n "password" > /tmp/secret.key`
|
||||
keyFile = "/tmp/secret.key"; # Interactive
|
||||
|
@ -73,13 +56,13 @@ in rec {
|
|||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
subvolumes = {
|
||||
${rootfsName} = {
|
||||
"/nixos" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
${homeName} = {
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
|
@ -95,43 +78,37 @@ in rec {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
foxtrot = standardWithHibernateSwap {
|
||||
disk = "nvme0n1";
|
||||
swapSize = "32G";
|
||||
rootfsName = "/nixos-rootfs";
|
||||
homeName = "/nixos-home";
|
||||
esp = {
|
||||
label = "disk-primary-ESP";
|
||||
name = "disk-primary-ESP";
|
||||
};
|
||||
};
|
||||
|
||||
standard = {
|
||||
esp ? {
|
||||
label = "ESP";
|
||||
size = "4G";
|
||||
name = "ESP";
|
||||
},
|
||||
disk,
|
||||
...
|
||||
}: {
|
||||
standard = {disks ? ["/dev/vda"], ...}: {
|
||||
# this is my standard partitioning scheme for my machines: an LUKS-encrypted
|
||||
# btrfs volume
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = ESP esp;
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "crypted";
|
||||
extraOpenArgs = ["--allow-discards"];
|
||||
# if you want to use the key for interactive login be sure there is no trailing newline
|
||||
# for example use `echo -n "password" > /tmp/secret.key`
|
||||
keyFile = "/tmp/secret.key"; # Interactive
|
||||
|
@ -143,11 +120,11 @@ in rec {
|
|||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = ["compress=zstd" "noatime"];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
|
@ -164,35 +141,38 @@ in rec {
|
|||
};
|
||||
};
|
||||
|
||||
thablet = standard {
|
||||
disk = "nvme0n1";
|
||||
esp = {
|
||||
label = "EFI";
|
||||
size = "4G";
|
||||
name = "EFI";
|
||||
};
|
||||
};
|
||||
|
||||
unencrypted = {disk, ...}: {
|
||||
unencrypted = {disks ? ["/dev/vda"], ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
device = builtins.elemAt disks 0;
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = ESP {size = "5G";};
|
||||
ESP = {
|
||||
label = "EFI";
|
||||
name = "ESP";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
mountpoint = "/partition-root";
|
||||
subvolumes = {
|
||||
"/rootfs" = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountOptions = [];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
|
@ -215,11 +195,9 @@ in rec {
|
|||
beefcake = let
|
||||
zpools = {
|
||||
zroot = {
|
||||
/*
|
||||
TODO: at the time of writing, disko does not support draid6
|
||||
so I'm building/managing the array manually for the time being
|
||||
the root pool is just a single disk right now
|
||||
*/
|
||||
# TODO: at the time of writing, disko does not support draid6
|
||||
# so I'm building/managing the array manually for the time being
|
||||
# the root pool is just a single disk right now
|
||||
name = "zroot";
|
||||
config = {
|
||||
type = "zpool";
|
||||
|
@ -264,11 +242,9 @@ in rec {
|
|||
keylocation = "file:///tmp/secret.key";
|
||||
};
|
||||
# use this to read the key during boot
|
||||
/*
|
||||
postCreateHook = ''
|
||||
zfs set keylocation="prompt" "zroot/$name";
|
||||
'';
|
||||
*/
|
||||
# postCreateHook = ''
|
||||
# zfs set keylocation="prompt" "zroot/$name";
|
||||
# '';
|
||||
};
|
||||
"encrypted/test" = {
|
||||
type = "zfs_fs";
|
||||
|
@ -278,11 +254,9 @@ in rec {
|
|||
};
|
||||
};
|
||||
zstorage = {
|
||||
/*
|
||||
PARITY_COUNT=3 NUM_DRIVES=8 HOT_SPARES=2 sudo -E zpool create -f -O mountpoint=none -O compression=on -O xattr=sa -O acltype=posixacl -o ashift=12 -O atime=off -O recordsize=64K zstorage draid{$PARITY_COUNT}:{$NUM_DRIVES}c:{$HOT_SPARES}s /dev/disk/by-id/scsi-35000039548cb637c /dev/disk/by-id/scsi-35000039548cb7c8c /dev/disk/by-id/scsi-35000039548cb85c8 /dev/disk/by-id/scsi-35000039548d9b504 /dev/disk/by-id/scsi-35000039548da2b08 /dev/disk/by-id/scsi-35000039548dad2fc /dev/disk/by-id/scsi-350000399384be921 /dev/disk/by-id/scsi-35000039548db096c
|
||||
sudo zfs create -o mountpoint=legacy zstorage/nix
|
||||
sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
|
||||
*/
|
||||
# PARITY_COUNT=3 NUM_DRIVES=8 HOT_SPARES=2 sudo -E zpool create -f -O mountpoint=none -O compression=on -O xattr=sa -O acltype=posixacl -o ashift=12 -O atime=off -O recordsize=64K zstorage draid{$PARITY_COUNT}:{$NUM_DRIVES}c:{$HOT_SPARES}s /dev/disk/by-id/scsi-35000039548cb637c /dev/disk/by-id/scsi-35000039548cb7c8c /dev/disk/by-id/scsi-35000039548cb85c8 /dev/disk/by-id/scsi-35000039548d9b504 /dev/disk/by-id/scsi-35000039548da2b08 /dev/disk/by-id/scsi-35000039548dad2fc /dev/disk/by-id/scsi-350000399384be921 /dev/disk/by-id/scsi-35000039548db096c
|
||||
# sudo zfs create -o mountpoint=legacy zstorage/nix
|
||||
# sudo zfs create -o canmount=on -o mountpoint=/storage zstorage/storage
|
||||
name = "zstorage";
|
||||
config = {};
|
||||
};
|
||||
|
@ -408,7 +382,7 @@ in rec {
|
|||
};
|
||||
};
|
||||
};
|
||||
legacy = {disks, ...}: {
|
||||
legacy = {disks ? ["/dev/vda"], ...}: {
|
||||
disko.devices = {
|
||||
disk = {
|
||||
primary = {
|
||||
|
|
675
flake.lock
675
flake.lock
File diff suppressed because it is too large
Load diff
409
flake.nix
409
flake.nix
|
@ -1,36 +1,27 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
hardware.url = "github:nixos/nixos-hardware";
|
||||
|
||||
disko.url = "github:nix-community/disko/master";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
# sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.11";
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
home-manager-unstable.url = "github:nix-community/home-manager";
|
||||
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
helix.url = "github:helix-editor/helix/master";
|
||||
helix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
hardware.url = "github:nixos/nixos-hardware";
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
hyprland.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
hyprgrass.url = "github:horriblename/hyprgrass";
|
||||
hyprgrass.inputs.hyprland.follows = "hyprland";
|
||||
|
||||
iio-hyprland.url = "github:JeanSchoeller/iio-hyprland";
|
||||
iio-hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
wezterm.url = "github:wez/wezterm?dir=nix";
|
||||
wezterm.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
@ -40,19 +31,7 @@
|
|||
slippi.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
slippi.inputs.home-manager.follows = "home-manager-unstable";
|
||||
|
||||
jovian.url = "github:Jovian-Experiments/Jovian-NixOS/development";
|
||||
jovian.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
|
||||
ghostty.url = "github:ghostty-org/ghostty";
|
||||
ghostty.inputs.nixpkgs-unstable.follows = "nixpkgs-unstable";
|
||||
ghostty.inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
|
||||
# nnf.url = "github:thelegy/nixos-nftables-firewall?rev=71fc2b79358d0dbacde83c806a0f008ece567b7b";
|
||||
|
||||
mobile-nixos = {
|
||||
url = "github:lytedev/mobile-nixos";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
|
@ -62,9 +41,8 @@
|
|||
"https://cache.nixos.org/"
|
||||
"https://helix.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nix.h.lyte.dev"
|
||||
# "https://nix.h.lyte.dev"
|
||||
"https://hyprland.cachix.org"
|
||||
"https://ghostty.cachix.org"
|
||||
];
|
||||
|
||||
extra-trusted-public-keys = [
|
||||
|
@ -73,7 +51,6 @@
|
|||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"h.lyte.dev-2:te9xK/GcWPA/5aXav8+e5RHImKYMug8hIIbhHsKPN0M="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -89,13 +66,9 @@
|
|||
home-manager-unstable,
|
||||
helix,
|
||||
hardware,
|
||||
jovian,
|
||||
mobile-nixos,
|
||||
hyprland,
|
||||
# nnf,
|
||||
# hyprland,
|
||||
slippi,
|
||||
ghostty,
|
||||
...
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
|
@ -106,7 +79,7 @@
|
|||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
# pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
|
||||
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
|
||||
|
||||
unstable = {
|
||||
forSystems = nixpkgs-unstable.lib.genAttrs systems;
|
||||
|
@ -115,30 +88,24 @@
|
|||
pkg = callee: overrides: genPkgs (pkgs: pkgs.callPackage callee overrides);
|
||||
};
|
||||
|
||||
style = {
|
||||
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire;
|
||||
colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire;
|
||||
|
||||
font = {
|
||||
name = "IosevkaLyteTerm";
|
||||
size = 12;
|
||||
};
|
||||
};
|
||||
# font = {
|
||||
# name = "IosevkaLyteTerm";
|
||||
# size = 12;
|
||||
# };
|
||||
|
||||
/*
|
||||
moduleArgs = {
|
||||
# inherit style;
|
||||
inherit helix slippi hyprland hardware disko home-manager;
|
||||
inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
|
||||
};
|
||||
*/
|
||||
# moduleArgs = {
|
||||
# # inherit colors font;
|
||||
# inherit helix slippi hyprland hardware disko home-manager;
|
||||
# inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays;
|
||||
# };
|
||||
|
||||
pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev";
|
||||
in {
|
||||
/*
|
||||
kind of a quirk, but package definitions are actually in the "additions"
|
||||
overlay I did this to work around some recursion problems
|
||||
TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
|
||||
*/
|
||||
# kind of a quirk, but package definitions are actually in the "additions"
|
||||
# overlay I did this to work around some recursion problems
|
||||
# TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880
|
||||
packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;});
|
||||
diskoConfigurations = import ./disko {inherit (nixpkgs) lib;};
|
||||
templates = import ./templates;
|
||||
|
@ -200,7 +167,7 @@
|
|||
nodejs
|
||||
wget
|
||||
sudo
|
||||
nixVersions.stable
|
||||
nixFlakes
|
||||
cacert
|
||||
gnutar
|
||||
gzip
|
||||
|
@ -249,38 +216,15 @@
|
|||
|
||||
modifications = final: prev: let
|
||||
wezterm-input = wezterm;
|
||||
hyprland-input = hyprland;
|
||||
in rec {
|
||||
helix = helix.outputs.packages.${prev.system}.helix;
|
||||
final.helix = helix;
|
||||
/*
|
||||
TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage
|
||||
source: https://github.com/wez/wezterm/issues/3771
|
||||
not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737
|
||||
I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
|
||||
*/
|
||||
# TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage
|
||||
# source: https://github.com/wez/wezterm/issues/3771
|
||||
# not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737
|
||||
# I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing
|
||||
wezterm = wezterm-input.outputs.packages.${prev.system}.default;
|
||||
# wezterm = (import nixpkgs {inherit (prev) system;}).wezterm;
|
||||
final.wezterm = wezterm;
|
||||
|
||||
hyprland = hyprland-input.outputs.packages.${prev.system}.default;
|
||||
final.hyprland = hyprland;
|
||||
|
||||
# zellij = prev.zellij.overrideAttrs rec {
|
||||
# version = "0.41.0";
|
||||
# src = prev.fetchFromGitHub {
|
||||
# owner = "zellij-org";
|
||||
# repo = "zellij";
|
||||
# rev = "v0.41.0";
|
||||
# hash = "sha256-A+JVWYz0t9cVA8XZciOwDkCecsC2r5TU2O9i9rVg7do=";
|
||||
# };
|
||||
# cargoDeps = prev.zellij.cargoDeps.overrideAttrs (prev.lib.const {
|
||||
# name = "zellij-vendor.tar.gz";
|
||||
# inherit src;
|
||||
# outputHash = "sha256-WxrMI7fV0pNsGjbNpXLr+xnMdWYkC4WxIeN4OK3ZPIE=";
|
||||
# });
|
||||
# };
|
||||
# final.zellij = zellij;
|
||||
};
|
||||
|
||||
unstable-packages = final: _prev: {
|
||||
|
@ -292,61 +236,52 @@
|
|||
};
|
||||
|
||||
nixosModules = import ./modules/nixos {
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style sops-nix disko;
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays colors sops-nix disko;
|
||||
flakeInputs = self.inputs;
|
||||
};
|
||||
|
||||
homeManagerModules = import ./modules/home-manager {
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style;
|
||||
inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays colors;
|
||||
inherit (nixpkgs) lib;
|
||||
flakeInputs = self.inputs;
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
beefcake = let
|
||||
beefcake = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
modules = with nixosModules; [
|
||||
home-manager-defaults
|
||||
|
||||
# TODO: disko?
|
||||
hardware.nixosModules.common-cpu-intel
|
||||
# TODO: disko?
|
||||
hardware.nixosModules.common-cpu-intel
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "beefcake.h";
|
||||
# TODO: router doesn't even do ipv6 yet...
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
|
||||
family-users
|
||||
common
|
||||
podman
|
||||
troubleshooting-tools
|
||||
virtual-machines
|
||||
virtual-machines-gui
|
||||
linux
|
||||
fonts
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "beefcake.h";
|
||||
# TODO: router doesn't even do ipv6 yet...
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
./nixos/beefcake.nix
|
||||
common
|
||||
podman
|
||||
troubleshooting-tools
|
||||
linux
|
||||
fonts
|
||||
|
||||
{
|
||||
services.kanidm.package = (unstable.pkgsFor system).kanidm;
|
||||
}
|
||||
];
|
||||
};
|
||||
./nixos/beefcake.nix
|
||||
];
|
||||
};
|
||||
|
||||
dragon = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.unencrypted
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.common-cpu-amd
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
|
||||
|
@ -354,29 +289,15 @@
|
|||
password-manager
|
||||
wifi
|
||||
graphical-workstation
|
||||
virtual-machines
|
||||
virtual-machines-gui
|
||||
music-production
|
||||
# plasma6
|
||||
gaming
|
||||
slippi.nixosModules.default
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "dragon.h";
|
||||
# TODO: router doesn't even do ipv6 yet...
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
./nixos/dragon.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
niri
|
||||
senpai
|
||||
iex
|
||||
cargo
|
||||
|
@ -423,10 +344,10 @@
|
|||
home-manager-defaults
|
||||
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
|
||||
common
|
||||
gaming
|
||||
graphical-workstation
|
||||
plasma6
|
||||
|
||||
./nixos/htpc.nix
|
||||
|
||||
|
@ -440,55 +361,19 @@
|
|||
];
|
||||
};
|
||||
|
||||
steamdeck1 = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.common-pc-ssd
|
||||
common
|
||||
gaming
|
||||
graphical-workstation
|
||||
plasma6
|
||||
|
||||
jovian.outputs.nixosModules.jovian
|
||||
|
||||
{
|
||||
networking.hostName = "steamdeck1";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
hardware.bluetooth.enable = true;
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
foxtrot = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
|
||||
outputs.diskoConfigurations.foxtrot
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.framework-13-7040-amd
|
||||
|
||||
common
|
||||
kde-connect
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
# virtual-machines
|
||||
# virtual-machines-gui
|
||||
laptop
|
||||
gaming
|
||||
cross-compiler
|
||||
|
||||
./nixos/foxtrot.nix
|
||||
|
||||
|
@ -497,14 +382,12 @@
|
|||
imports = with homeManagerModules; [
|
||||
senpai
|
||||
iex
|
||||
niri
|
||||
cargo
|
||||
firefox-no-tabs
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
ghostty.outputs.packages.${pkgs.system}.ghostty
|
||||
fw-ectool
|
||||
(writeShellApplication
|
||||
{
|
||||
|
@ -515,24 +398,6 @@
|
|||
modprobe -v mt7921e
|
||||
'';
|
||||
})
|
||||
(writeShellApplication
|
||||
{
|
||||
name = "perfmode";
|
||||
# we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system
|
||||
# otherwise, they will likely have no effect anyways
|
||||
text = ''
|
||||
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced'
|
||||
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz'
|
||||
'';
|
||||
})
|
||||
(writeShellApplication
|
||||
{
|
||||
name = "battmode";
|
||||
text = ''
|
||||
command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver'
|
||||
command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz'
|
||||
'';
|
||||
})
|
||||
];
|
||||
})
|
||||
];
|
||||
|
@ -542,16 +407,14 @@
|
|||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
home-manager-unstable-defaults
|
||||
outputs.diskoConfigurations.thablet
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.lenovo-thinkpad-x1-yoga
|
||||
|
||||
common
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
music-production
|
||||
laptop
|
||||
touchscreen
|
||||
gaming
|
||||
|
||||
./nixos/thablet.nix
|
||||
|
@ -571,35 +434,33 @@
|
|||
];
|
||||
};
|
||||
|
||||
/*
|
||||
grablet = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = with nixosModules; [
|
||||
common
|
||||
# grablet = nixpkgs.lib.nixosSystem {
|
||||
# system = "x86_64-linux";
|
||||
# modules = with nixosModules; [
|
||||
# common
|
||||
|
||||
outputs.diskoConfigurations.standard
|
||||
hardware.nixosModules.common-cpu-intel-kaby-lake
|
||||
hardware.nixosModules.common-pc-laptopp-ssd
|
||||
graphical-workstation
|
||||
laptop
|
||||
gaming
|
||||
# outputs.diskoConfigurations.standard
|
||||
# hardware.nixosModules.common-cpu-intel-kaby-lake
|
||||
# hardware.nixosModules.common-pc-laptopp-ssd
|
||||
# graphical-workstation
|
||||
# laptop
|
||||
# gaming
|
||||
|
||||
./nixos/thablet.nix
|
||||
# ./nixos/thablet.nix
|
||||
|
||||
{
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
iex
|
||||
cargo
|
||||
linux-desktop-environment-config
|
||||
];
|
||||
};
|
||||
# {
|
||||
# home-manager.users.daniel = {
|
||||
# imports = with homeManagerModules; [
|
||||
# iex
|
||||
# cargo
|
||||
# linux-desktop-environment-config
|
||||
# ];
|
||||
# };
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
||||
];
|
||||
};
|
||||
*/
|
||||
# powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
# }
|
||||
# ];
|
||||
# };
|
||||
|
||||
thinker = nixpkgs-unstable.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
@ -612,7 +473,7 @@
|
|||
swapSize = "32G";
|
||||
};
|
||||
}
|
||||
outputs.diskoConfigurations.standard
|
||||
outputs.diskoConfigurations.standardWithHibernateSwap
|
||||
hardware.nixosModules.lenovo-thinkpad-t480
|
||||
hardware.nixosModules.common-pc-laptop-ssd
|
||||
|
||||
|
@ -620,7 +481,6 @@
|
|||
common
|
||||
password-manager
|
||||
graphical-workstation
|
||||
# plasma6
|
||||
laptop
|
||||
gaming
|
||||
|
||||
|
@ -698,116 +558,17 @@
|
|||
linux
|
||||
troubleshooting-tools
|
||||
|
||||
outputs.nixosModules.deno-netlify-ddns-client
|
||||
{
|
||||
services.deno-netlify-ddns-client = {
|
||||
enable = true;
|
||||
username = "router.h";
|
||||
# TODO: ipv6
|
||||
ipv6 = false;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
NOTE: maybe use this someday, but I think I need more concrete
|
||||
networking knowledge before I know how to use it well. Additionally,
|
||||
I can use my existing firewall configuration more easily if I manage
|
||||
it directly.
|
||||
nnf.nixosModules.default
|
||||
*/
|
||||
# NOTE: maybe use this someday, but I think I need more concrete
|
||||
# networking knowledge before I know how to use it well. Additionally,
|
||||
# I can use my existing firewall configuration more easily if I manage
|
||||
# it directly.
|
||||
# nnf.nixosModules.default
|
||||
|
||||
./nixos/router.nix
|
||||
];
|
||||
};
|
||||
|
||||
# pinephone-image =
|
||||
# (import "${mobile-nixos}/lib/eval-with-configuration.nix" {
|
||||
# configuration = with nixosModules; [
|
||||
# linux
|
||||
# home-manager-defaults
|
||||
|
||||
# # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
|
||||
# common
|
||||
# wifi
|
||||
|
||||
# # TODO: how do I get a minimally useful mobile environment?
|
||||
# # for me, this means an on-screen keyboard and suspend support I think?
|
||||
# # I can live in a tty if needed and graphical stuff can all evolve later
|
||||
# # not worried about modem
|
||||
# # maybe/hopefully I can pull in or define my own sxmo via nix?
|
||||
# ];
|
||||
# device = "pine64-pinephone";
|
||||
# pkgs = pkgsFor "aarch64-linux";
|
||||
# })
|
||||
# .outputs
|
||||
# .disk-image;
|
||||
|
||||
pinephone = let
|
||||
inherit (nixpkgs-unstable) lib;
|
||||
in
|
||||
lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
# lib.nixosSystem {
|
||||
|
||||
modules = with nixosModules; [
|
||||
{
|
||||
imports = [
|
||||
(import "${mobile-nixos}/lib/configuration.nix" {
|
||||
device = "pine64-pinephone";
|
||||
})
|
||||
];
|
||||
|
||||
# nixpkgs.hostPlatform.system = "aarch64-linux";
|
||||
nixpkgs.buildPlatform = "x86_64-linux";
|
||||
|
||||
# TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working
|
||||
networking.firewall.enable = lib.mkForce false;
|
||||
|
||||
# TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now
|
||||
# TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that...
|
||||
programs.git.enable = lib.mkForce false;
|
||||
|
||||
# this option is conflicted, presumably due to some assumption in my defaults/common config
|
||||
# the sd-image module we're importing above has this set to true, so we better go with that?
|
||||
# that said, I think the mobile-nixos bootloader module has this set to false, so...
|
||||
# TODO: what does this mean?
|
||||
boot.loader.generic-extlinux-compatible.enable = lib.mkForce true;
|
||||
|
||||
# another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable
|
||||
networking.networkmanager.enable = lib.mkForce false;
|
||||
networking.wireless.enable = lib.mkForce true;
|
||||
}
|
||||
|
||||
# TODO: how do I build this as a .img to flash to an SD card?
|
||||
|
||||
# for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone`
|
||||
|
||||
# TODO: would like to use the mobile-nixos installer?
|
||||
"${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
|
||||
|
||||
linux
|
||||
home-manager-unstable-defaults
|
||||
|
||||
# outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation?
|
||||
common
|
||||
wifi
|
||||
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
}
|
||||
|
||||
{
|
||||
# nixpkgs.buildPlatform = "x86_64-linux";
|
||||
# nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform;
|
||||
# nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux;
|
||||
# nixpkgs.crossSystem = lib.mkForce null;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
images.pinephone = outputs.nixosConfigurations.pinephone.config.system.build.sdImage;
|
||||
|
||||
homeConfigurations = {
|
||||
"deck" = let
|
||||
system = "x86_64-linux";
|
||||
|
@ -835,10 +596,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
/*
|
||||
TODO: nix-on-droid for phone terminal usage? mobile-nixos?
|
||||
TODO: nix-darwin for work?
|
||||
TODO: nixos ISO?
|
||||
*/
|
||||
# TODO: nix-on-droid for phone terminal usage?
|
||||
# TODO: nix-darwin for work?
|
||||
# TODO: nixos ISO?
|
||||
};
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
|
@ -1,380 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="141.5919mm"
|
||||
height="122.80626mm"
|
||||
viewBox="0 0 501.70361 435.14028"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
|
||||
sodipodi:docname="Nix_snowflake_lytedev.svg"
|
||||
inkscape:export-filename="Nix_snowflake_lytedev.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5562">
|
||||
<stop
|
||||
style="stop-color:#699ad7;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5564" />
|
||||
<stop
|
||||
id="stop5566"
|
||||
offset="0.24345198"
|
||||
style="stop-color:#7eb1dd;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#7ebae4;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5568" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5053">
|
||||
<stop
|
||||
style="stop-color:#415e9a;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5055" />
|
||||
<stop
|
||||
id="stop5057"
|
||||
offset="0.23168644"
|
||||
style="stop-color:#4a6baf;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#5277c3;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5059" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5960"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5962"
|
||||
offset="0"
|
||||
style="stop-color:#637ddf;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#649afa;stop-opacity:1"
|
||||
offset="0.23168644"
|
||||
id="stop5964" />
|
||||
<stop
|
||||
id="stop5966"
|
||||
offset="1"
|
||||
style="stop-color:#719efa;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5867">
|
||||
<stop
|
||||
style="stop-color:#7363df;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5869" />
|
||||
<stop
|
||||
id="stop5871"
|
||||
offset="0.23168644"
|
||||
style="stop-color:#6478fa;stop-opacity:1" />
|
||||
<stop
|
||||
style="stop-color:#719efa;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5873" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="515.97058"
|
||||
x2="282.26105"
|
||||
y1="338.62445"
|
||||
x1="213.95642"
|
||||
gradientTransform="translate(983.36076,601.38885)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5855"
|
||||
xlink:href="#linearGradient5960"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="515.97058"
|
||||
x2="282.26105"
|
||||
y1="338.62445"
|
||||
x1="213.95642"
|
||||
gradientTransform="translate(-197.75174,-337.1451)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5855-8"
|
||||
xlink:href="#linearGradient5867"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="247.58188"
|
||||
x2="-702.75317"
|
||||
y1="102.74675"
|
||||
x1="-775.20807"
|
||||
gradientTransform="translate(983.36076,601.38885)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4544"
|
||||
xlink:href="#linearGradient5960"
|
||||
inkscape:collect="always" />
|
||||
<clipPath
|
||||
id="clipPath4501"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<circle
|
||||
r="241.06563"
|
||||
cy="686.09473"
|
||||
cx="335.13995"
|
||||
id="circle4503"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#adadad;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipPath5410"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<circle
|
||||
r="241.13741"
|
||||
cy="340.98975"
|
||||
cx="335.98114"
|
||||
id="circle5412"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5053"
|
||||
id="linearGradient5137"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
x1="-584.19934"
|
||||
y1="782.33563"
|
||||
x2="-496.29703"
|
||||
y2="937.71399" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5053"
|
||||
id="linearGradient5147"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
x1="-584.19934"
|
||||
y1="782.33563"
|
||||
x2="-496.29703"
|
||||
y2="937.71399" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5162"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5172"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5562"
|
||||
id="linearGradient5182"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
x1="200.59668"
|
||||
y1="351.41116"
|
||||
x2="290.08701"
|
||||
y2="506.18814" />
|
||||
<linearGradient
|
||||
y2="506.18814"
|
||||
x2="290.08701"
|
||||
y1="351.41116"
|
||||
x1="200.59668"
|
||||
gradientTransform="translate(70.505061,-1761.3076)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5201"
|
||||
xlink:href="#linearGradient5562"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="937.71399"
|
||||
x2="-496.29703"
|
||||
y1="782.33563"
|
||||
x1="-584.19934"
|
||||
gradientTransform="translate(864.55062,-2197.497)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient5205"
|
||||
xlink:href="#linearGradient5053"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98318225"
|
||||
inkscape:cx="112.8987"
|
||||
inkscape:cy="191.21582"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="2059"
|
||||
inkscape:window-height="1588"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:snap-global="true"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:showpageshadow="0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#505050" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="print-logo"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
style="display:inline"
|
||||
transform="translate(-156.33871,933.1905)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
|
||||
id="path4861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 353.50926,-797.4433 -122.21756,211.6631 -28.53477,-48.37 32.93839,-56.6875 -65.41521,-0.1719 -13.9414,-24.1698 14.23637,-24.721 93.11177,0.2939 33.46371,-57.6903 z"
|
||||
id="use4863"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 362.88537,-628.243 244.41439,0.012 -27.62229,48.8968 -65.56199,-0.1817 32.55876,56.7371 -13.96098,24.1585 -28.52722,0.032 -46.3013,-80.7841 -66.69317,-0.1353 z"
|
||||
id="use4865"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#df3c59;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 505.14318,-720.9886 -122.19683,-211.6751 56.15706,-0.5268 32.6236,56.8692 32.85645,-56.5653 27.90237,0.011 14.29086,24.6896 -46.81047,80.4902 33.22946,57.8256 z"
|
||||
id="use4867"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4873"
|
||||
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4875"
|
||||
d="m 451.3364,-803.53264 -244.4144,-0.012 27.62229,-48.89685 65.56199,0.18175 -32.55875,-56.73717 13.96097,-24.15851 28.52722,-0.0315 46.3013,80.78414 66.69317,0.13524 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="use4877"
|
||||
d="m 460.87178,-633.8425 122.21757,-211.66304 28.53477,48.37003 -32.93839,56.68751 65.4152,0.1718 13.9414,24.1698 -14.23636,24.7211 -93.11177,-0.294 -33.46371,57.6904 z"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#8e293b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<g
|
||||
id="layer2"
|
||||
inkscape:label="guides"
|
||||
style="display:none"
|
||||
transform="translate(72.039038,-1799.4476)">
|
||||
<path
|
||||
d="M 460.60629,594.72881 209.74183,594.7288 84.309616,377.4738 209.74185,160.21882 l 250.86446,1e-5 125.43222,217.255 z"
|
||||
inkscape:randomized="0"
|
||||
inkscape:rounded="0"
|
||||
inkscape:flatsided="true"
|
||||
sodipodi:arg2="1.5707963"
|
||||
sodipodi:arg1="1.0471976"
|
||||
sodipodi:r2="217.25499"
|
||||
sodipodi:r1="250.86446"
|
||||
sodipodi:cy="377.47382"
|
||||
sodipodi:cx="335.17407"
|
||||
sodipodi:sides="6"
|
||||
id="path6032"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.236;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
sodipodi:type="star" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:type="star"
|
||||
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
|
||||
id="path5875"
|
||||
sodipodi:sides="6"
|
||||
sodipodi:cx="335.17407"
|
||||
sodipodi:cy="685.74158"
|
||||
sodipodi:r1="100.83495"
|
||||
sodipodi:r2="87.32563"
|
||||
sodipodi:arg1="1.0471976"
|
||||
sodipodi:arg2="1.5707963"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 385.59154,773.06721 -100.83495,0 -50.41747,-87.32564 50.41748,-87.32563 100.83495,10e-6 50.41748,87.32563 z" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:nodetypes="ccccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5851"
|
||||
d="m 1216.5591,938.53395 123.0545,228.14035 -42.6807,-1.2616 -43.4823,-79.7725 -39.6506,80.3267 -32.6875,-19.7984 53.4737,-100.2848 -37.1157,-73.88955 z"
|
||||
style="fill:url(#linearGradient5855);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.415;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c53a3a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect5884"
|
||||
width="48.834862"
|
||||
height="226.22897"
|
||||
x="-34.74221"
|
||||
y="446.17056"
|
||||
transform="rotate(-30)" />
|
||||
<path
|
||||
transform="translate(0,-308.26772)"
|
||||
sodipodi:type="star"
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.509;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="path3428"
|
||||
sodipodi:sides="6"
|
||||
sodipodi:cx="223.93674"
|
||||
sodipodi:cy="878.63831"
|
||||
sodipodi:r1="28.048939"
|
||||
sodipodi:r2="24.291094"
|
||||
sodipodi:arg1="0"
|
||||
sodipodi:arg2="0.52359878"
|
||||
inkscape:flatsided="true"
|
||||
inkscape:rounded="0"
|
||||
inkscape:randomized="0"
|
||||
d="m 251.98568,878.63831 -14.02447,24.29109 h -28.04894 l -14.02447,-24.29109 14.02447,-24.2911 h 28.04894 z" />
|
||||
<use
|
||||
x="0"
|
||||
y="0"
|
||||
xlink:href="#rect5884"
|
||||
id="use4252"
|
||||
transform="rotate(60,268.29786,489.4515)"
|
||||
width="100%"
|
||||
height="100%" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0.650794;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect4254"
|
||||
width="5.3947482"
|
||||
height="115.12564"
|
||||
x="545.71014"
|
||||
y="467.07007"
|
||||
transform="rotate(30,575.23539,-154.13386)" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 19 KiB |
File diff suppressed because it is too large
Load diff
|
@ -34,13 +34,11 @@ $rosewater: #f5e0dc;
|
|||
.bar {
|
||||
background-color: $base;
|
||||
color: $text;
|
||||
border-radius: 5px;
|
||||
border: solid 0px $base;
|
||||
font-family: IosevkaLyteTerm;
|
||||
font-size: 12.0pt;
|
||||
}
|
||||
|
||||
.leftsidestuff slider {
|
||||
.sidestuff slider {
|
||||
color: $sapphire;
|
||||
}
|
||||
|
||||
|
@ -71,8 +69,8 @@ $rosewater: #f5e0dc;
|
|||
.bar0>*,
|
||||
.bar1>*,
|
||||
.bar>* {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.vol .muted,
|
||||
|
@ -86,13 +84,8 @@ $rosewater: #f5e0dc;
|
|||
}
|
||||
|
||||
.workspace {
|
||||
/* height: 100%; */
|
||||
/* height: 32px; */
|
||||
margin: 0;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
(defwidget bar []
|
||||
(centerbox :orientation "h"
|
||||
(leftsidestuff)
|
||||
(sidestuff)
|
||||
(box)
|
||||
(rightsidestuff)
|
||||
))
|
||||
(music)))
|
||||
|
||||
(defwindow bar0
|
||||
:monitor 0
|
||||
|
@ -12,8 +11,8 @@
|
|||
:geometry
|
||||
(geometry
|
||||
:x "0%"
|
||||
:y "5px"
|
||||
:width "80%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "32px"
|
||||
:anchor "bottom center")
|
||||
(bar))
|
||||
|
@ -25,22 +24,20 @@
|
|||
:geometry
|
||||
(geometry
|
||||
:x "0%"
|
||||
:y "5px"
|
||||
:width "80%"
|
||||
:y "0%"
|
||||
:width "100%"
|
||||
:height "32px"
|
||||
:anchor "bottom center")
|
||||
(bar))
|
||||
|
||||
(defwidget rightsidestuff []
|
||||
(box :class "rightsidestuff" :orientation "h" :space-evenly false :halign "end" :valign "center" :spacing 10
|
||||
(music)
|
||||
(systray)
|
||||
))
|
||||
|
||||
(defwidget leftsidestuff []
|
||||
(box :class "leftsidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
|
||||
(defwidget sidestuff []
|
||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :valign "center" :spacing 10
|
||||
time
|
||||
; TODO: indicator/tray/taskbar/toolbar icons and management? (probably should use something standalone?)
|
||||
; https://github.com/elkowar/eww/issues/111
|
||||
|
||||
; TODO: idle inhibitor?
|
||||
; TODO: hyprland workspaces?
|
||||
; TODO: get these to align properly? icons seem lower than they should be?
|
||||
(box :class "mic" (
|
||||
box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "}
|
||||
|
@ -51,7 +48,7 @@
|
|||
) {"${volume}%"}
|
||||
)
|
||||
{" ${round(EWW_CPU["avg"], 0)}%"}
|
||||
{" ${round(EWW_RAM["used_mem_perc"], 0)}%"}
|
||||
{" ${round(EWW_RAM["used_mem_perc"], 0)}%"}
|
||||
; TODO: have these "widgets" be omitted entirely instead of just empty strings
|
||||
{(showBrightness == "true") ? (" ${brightness}%") : ""}
|
||||
{(showBattery == "true") ? (" ${EWW_BATTERY["BAT1"]["capacity"]}% (${batteryTime})") : ""}
|
||||
|
|
|
@ -1,38 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: we're mixing bash arrays and not-arrays - get it together
|
||||
declare -A OCCUPIED
|
||||
declare -A ACTIVE
|
||||
declare -A FOCUSED
|
||||
|
||||
#define icons for workspaces 1-9
|
||||
spaces=(1 2 3 4 5 6 7 8 9)
|
||||
icons=(1 2 3 4 5 6 7 8 9)
|
||||
ic=(1 2 3 4 5 6 7 8 9)
|
||||
|
||||
occupy() { export OCCUPIED["$1"]=occupied; }
|
||||
unoccupy() { unset "OCCUPIED[$1]"; }
|
||||
occ() { export o"$1"="occupied"; }
|
||||
unocc() { unset -v o"$1"; }
|
||||
|
||||
activate() { export ACTIVE["$1"]=active; }
|
||||
deactivate() { unset "ACTIVE[$1]"; }
|
||||
active() { export a"$1"="active"; }
|
||||
unactive() { unset -v a"$1"; }
|
||||
|
||||
focus() { export FOCUSED["$1"]=focused; }
|
||||
unfocus() { unset "FOCUSED[$1]"; }
|
||||
focus() { export f"$1"="focused"; }
|
||||
unfocus() { unset -v f"$1"; }
|
||||
|
||||
workspaces() {
|
||||
for s in "${spaces[@]}"; do
|
||||
unfocus "$s"
|
||||
deactivate "$s"
|
||||
unoccupy "$s"
|
||||
for num in 1 2 3 4 5 6 7 8 9; do
|
||||
unfocus $num
|
||||
unactive $num
|
||||
unocc $num
|
||||
done
|
||||
|
||||
# TODO: avoid recomputing these each time and actually listen to the events?
|
||||
mons_json=$(hyprctl monitors -j)
|
||||
for num in $(hyprctl workspaces -j | jq -r '.[] | select(.windows > 0) | .id'); do
|
||||
occupy "$num"
|
||||
occ "$num"
|
||||
done
|
||||
|
||||
for num in $(echo "$mons_json" | jq -r '.[].activeWorkspace.id'); do
|
||||
activate "$num"
|
||||
active "$num"
|
||||
done
|
||||
|
||||
for num in $(echo "$mons_json" | jq -r '.[] | select(.focused) | .activeWorkspace.id'); do
|
||||
|
@ -42,37 +38,33 @@ workspaces() {
|
|||
# TODO: would be nice to have monitors' workspaces show up in left-to-right
|
||||
# order as laid out in physical/pixel space
|
||||
# this would make glancing at the workspace indicator more intuitive
|
||||
#
|
||||
# TODO: might be nice to exclude certain windows as counting towards "occupation" such as xwaylandvideobridge or w/e
|
||||
#
|
||||
# NOTE: maybe I can group workspaces by their monitor with some mechanism for "unassigned" workspace to show up by a "primary" monitor
|
||||
|
||||
# render eww widget
|
||||
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
|
||||
(box :class \"workspaces\" :orientation \"h\" :spacing 0 :space-evenly \"true\" \
|
||||
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"workspace ${ACTIVE[1]} ${OCCUPIED[1]} ${FOCUSED[1]}\" \"${icons[0]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"workspace ${ACTIVE[2]} ${OCCUPIED[2]} ${FOCUSED[2]}\" \"${icons[1]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"workspace ${ACTIVE[3]} ${OCCUPIED[3]} ${FOCUSED[3]}\" \"${icons[2]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"workspace ${ACTIVE[4]} ${OCCUPIED[4]} ${FOCUSED[4]}\" \"${icons[3]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"workspace ${ACTIVE[5]} ${OCCUPIED[5]} ${FOCUSED[5]}\" \"${icons[4]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"workspace ${ACTIVE[6]} ${OCCUPIED[6]} ${FOCUSED[6]}\" \"${icons[5]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"workspace ${ACTIVE[7]} ${OCCUPIED[7]} ${FOCUSED[7]}\" \"${icons[6]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"workspace ${ACTIVE[8]} ${OCCUPIED[8]} ${FOCUSED[8]}\" \"${icons[7]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"workspace ${ACTIVE[9]} ${OCCUPIED[9]} ${FOCUSED[9]}\" \"${icons[8]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 1\" :onrightclick \"hyprctl dispatch workspace 1\" :class \"workspace $a1 $o1 $f1\" \"${ic[0]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 2\" :onrightclick \"hyprctl dispatch workspace 2\" :class \"workspace $a2 $o2 $f2\" \"${ic[1]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 3\" :onrightclick \"hyprctl dispatch workspace 3\" :class \"workspace $a3 $o3 $f3\" \"${ic[2]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 4\" :onrightclick \"hyprctl dispatch workspace 4\" :class \"workspace $a4 $o4 $f4\" \"${ic[3]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 5\" :onrightclick \"hyprctl dispatch workspace 5\" :class \"workspace $a5 $o5 $f5\" \"${ic[4]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 6\" :onrightclick \"hyprctl dispatch workspace 6\" :class \"workspace $a6 $o6 $f6\" \"${ic[5]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 7\" :onrightclick \"hyprctl dispatch workspace 7\" :class \"workspace $a7 $o7 $f7\" \"${ic[6]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 8\" :onrightclick \"hyprctl dispatch workspace 8\" :class \"workspace $a8 $o8 $f8\" \"${ic[7]}\") \
|
||||
(button :onclick \"hyprctl dispatch workspace 9\" :onrightclick \"hyprctl dispatch workspace 9\" :class \"workspace $a9 $o9 $f9\" \"${ic[8]}\") \
|
||||
) \
|
||||
)"
|
||||
}
|
||||
|
||||
workspace_reader() {
|
||||
while read -r l; do
|
||||
workspaces "$l"
|
||||
done
|
||||
}
|
||||
|
||||
# initial render
|
||||
workspaces
|
||||
|
||||
# listen to events and re-render
|
||||
nc -U "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | workspace_reader
|
||||
|
||||
echo '(box "EXITING")'
|
||||
while true; do
|
||||
# TODO: not sure why this socat | read invocation seems to stop?
|
||||
socat - "UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do
|
||||
workspaces "$line"
|
||||
done
|
||||
done
|
||||
echo '(box "DONE")'
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
./target
|
||||
./result
|
|
@ -1,20 +0,0 @@
|
|||
{pkgs ? import <nixpkgs> {}}: let
|
||||
# lock = builtins.fromJSON (builtins.readFile ../../../../../flake.lock);
|
||||
# nixpkgsRev = lock.nodes.nixpkgs.locked.rev;
|
||||
# pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev}.tar.gz") {};
|
||||
pname = "hyprland-workspaces-eww";
|
||||
version = "1.0.0";
|
||||
src = ./src;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
cargoHash = "sha256-6Wl3cOIxlPJjzEuzNhCBZJXayL8runQfAxPruvzh2Vc=";
|
||||
# cargoHash = pkgs.lib.fakeHash;
|
||||
checkType = "release";
|
||||
postBuild = ''
|
||||
# pushd target/*/release
|
||||
# ls -la
|
||||
# ${pkgs.upx}/bin/upx --best --lzma hyprland-workspaces-eww
|
||||
# popd
|
||||
'';
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
target
|
|
@ -1,96 +0,0 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "hyprland-workspaces-eww"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.93"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.217"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.137"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.96"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
|
@ -1,19 +0,0 @@
|
|||
[package]
|
||||
name = "hyprland-workspaces-eww"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "hyprland-workspaces-eww"
|
||||
path = "./main.rs"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.217"
|
||||
serde_json = "1.0.137"
|
||||
|
||||
[profile.release]
|
||||
strip = true
|
||||
opt-level = "z"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
panic = "abort"
|
|
@ -1,186 +0,0 @@
|
|||
mod workspace {
|
||||
pub struct Workspace {
|
||||
id: usize,
|
||||
icon: char,
|
||||
pub is_active: bool,
|
||||
pub is_occupied: bool,
|
||||
pub is_focused: bool,
|
||||
}
|
||||
|
||||
impl Workspace {
|
||||
pub fn new(id: usize) -> Self {
|
||||
Self {
|
||||
id,
|
||||
icon: id.to_string().chars().next().unwrap_or('?'),
|
||||
is_active: false,
|
||||
is_occupied: false,
|
||||
is_focused: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id(&self) -> usize {
|
||||
return self.id;
|
||||
}
|
||||
|
||||
pub fn icon(&self) -> char {
|
||||
return self.icon;
|
||||
}
|
||||
|
||||
pub fn clear_states(&mut self) {
|
||||
self.is_active = false;
|
||||
self.is_occupied = false;
|
||||
self.is_focused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod eww {}
|
||||
|
||||
mod hypr {
|
||||
pub mod hyprland {
|
||||
|
||||
pub mod workspace {
|
||||
pub type Id = usize;
|
||||
pub type Name = String;
|
||||
}
|
||||
|
||||
pub mod socket2 {
|
||||
use super::workspace;
|
||||
use std::{error::Error, fmt::Display, num::ParseIntError, str::FromStr};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Event {
|
||||
Workspace(workspace::Id),
|
||||
Exit(),
|
||||
WorkspaceV2(String, String),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum EventParseError {
|
||||
UnknownEventType(String),
|
||||
MissingParameters(String),
|
||||
InvalidParameters(String, String),
|
||||
ParseIntError(ParseIntError),
|
||||
}
|
||||
|
||||
impl From<ParseIntError> for EventParseError {
|
||||
fn from(value: ParseIntError) -> Self {
|
||||
Self::ParseIntError(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for EventParseError {}
|
||||
|
||||
impl Display for EventParseError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
EventParseError::UnknownEventType(event_type) => {
|
||||
write!(f, "unknown event type: {event_type}")
|
||||
}
|
||||
|
||||
EventParseError::MissingParameters(event_type) => {
|
||||
write!(f, "missing parameters for event type: {event_type}")
|
||||
}
|
||||
|
||||
EventParseError::ParseIntError(err) => {
|
||||
write!(f, "error parsing integer: {err}")
|
||||
}
|
||||
EventParseError::InvalidParameters(event_type, params) => {
|
||||
write!(
|
||||
f,
|
||||
"invalid parameters for event type {event_type}: {params}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Event {
|
||||
type Err = EventParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let (event_type, rest): (&str, Option<&str>) = s
|
||||
.find(">>")
|
||||
.map(|n| {
|
||||
let (a, b) = s.split_at(n);
|
||||
(a, Option::Some(&b[2..]))
|
||||
})
|
||||
.unwrap_or((s, Option::None));
|
||||
match (event_type, rest) {
|
||||
("workspace", None) => {
|
||||
Err(EventParseError::MissingParameters(event_type.to_string()))
|
||||
}
|
||||
("workspace", Some(workspace)) => Ok(Event::Workspace(workspace.parse()?)),
|
||||
("workspacev2", Some(args)) => {
|
||||
let args: (String, String) = args
|
||||
.split_once(',')
|
||||
.map(|(a, b)| (a.to_string(), b.to_string()))
|
||||
.ok_or(EventParseError::InvalidParameters(
|
||||
event_type.to_string(),
|
||||
args.to_string(),
|
||||
))?;
|
||||
Ok(Event::WorkspaceV2(args.0, args.1))
|
||||
}
|
||||
("exit", _) => Ok(Event::Exit()),
|
||||
_ => Err(EventParseError::UnknownEventType(event_type.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use hypr::hyprland::socket2::Event;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
env,
|
||||
error::Error,
|
||||
io::{BufRead, BufReader},
|
||||
os::unix::net::UnixStream,
|
||||
};
|
||||
use workspace::Workspace;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let mut workspaces: HashMap<usize, Workspace> =
|
||||
(1..=9).map(|n| (n, Workspace::new(n))).collect();
|
||||
let path = format!(
|
||||
"{}/hypr/{}/.socket2.sock",
|
||||
env::var("XDG_RUNTIME_DIR")?,
|
||||
env::var("HYPRLAND_INSTANCE_SIGNATURE")?
|
||||
);
|
||||
|
||||
eprintln!("opening {}", path);
|
||||
let stream = UnixStream::connect(&path)?;
|
||||
let event_lines = BufReader::new(stream).lines();
|
||||
for l in event_lines.into_iter() {
|
||||
match l?.parse::<Event>() {
|
||||
Ok(e) => match e {
|
||||
Event::Workspace(i) => match workspaces.get_mut(&i) {
|
||||
Some(related_workspace) => {
|
||||
eprintln!(
|
||||
"setting workspace {} (id: {}) as active",
|
||||
related_workspace.icon(),
|
||||
related_workspace.id()
|
||||
);
|
||||
related_workspace.is_active = true
|
||||
}
|
||||
None => {
|
||||
eprintln!("event for untracked workspace {}", i);
|
||||
}
|
||||
},
|
||||
Event::Exit() => break,
|
||||
other => {
|
||||
eprintln!("unhandled event: {:?}", other);
|
||||
}
|
||||
},
|
||||
Err(e) => eprintln!("error parsing event: {}", e),
|
||||
}
|
||||
render(&workspaces)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn render(workspaces: &HashMap<usize, Workspace>) -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
}
|
6
modules/home-manager/ewwbar.nix
Normal file
6
modules/home-manager/ewwbar.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
programs.eww = {
|
||||
enable = true;
|
||||
configDir = ./eww;
|
||||
};
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
set this_shell_should_notify 1
|
||||
|
||||
# prompt
|
||||
function get_hostname
|
||||
if test (uname) = Linux || test (uname) = Darwin
|
||||
|
@ -63,10 +61,6 @@ end
|
|||
function _last_cmd_duration
|
||||
set_color -b normal green
|
||||
set -q CMD_DURATION && printf " %dms" $CMD_DURATION
|
||||
if test $CMD_DURATION -gt 5000 && test $this_shell_should_notify = 1
|
||||
printf "\e]777;notify;%s;%s\e\\" "WezTerm: Command Finished" (history --max 1)
|
||||
set this_shell_should_notify 0
|
||||
end
|
||||
end
|
||||
|
||||
function _maybe_jobs_summary
|
||||
|
@ -118,10 +112,6 @@ function _prompt_prefix
|
|||
printf "# "
|
||||
end
|
||||
|
||||
function preexec --on-event fish_preexec
|
||||
set this_shell_should_notify 1
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set last_cmd_status $status
|
||||
_prompt_marker
|
||||
|
|
|
@ -33,7 +33,7 @@ set --export --universal EXA_COLORS '*=0'
|
|||
|
||||
set --export --universal ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000"
|
||||
|
||||
set --export --universal BROWSER (which firefox)
|
||||
set --export --universal BROWSER firefox
|
||||
|
||||
set --export --universal SOPS_AGE_KEY_FILE "$XDG_CONFIG_HOME/sops/age/keys.txt"
|
||||
|
||||
|
@ -42,8 +42,6 @@ if has_command skim
|
|||
set --export --universal SKIM_CTRL_T_COMMAND "fd --hidden"
|
||||
end
|
||||
|
||||
set --export --universal NEWT_COLORS "root=black,black:border=black,blue"
|
||||
|
||||
# colors
|
||||
set -U fish_color_normal normal # default color
|
||||
set -U fish_color_command white # base command being run (>ls< -la)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
style,
|
||||
colors,
|
||||
config,
|
||||
lib,
|
||||
# font,
|
||||
...
|
||||
}: let
|
||||
inherit (style) colors;
|
||||
in {
|
||||
# TODO: Hyprland seems to sometimes use a ton of CPU?
|
||||
}: {
|
||||
imports = [
|
||||
./ewwbar.nix
|
||||
# ./mako.nix
|
||||
./swaylock.nix
|
||||
# TODO: figure out how to import this for this module _and_ for the sway module?
|
||||
./linux-desktop.nix
|
||||
];
|
||||
|
||||
# TODO: Hyprland seems to have issues with resuming from hibernation on my
|
||||
# laptop where it uses a ton of CPU.
|
||||
|
||||
home.packages = with pkgs; [
|
||||
glib
|
||||
# TODO: integrate osd
|
||||
swayosd
|
||||
];
|
||||
|
||||
|
@ -38,41 +45,57 @@ in {
|
|||
|
||||
exec-once = [
|
||||
"hyprpaper"
|
||||
"mako"
|
||||
# "mako"
|
||||
"swayosd-server"
|
||||
"eww daemon"
|
||||
"[workspace 1 silent] firefox"
|
||||
"[workspace 1 silent] wezterm"
|
||||
"eww daemon && eww open bar$EWW_BAR_MON"
|
||||
"firefox"
|
||||
"wezterm"
|
||||
"xwaylandvideobridge"
|
||||
"dbus-update-activation-environment --systemd --all"
|
||||
"systemctl --user import-environment QT_QPA_PLATFORMTHEME"
|
||||
"hypridle"
|
||||
];
|
||||
|
||||
exec = [
|
||||
''gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"''
|
||||
''gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"''
|
||||
# "wezterm"
|
||||
# NOTE: maybe check out hypridle?
|
||||
(lib.concatStringsSep " " [
|
||||
"swayidle -w"
|
||||
"timeout 300 'notify-send \"Idling in 300 seconds\"' resume 'notify-send \"Idling cancelled.\"'"
|
||||
"timeout 480 'notify-send -u critical \"Idling in 120 seconds\"'"
|
||||
"timeout 510 'notify-send -u critical \"Idling in 90 seconds\"'"
|
||||
"timeout 540 'notify-send -u critical \"Idling in 60 seconds!\"'"
|
||||
"timeout 570 'notify-send -u critical \"Idling in 30 seconds!\"'"
|
||||
"timeout 590 'notify-send -u critical \"Idling in 10 seconds!\"'"
|
||||
"timeout 591 'notify-send -u critical \"Idling in 9 seconds!\"'"
|
||||
"timeout 592 'notify-send -u critical \"Idling in 8 seconds!\"'"
|
||||
"timeout 593 'notify-send -u critical \"Idling in 7 seconds!\"'"
|
||||
"timeout 594 'notify-send -u critical \"Idling in 6 seconds!\"'"
|
||||
"timeout 595 'notify-send -u critical \"Idling in 5 seconds!\"'"
|
||||
"timeout 596 'notify-send -u critical \"Idling in 4 seconds!\"'"
|
||||
"timeout 597 'notify-send -u critical \"Idling in 3 seconds!\"'"
|
||||
"timeout 598 'notify-send -u critical \"Idling in 2 seconds!\"'"
|
||||
"timeout 599 'notify-send -u critical \"Idling in 1 second!\"'"
|
||||
"timeout 600 'swaylock --daemonize'"
|
||||
"timeout 600 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'"
|
||||
"after-resume 'maybe-good-morning'"
|
||||
"before-sleep 'swaylock --daemonize'"
|
||||
])
|
||||
''swayidle -w timeout 600 'notify-send "Locking in 30 seconds..."' timeout 630 'swaylock -f' timeout 660 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on && maybe-good-morning' before-sleep 'swaylock -f'"''
|
||||
"dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
|
||||
];
|
||||
|
||||
env = [
|
||||
"XCURSOR_SIZE,24"
|
||||
"QT_QPA_PLATFORMTHEME,qt6ct"
|
||||
"GTK_THEME,Adwaita-dark"
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
kb_options = "ctrl:nocaps";
|
||||
|
||||
/*
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_rules =
|
||||
*/
|
||||
# kb_variant =
|
||||
# kb_model =
|
||||
# kb_rules =
|
||||
|
||||
follow_mouse = 2;
|
||||
|
||||
repeat_delay = 180;
|
||||
repeat_rate = 120;
|
||||
repeat_delay = 200;
|
||||
repeat_rate = 60;
|
||||
|
||||
touchpad = {
|
||||
natural_scroll = "yes";
|
||||
|
@ -91,10 +114,6 @@ in {
|
|||
allow_workspace_cycles = true;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
no_warps = true;
|
||||
};
|
||||
|
||||
general = {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
"col.active_border" = "0xff${colors.primary} 0xff${colors.green} 45deg";
|
||||
|
@ -103,29 +122,24 @@ in {
|
|||
gaps_in = 3;
|
||||
gaps_out = 6;
|
||||
border_size = 2;
|
||||
no_cursor_warps = true;
|
||||
resize_on_border = true;
|
||||
no_focus_fallback = false;
|
||||
no_focus_fallback = true;
|
||||
|
||||
layout = "dwindle";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
rounding_power = 4.0;
|
||||
rounding = 3;
|
||||
# blur = "no";
|
||||
# blur_size = 3
|
||||
# blur_passes = 1
|
||||
# blur_new_optimizations = on
|
||||
|
||||
/*
|
||||
blur = "no";
|
||||
blur_size = 3
|
||||
blur_passes = 1
|
||||
blur_new_optimizations = on
|
||||
*/
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
color = "rgba(1a1a1aee)";
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
};
|
||||
drop_shadow = "yes";
|
||||
shadow_range = 4;
|
||||
shadow_render_power = 3;
|
||||
"col.shadow" = "rgba(1a1a1aee)";
|
||||
|
||||
dim_inactive = false;
|
||||
};
|
||||
|
@ -133,15 +147,12 @@ in {
|
|||
"$mod" = "SUPER";
|
||||
bind = [
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
/*
|
||||
# "$mod, return, exec, wezterm"
|
||||
# "$mod SHIFT, return, exec, wezterm"
|
||||
"$mod, return, exec, wezterm"
|
||||
"$mod SHIFT, return, exec, wezterm"
|
||||
*/
|
||||
"$mod, return, exec, wezterm"
|
||||
"$mod SHIFT, return, exec, [float] wezterm start --always-new-process"
|
||||
"$mod SHIFT, return, exec, kitty"
|
||||
"$mod, U, exec, firefox"
|
||||
"$mod, space, exec, tofi-run | xargs hyprctl dispatch exec --"
|
||||
"$mod, D, exec, tofi-drun | xargs hyprctl dispatch exec --"
|
||||
"$mod, C, killactive,"
|
||||
"$mod SHIFT, E, exit,"
|
||||
"$mod, E, exec, dolphin"
|
||||
|
@ -160,10 +171,10 @@ in {
|
|||
"$mod, l, movefocus, r"
|
||||
"$mod, k, movefocus, u"
|
||||
"$mod, j, movefocus, d"
|
||||
"$mod SHIFT, H, movewindow, l silent"
|
||||
"$mod SHIFT, L, movewindow, r silent"
|
||||
"$mod SHIFT, K, movewindow, u silent"
|
||||
"$mod SHIFT, J, movewindow, d silent"
|
||||
"$mod SHIFT, H, swapwindow, l"
|
||||
"$mod SHIFT, L, swapwindow, r"
|
||||
"$mod SHIFT, K, swapwindow, u"
|
||||
"$mod SHIFT, J, swapwindow, d"
|
||||
|
||||
"$mod SHIFT, V, exec, swayosd-client --input-volume mute-toggle"
|
||||
", XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle"
|
||||
|
@ -194,25 +205,25 @@ in {
|
|||
"$mod, 0, workspace, 10"
|
||||
|
||||
# Move active window to a workspace with mod + SHIFT + [0-9]
|
||||
"$mod SHIFT, 1, movetoworkspacesilent, 1"
|
||||
"$mod SHIFT, 2, movetoworkspacesilent, 2"
|
||||
"$mod SHIFT, 3, movetoworkspacesilent, 3"
|
||||
"$mod SHIFT, 4, movetoworkspacesilent, 4"
|
||||
"$mod SHIFT, 5, movetoworkspacesilent, 5"
|
||||
"$mod SHIFT, 6, movetoworkspacesilent, 6"
|
||||
"$mod SHIFT, 7, movetoworkspacesilent, 7"
|
||||
"$mod SHIFT, 8, movetoworkspacesilent, 8"
|
||||
"$mod SHIFT, 9, movetoworkspacesilent, 9"
|
||||
"$mod SHIFT, 0, movetoworkspacesilent, 10"
|
||||
"$mod SHIFT, 1, movetoworkspace, 1"
|
||||
"$mod SHIFT, 2, movetoworkspace, 2"
|
||||
"$mod SHIFT, 3, movetoworkspace, 3"
|
||||
"$mod SHIFT, 4, movetoworkspace, 4"
|
||||
"$mod SHIFT, 5, movetoworkspace, 5"
|
||||
"$mod SHIFT, 6, movetoworkspace, 6"
|
||||
"$mod SHIFT, 7, movetoworkspace, 7"
|
||||
"$mod SHIFT, 8, movetoworkspace, 8"
|
||||
"$mod SHIFT, 9, movetoworkspace, 9"
|
||||
"$mod SHIFT, 0, movetoworkspace, 10"
|
||||
"$mod SHIFT, S, exec, clipshot"
|
||||
|
||||
# Scroll through existing workspaces with mod + scroll
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
"$mod, mouse_up, workspace, e-1"
|
||||
"CTRL SHIFT $mod, L, exec, hyprlock"
|
||||
"CTRL SHIFT $mod, L, exec, swaylock"
|
||||
"$mod CTRL, space, exec, makoctl dismiss"
|
||||
"$mod SHIFT CTRL, space, exec, makoctl restore"
|
||||
"$mod SHIFT, space, exec, makoctl invoke default"
|
||||
"$mod SHIFT, space, exec, makoctl invoke"
|
||||
"$mod, E, exec, thunar"
|
||||
];
|
||||
|
||||
|
@ -240,12 +251,12 @@ in {
|
|||
# master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
|
||||
pseudotile = yes
|
||||
preserve_split = 1
|
||||
# no_gaps_when_only = true
|
||||
no_gaps_when_only = true
|
||||
}
|
||||
|
||||
master {
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
# new_is_master = true
|
||||
new_is_master = true
|
||||
}
|
||||
|
||||
gestures {
|
||||
|
@ -253,178 +264,22 @@ in {
|
|||
workspace_swipe = on
|
||||
}
|
||||
|
||||
## Example per-device config
|
||||
## See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
|
||||
## device:epic-mouse-v1 {
|
||||
## sensitivity = -0.5
|
||||
## }
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
|
||||
# device:epic-mouse-v1 {
|
||||
# sensitivity = -0.5
|
||||
# }
|
||||
|
||||
## See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
windowrulev2 = idleinhibit,class:^.*([Ss]lippi).*$
|
||||
windowrulev2 = float,class:^.*$
|
||||
windowrulev2 = tile,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$
|
||||
# windowrulev2 = opacity 1.0 0.95,class:^.*$
|
||||
windowrulev2 = center 1,floating:1
|
||||
windowrulev2 = float,class:^.*([Kk]itty|[Ff]irefox|[Ww]ezterm|[Dd]iscord|[Ss]potify|[Ss]lack).*$
|
||||
windowrulev2 = opacity 1.0 0.9,floating:1
|
||||
|
||||
windowrulev2 = opacity 0.0 override, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noinitialfocus, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = maxsize 1 1, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noblur, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = nofocus, class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noblur,class:^(xwaylandvideobridge)$
|
||||
'';
|
||||
};
|
||||
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# docs: https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock
|
||||
|
||||
general = {
|
||||
grace = 0;
|
||||
no_fade_out = true;
|
||||
};
|
||||
|
||||
input-field = [
|
||||
{
|
||||
monitor = "";
|
||||
fade_on_empty = false;
|
||||
placeholder_text = "Locked";
|
||||
rounding = 5;
|
||||
font_size = 20;
|
||||
font_color = "rgba(255, 255, 255, 1.0)";
|
||||
inner_color = "rgba(31, 31, 47, 0.95)";
|
||||
outer_color = "0xff74c7ec 0xff74c7ec 45deg";
|
||||
outline_thickness = 3;
|
||||
position = "0, -200";
|
||||
|
||||
dots_size = 0.1;
|
||||
size = "300 75";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 8;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 0.8;
|
||||
}
|
||||
];
|
||||
|
||||
background = [
|
||||
{
|
||||
path = "~/.wallpaper";
|
||||
blur_passes = 2;
|
||||
}
|
||||
];
|
||||
|
||||
label = [
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 64;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
|
||||
# rotate = 10;
|
||||
position = "0, 250";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = ''Locked for <span foreground="##74c7ec">$USER</span>'';
|
||||
|
||||
shadow_passes = 1;
|
||||
shadow_size = 8;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 0.5;
|
||||
}
|
||||
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 32;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(255, 255, 255, 0.5)";
|
||||
|
||||
position = "0 100";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = "cmd[update:1000] date '+%a %b %d %H:%M:%S'";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 200;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(220, 240, 255, 0.8)";
|
||||
position = "0 500";
|
||||
font_family = "NerdFontSymbolsOnly";
|
||||
text = "";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.hypridle = let
|
||||
secondsPerMinute = 60;
|
||||
lockSeconds = 10 * secondsPerMinute;
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
ignore_dbus_inhibit = false;
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
};
|
||||
|
||||
listener = [
|
||||
{
|
||||
timeout = lockSeconds - 300;
|
||||
on-timeout = ''notify-send "Auto-locking in 5 minutes"'';
|
||||
on-resume = ''notify-send "Auto-locking cancelled"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 180;
|
||||
on-timeout = ''notify-send "Auto-locking in 3 minutes"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 120;
|
||||
on-timeout = ''notify-send "Auto-locking in 2 minutes"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 60;
|
||||
on-timeout = ''notify-send "Auto-locking in 1 minute"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 30;
|
||||
on-timeout = ''notify-send "Auto-locking in 30 seconds"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds - 10;
|
||||
on-timeout = ''notify-send -u critical "Auto-locking in 10 seconds"'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds;
|
||||
on-timeout = ''loginctl lock-session'';
|
||||
}
|
||||
{
|
||||
timeout = lockSeconds + 5;
|
||||
on-timeout = ''hyprctl dispatch dpms off'';
|
||||
on-resume = ''hyprctl dispatch dpms on'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
32
modules/home-manager/mako.nix
Normal file
32
modules/home-manager/mako.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
colors,
|
||||
font,
|
||||
...
|
||||
}: {
|
||||
services.mako = with colors.withHashPrefix; {
|
||||
enable = false;
|
||||
|
||||
anchor = "top-right";
|
||||
|
||||
extraConfig = ''
|
||||
border-size=1
|
||||
max-visible=5
|
||||
default-timeout=15000
|
||||
font=Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}
|
||||
anchor=top-right
|
||||
|
||||
background-color=${colors.bg}
|
||||
text-color=${colors.text}
|
||||
border-color=${colors.primary}
|
||||
progress-color=${colors.primary}
|
||||
|
||||
[urgency=high]
|
||||
border-color=${urgent}
|
||||
|
||||
[urgency=high]
|
||||
background-color=${urgent}
|
||||
border-color=${urgent}
|
||||
text-color=${bg}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,503 +0,0 @@
|
|||
// This config is in the KDL format: https://kdl.dev
|
||||
// "/-" comments out the following node.
|
||||
// Check the wiki for a full description of the configuration:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
|
||||
|
||||
// Input device configuration.
|
||||
// Find the full list of options on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
||||
input {
|
||||
keyboard {
|
||||
// repeat-delay 180;
|
||||
// repeat-rate 120;
|
||||
|
||||
xkb {
|
||||
// You can set rules, model, layout, variant and options.
|
||||
// For more information, see xkeyboard-config(7).
|
||||
|
||||
// For example:
|
||||
// layout "us,ru"
|
||||
options "ctrl:nocaps"
|
||||
}
|
||||
}
|
||||
|
||||
// Next sections include libinput settings.
|
||||
// Omitting settings disables them, or leaves them at their default values.
|
||||
touchpad {
|
||||
// off
|
||||
tap
|
||||
// dwt
|
||||
// dwtp
|
||||
natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "two-finger"
|
||||
// disabled-on-external-mouse
|
||||
}
|
||||
|
||||
mouse {
|
||||
// off
|
||||
// natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "no-scroll"
|
||||
}
|
||||
|
||||
trackpoint {
|
||||
// off
|
||||
// natural-scroll
|
||||
// accel-speed 0.2
|
||||
// accel-profile "flat"
|
||||
// scroll-method "on-button-down"
|
||||
// scroll-button 273
|
||||
// middle-emulation
|
||||
}
|
||||
|
||||
// Uncomment this to make the mouse warp to the center of newly focused windows.
|
||||
// warp-mouse-to-focus
|
||||
|
||||
// Focus windows and outputs automatically when moving the mouse into them.
|
||||
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
|
||||
// focus-follows-mouse max-scroll-amount="0%"
|
||||
}
|
||||
|
||||
// You can configure outputs by their name, which you can find
|
||||
// by running `niri msg outputs` while inside a niri instance.
|
||||
// The built-in laptop monitor is usually called "eDP-1".
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
|
||||
// Remember to uncomment the node by removing "/-"!
|
||||
/-output "eDP-1" {
|
||||
// Uncomment this line to disable this output.
|
||||
// off
|
||||
|
||||
// Resolution and, optionally, refresh rate of the output.
|
||||
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
|
||||
// If the refresh rate is omitted, niri will pick the highest refresh rate
|
||||
// for the resolution.
|
||||
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
|
||||
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
|
||||
mode "1920x1080@120.030"
|
||||
|
||||
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
||||
scale 2
|
||||
|
||||
// Transform allows to rotate the output counter-clockwise, valid values are:
|
||||
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
||||
transform "normal"
|
||||
|
||||
// Position of the output in the global coordinate space.
|
||||
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
|
||||
// The cursor can only move between directly adjacent outputs.
|
||||
// Output scale and rotation has to be taken into account for positioning:
|
||||
// outputs are sized in logical, or scaled, pixels.
|
||||
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
|
||||
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
||||
// If the position is unset or results in an overlap, the output is instead placed
|
||||
// automatically.
|
||||
position x=1280 y=0
|
||||
}
|
||||
|
||||
// Settings that influence how windows are positioned and sized.
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
|
||||
layout {
|
||||
// Set gaps around windows in logical pixels.
|
||||
gaps 5
|
||||
|
||||
// When to center a column when changing focus, options are:
|
||||
// - "never", default behavior, focusing an off-screen column will keep at the left
|
||||
// or right edge of the screen.
|
||||
// - "always", the focused column will always be centered.
|
||||
// - "on-overflow", focusing a column will center it if it doesn't fit
|
||||
// together with the previously focused column.
|
||||
center-focused-column "never"
|
||||
|
||||
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
|
||||
preset-column-widths {
|
||||
// Proportion sets the width as a fraction of the output width, taking gaps into account.
|
||||
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
|
||||
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
|
||||
// proportion 0.33333
|
||||
proportion 0.5
|
||||
// proportion 0.66667
|
||||
|
||||
// Fixed sets the width in logical pixels exactly.
|
||||
// fixed 1920
|
||||
}
|
||||
|
||||
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
|
||||
// preset-window-heights { }
|
||||
|
||||
// You can change the default width of the new windows.
|
||||
// default-column-width { proportion 0.5; }
|
||||
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
||||
// default-column-width {}
|
||||
|
||||
// By default focus ring and border are rendered as a solid background rectangle
|
||||
// behind windows. That is, they will show up through semitransparent windows.
|
||||
// This is because windows using client-side decorations can have an arbitrary shape.
|
||||
//
|
||||
// If you don't like that, you should uncomment `prefer-no-csd` below.
|
||||
// Niri will draw focus ring and border *around* windows that agree to omit their
|
||||
// client-side decorations.
|
||||
//
|
||||
// Alternatively, you can override it with a window rule called
|
||||
// `draw-border-with-background`.
|
||||
|
||||
// You can change how the focus ring looks.
|
||||
focus-ring {
|
||||
// Uncomment this line to disable the focus ring.
|
||||
// off
|
||||
|
||||
// How many logical pixels the ring extends out from the windows.
|
||||
width 2
|
||||
|
||||
// Colors can be set in a variety of ways:
|
||||
// - CSS named colors: "red"
|
||||
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
|
||||
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
|
||||
|
||||
// Color of the ring on the active monitor.
|
||||
active-color "#7fc8ff"
|
||||
|
||||
// Color of the ring on inactive monitors.
|
||||
inactive-color "#505050"
|
||||
|
||||
// You can also use gradients. They take precedence over solid colors.
|
||||
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
|
||||
// The angle is the same as in linear-gradient, and is optional,
|
||||
// defaulting to 180 (top-to-bottom gradient).
|
||||
// You can use any CSS linear-gradient tool on the web to set these up.
|
||||
// Changing the color space is also supported, check the wiki for more info.
|
||||
//
|
||||
// active-gradient from="#80c8ff" to="#bbddff" angle=45
|
||||
|
||||
// You can also color the gradient relative to the entire view
|
||||
// of the workspace, rather than relative to just the window itself.
|
||||
// To do that, set relative-to="workspace-view".
|
||||
//
|
||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
||||
}
|
||||
|
||||
// You can also add a border. It's similar to the focus ring, but always visible.
|
||||
border {
|
||||
// The settings are the same as for the focus ring.
|
||||
// If you enable the border, you probably want to disable the focus ring.
|
||||
off
|
||||
|
||||
width 2
|
||||
active-color "#ffc87f"
|
||||
inactive-color "#505050"
|
||||
|
||||
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
|
||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
||||
}
|
||||
|
||||
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
|
||||
// You can think of them as a kind of outer gaps. They are set in logical pixels.
|
||||
// Left and right struts will cause the next window to the side to always be visible.
|
||||
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
|
||||
// layer-shell panels and regular gaps.
|
||||
struts {
|
||||
// left 64
|
||||
// right 64
|
||||
// top 64
|
||||
// bottom 64
|
||||
}
|
||||
}
|
||||
|
||||
// Add lines like this to spawn processes at startup.
|
||||
// Note that running niri as a session supports xdg-desktop-autostart,
|
||||
// which may be more convenient to use.
|
||||
// See the binds section below for more spawn examples.
|
||||
spawn-at-startup "wezterm"
|
||||
spawn-at-startup "firefox"
|
||||
spawn-at-startup "mako"
|
||||
spawn-at-startup "swayosd-server"
|
||||
|
||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
||||
// If the client will specifically ask for CSD, the request will be honored.
|
||||
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
||||
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
||||
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
||||
// prefer-no-csd
|
||||
|
||||
// You can change the path where screenshots are saved.
|
||||
// A ~ at the front will be expanded to the home directory.
|
||||
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||
|
||||
// You can also set this to null to disable saving screenshots to disk.
|
||||
// screenshot-path null
|
||||
|
||||
// Animation settings.
|
||||
// The wiki explains how to configure individual animations:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
|
||||
animations {
|
||||
// Uncomment to turn off all animations.
|
||||
// off
|
||||
|
||||
// Slow down all animations by this factor. Values below 1 speed them up instead.
|
||||
// slowdown 3.0
|
||||
}
|
||||
|
||||
// Window rules let you adjust behavior for individual windows.
|
||||
// Find more information on the wiki:
|
||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
|
||||
|
||||
// Work around WezTerm's initial configure bug
|
||||
// by setting an empty default-column-width.
|
||||
/-window-rule {
|
||||
// This regular expression is intentionally made as specific as possible,
|
||||
// since this is the default config, and we want no false positives.
|
||||
// You can get away with just app-id="wezterm" if you want.
|
||||
match app-id=r#"^org\.wezfurlong\.wezterm$"#
|
||||
default-column-width {}
|
||||
}
|
||||
|
||||
// Example: block out two password managers from screen capture.
|
||||
// (This example rule is commented out with a "/-" in front.)
|
||||
/-window-rule {
|
||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
||||
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
||||
|
||||
block-out-from "screen-capture"
|
||||
|
||||
// Use this instead if you want them visible on third-party screenshot tools.
|
||||
// block-out-from "screencast"
|
||||
}
|
||||
|
||||
// Example: enable rounded corners for all windows.
|
||||
// (This example rule is commented out with a "/-" in front.)
|
||||
window-rule {
|
||||
geometry-corner-radius 10
|
||||
clip-to-geometry true
|
||||
}
|
||||
|
||||
binds {
|
||||
// Keys consist of modifiers separated by + signs, followed by an XKB key name
|
||||
// in the end. To find an XKB name for a particular key, you may use a program
|
||||
// like wev.
|
||||
//
|
||||
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
|
||||
// when running as a winit window.
|
||||
//
|
||||
// Most actions that you can bind here can also be invoked programmatically with
|
||||
// `niri msg action do-something`.
|
||||
|
||||
// Mod-Shift-/, which is usually the same as Mod-?,
|
||||
// shows a list of important hotkeys.
|
||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||
|
||||
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
||||
Mod+T { spawn "wezterm"; }
|
||||
Mod+Space { spawn "fuzzel"; }
|
||||
Mod+D { spawn "fuzzel --drun"; }
|
||||
Super+Alt+L { spawn "swaylock"; }
|
||||
|
||||
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
||||
// Note: the entire command goes as a single argument in the end.
|
||||
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
||||
|
||||
// Example volume keys mappings for PipeWire & WirePlumber.
|
||||
// The allow-when-locked=true property makes them work even when the session is locked.
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
|
||||
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
|
||||
|
||||
Mod+Q { close-window; }
|
||||
|
||||
Mod+Left { focus-column-left; }
|
||||
Mod+Down { focus-window-down; }
|
||||
Mod+Up { focus-window-up; }
|
||||
Mod+Right { focus-column-right; }
|
||||
Mod+h { focus-column-left; }
|
||||
Mod+j { focus-window-down; }
|
||||
Mod+k { focus-window-up; }
|
||||
Mod+l { focus-column-right; }
|
||||
|
||||
Mod+Ctrl+Left { move-column-left; }
|
||||
Mod+Ctrl+Down { move-window-down; }
|
||||
Mod+Ctrl+Up { move-window-up; }
|
||||
Mod+Ctrl+Right { move-column-right; }
|
||||
Mod+Ctrl+H { move-column-left; }
|
||||
Mod+Ctrl+J { move-window-down; }
|
||||
Mod+Ctrl+K { move-window-up; }
|
||||
Mod+Ctrl+L { move-column-right; }
|
||||
|
||||
// Alternative commands that move across workspaces when reaching
|
||||
// the first or last window in a column.
|
||||
// Mod+j { focus-window-or-workspace-down; }
|
||||
// Mod+K { focus-window-or-workspace-up; }
|
||||
// Mod+L { focus-window-or-workspace-right; }
|
||||
// Mod+h { focus-window-or-workspace-left; }
|
||||
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
|
||||
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
|
||||
|
||||
Mod+Home { focus-column-first; }
|
||||
Mod+End { focus-column-last; }
|
||||
Mod+Ctrl+Home { move-column-to-first; }
|
||||
Mod+Ctrl+End { move-column-to-last; }
|
||||
|
||||
Mod+Shift+Left { focus-monitor-left; }
|
||||
Mod+Shift+Down { focus-monitor-down; }
|
||||
Mod+Shift+Up { focus-monitor-up; }
|
||||
Mod+Shift+Right { focus-monitor-right; }
|
||||
Mod+Shift+H { focus-monitor-left; }
|
||||
Mod+Shift+J { focus-monitor-down; }
|
||||
Mod+Shift+K { focus-monitor-up; }
|
||||
Mod+Shift+L { focus-monitor-right; }
|
||||
|
||||
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
||||
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
||||
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
||||
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
|
||||
// ...
|
||||
|
||||
// And you can also move a whole workspace to another monitor:
|
||||
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
|
||||
// ...
|
||||
|
||||
Mod+Page_Down { focus-workspace-down; }
|
||||
Mod+Page_Up { focus-workspace-up; }
|
||||
Mod+U { focus-workspace-down; }
|
||||
Mod+I { focus-workspace-up; }
|
||||
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
||||
Mod+Ctrl+U { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+I { move-column-to-workspace-up; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
|
||||
// ...
|
||||
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
Mod+Shift+U { move-workspace-down; }
|
||||
Mod+Shift+I { move-workspace-up; }
|
||||
|
||||
// You can bind mouse wheel scroll ticks using the following syntax.
|
||||
// These binds will change direction based on the natural-scroll setting.
|
||||
//
|
||||
// To avoid scrolling through workspaces really fast, you can use
|
||||
// the cooldown-ms property. The bind will be rate-limited to this value.
|
||||
// You can set a cooldown on any bind, but it's most useful for the wheel.
|
||||
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
||||
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
||||
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
|
||||
|
||||
Mod+WheelScrollRight { focus-column-right; }
|
||||
Mod+WheelScrollLeft { focus-column-left; }
|
||||
Mod+Ctrl+WheelScrollRight { move-column-right; }
|
||||
Mod+Ctrl+WheelScrollLeft { move-column-left; }
|
||||
|
||||
// Usually scrolling up and down with Shift in applications results in
|
||||
// horizontal scrolling; these binds replicate that.
|
||||
Mod+Shift+WheelScrollDown { focus-column-right; }
|
||||
Mod+Shift+WheelScrollUp { focus-column-left; }
|
||||
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
|
||||
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
|
||||
|
||||
// Similarly, you can bind touchpad scroll "ticks".
|
||||
// Touchpad scrolling is continuous, so for these binds it is split into
|
||||
// discrete intervals.
|
||||
// These binds are also affected by touchpad's natural-scroll, so these
|
||||
// example binds are "inverted", since we have natural-scroll enabled for
|
||||
// touchpads by default.
|
||||
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
|
||||
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
|
||||
|
||||
// You can refer to workspaces by index. However, keep in mind that
|
||||
// niri is a dynamic workspace system, so these commands are kind of
|
||||
// "best effort". Trying to refer to a workspace index bigger than
|
||||
// the current workspace count will instead refer to the bottommost
|
||||
// (empty) workspace.
|
||||
//
|
||||
// For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
|
||||
// will all refer to the 3rd workspace.
|
||||
Mod+1 { focus-workspace 1; }
|
||||
Mod+2 { focus-workspace 2; }
|
||||
Mod+3 { focus-workspace 3; }
|
||||
Mod+4 { focus-workspace 4; }
|
||||
Mod+5 { focus-workspace 5; }
|
||||
Mod+6 { focus-workspace 6; }
|
||||
Mod+7 { focus-workspace 7; }
|
||||
Mod+8 { focus-workspace 8; }
|
||||
Mod+9 { focus-workspace 9; }
|
||||
Mod+Ctrl+1 { move-column-to-workspace 1; }
|
||||
Mod+Ctrl+2 { move-column-to-workspace 2; }
|
||||
Mod+Ctrl+3 { move-column-to-workspace 3; }
|
||||
Mod+Ctrl+4 { move-column-to-workspace 4; }
|
||||
Mod+Ctrl+5 { move-column-to-workspace 5; }
|
||||
Mod+Ctrl+6 { move-column-to-workspace 6; }
|
||||
Mod+Ctrl+7 { move-column-to-workspace 7; }
|
||||
Mod+Ctrl+8 { move-column-to-workspace 8; }
|
||||
Mod+Ctrl+9 { move-column-to-workspace 9; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Ctrl+1 { move-window-to-workspace 1; }
|
||||
|
||||
// Switches focus between the current and the previous workspace.
|
||||
Mod+Tab { focus-workspace-previous; }
|
||||
|
||||
// Consume one window from the right into the focused column.
|
||||
Mod+Comma { consume-window-into-column; }
|
||||
// Expel one window from the focused column to the right.
|
||||
Mod+Period { expel-window-from-column; }
|
||||
|
||||
// There are also commands that consume or expel a single window to the side.
|
||||
Mod+BracketLeft { consume-or-expel-window-left; }
|
||||
Mod+BracketRight { consume-or-expel-window-right; }
|
||||
|
||||
Mod+R { switch-preset-column-width; }
|
||||
Mod+Shift+R { switch-preset-window-height; }
|
||||
Mod+Ctrl+R { reset-window-height; }
|
||||
Mod+F { maximize-column; }
|
||||
Mod+Shift+F { fullscreen-window; }
|
||||
Mod+C { center-column; }
|
||||
|
||||
// Finer width adjustments.
|
||||
// This command can also:
|
||||
// * set width in pixels: "1000"
|
||||
// * adjust width in pixels: "-5" or "+5"
|
||||
// * set width as a percentage of screen width: "25%"
|
||||
// * adjust width as a percentage of screen width: "-10%" or "+10%"
|
||||
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
||||
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
||||
Mod+Minus { set-column-width "-10%"; }
|
||||
Mod+Equal { set-column-width "+10%"; }
|
||||
|
||||
// Finer height adjustments when in column with other windows.
|
||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
||||
|
||||
// Actions to switch layouts.
|
||||
// Note: if you uncomment these, make sure you do NOT have
|
||||
// a matching layout switch hotkey configured in xkb options above.
|
||||
// Having both at once on the same hotkey will break the switching,
|
||||
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
|
||||
// Mod+Space { switch-layout "next"; }
|
||||
// Mod+Shift+Space { switch-layout "prev"; }
|
||||
|
||||
Print { screenshot; }
|
||||
Ctrl+Print { screenshot-screen; }
|
||||
Alt+Print { screenshot-window; }
|
||||
|
||||
// The quit action will show a confirmation dialog to avoid accidental exits.
|
||||
Mod+Shift+E { quit; }
|
||||
Ctrl+Alt+Delete { quit; }
|
||||
|
||||
// Powers off the monitors. To turn them back on, do any input like
|
||||
// moving the mouse or pressing any other key.
|
||||
Mod+Shift+P { power-off-monitors; }
|
||||
}
|
|
@ -3,32 +3,15 @@
|
|||
function usage {
|
||||
echo "countdown - exit after a certain amount of time has passed"
|
||||
echo " Usage:"
|
||||
echo " countdown <TIME> && command..."
|
||||
echo " countdown <SECONDS> && command..."
|
||||
echo
|
||||
echo " Examples:"
|
||||
echo ' countdown 120 && echo "Two minutes have elapsed!"'
|
||||
echo ' countdown 5m && echo "Five minutes have elapsed!"'
|
||||
echo ' countdown 10h && echo "Ten hours have elapsed!"'
|
||||
echo ' countdown 9d && echo "Nine days have elapsed!"'
|
||||
echo ' countdown 120 && echo "Two minutes has elapsed!"'
|
||||
}
|
||||
|
||||
[[ $# -lt 1 ]] && { printf "error: no SECONDS argument provided\n" >&2; usage; exit 1; }
|
||||
|
||||
t="$1"
|
||||
seconds="$(echo "$t" | tr -d -c 0-9)"
|
||||
if [[ $t =~ ^.*m$ ]]; then
|
||||
seconds=$((seconds * 60))
|
||||
fi
|
||||
|
||||
if [[ $t =~ ^.*h$ ]]; then
|
||||
seconds=$((seconds * 60 * 60))
|
||||
fi
|
||||
|
||||
if [[ $t =~ ^.*d$ ]]; then
|
||||
seconds=$((seconds * 60 * 60 * 24))
|
||||
fi
|
||||
|
||||
d=$(($(date +%s) + seconds));
|
||||
d=$(($(date +%s) + $1));
|
||||
printf 'Started at %s\n' "$(date)"
|
||||
|
||||
while [[ "$d" -ge "$(date +%s)" ]]; do
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
umask 0077
|
||||
SUBDIR="${2:-./}"
|
||||
mkdir -p "$NOTES_PATH/$SUBDIR"
|
||||
cd "$NOTES_PATH/$SUBDIR" || exit 1
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# spark
|
||||
# https://github.com/holman/spark
|
||||
#
|
||||
# Generates sparklines for a set of data.
|
||||
#
|
||||
# Here's a good web-based sparkline generator that was a bit of inspiration
|
||||
# for spark:
|
||||
#
|
||||
# https://datacollective.org/sparkblocks
|
||||
#
|
||||
# spark takes a comma-separated or space-separated list of data and then prints
|
||||
# a sparkline out of it.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# spark 1 5 22 13 53
|
||||
# # => ▁▁▃▂▇
|
||||
#
|
||||
# spark 0 30 55 80 33 150
|
||||
# # => ▁▂▃▅▂▇
|
||||
#
|
||||
# spark -h
|
||||
# # => Prints the spark help text.
|
||||
|
||||
# Generates sparklines.
|
||||
#
|
||||
# $1 - The data we'd like to graph.
|
||||
_echo()
|
||||
{
|
||||
if [ "X$1" = "X-n" ]; then
|
||||
shift
|
||||
printf "%s" "$*"
|
||||
else
|
||||
printf "%s\n" "$*"
|
||||
fi
|
||||
}
|
||||
|
||||
spark()
|
||||
{
|
||||
local n numbers=
|
||||
|
||||
# find min/max values
|
||||
local min=0xffffffff max=0
|
||||
|
||||
for n in ${@//,/ }
|
||||
do
|
||||
# on Linux (or with bash4) we could use `printf %.0f $n` here to
|
||||
# round the number but that doesn't work on OS X (bash3) nor does
|
||||
# `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off
|
||||
n=${n%.*}
|
||||
(( n < min )) && min=$n
|
||||
(( n > max )) && max=$n
|
||||
numbers=$numbers${numbers:+ }$n
|
||||
done
|
||||
|
||||
# print ticks
|
||||
local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
|
||||
|
||||
# use a high tick if data is constant
|
||||
(( min == max )) && ticks=(▅ ▆)
|
||||
|
||||
local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) ))
|
||||
(( f < 1 )) && f=1
|
||||
|
||||
for n in $numbers
|
||||
do
|
||||
_echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]}
|
||||
done
|
||||
_echo
|
||||
}
|
||||
|
||||
# If we're being sourced, don't worry about such things
|
||||
if [ "$BASH_SOURCE" == "$0" ]; then
|
||||
# Prints the help text for spark.
|
||||
help()
|
||||
{
|
||||
local spark=$(basename $0)
|
||||
cat <<EOF
|
||||
|
||||
USAGE:
|
||||
$spark [-h|--help] VALUE,...
|
||||
|
||||
EXAMPLES:
|
||||
$spark 1 5 22 13 53
|
||||
▁▁▃▂█
|
||||
$spark 0,30,55,80,33,150
|
||||
▁▂▃▄▂█
|
||||
echo 9 13 5 17 1 | $spark
|
||||
▄▆▂█▁
|
||||
EOF
|
||||
}
|
||||
|
||||
# show help for no arguments if stdin is a terminal
|
||||
if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ] || [ "$1" == '--help' ]
|
||||
then
|
||||
help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
spark ${@:-`cat`}
|
||||
fi
|
||||
|
||||
# source: https://github.com/holman/spark/commit/ab88ac6f8f33698f39ece2f109b1117ef39a68eb
|
||||
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (c) Zach Holman, https://zachholman.com
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
N todo
|
|
@ -1,27 +1,65 @@
|
|||
{
|
||||
style,
|
||||
colors,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
font,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./waybar.nix
|
||||
# ./mako.nix
|
||||
./swaylock.nix
|
||||
./linux-desktop.nix
|
||||
];
|
||||
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
xdg = {
|
||||
home.file."${config.xdg.configHome}/mako/config" = {
|
||||
enable = true;
|
||||
mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"x-scheme-handler/http" = "firefox.desktop";
|
||||
"x-scheme-handler/https" = "firefox.desktop";
|
||||
};
|
||||
};
|
||||
text = with colors.withHashPrefix; ''
|
||||
border-size=1
|
||||
max-visible=5
|
||||
default-timeout=15000
|
||||
font=Symbols Nerd Font ${toString font.size},${font.name} ${toString font.size}
|
||||
anchor=top-right
|
||||
|
||||
background-color=${bg}
|
||||
text-color=${text}
|
||||
border-color=${primary}
|
||||
progress-color=${primary}
|
||||
|
||||
[urgency=high]
|
||||
border-color=${urgent}
|
||||
|
||||
[urgency=high]
|
||||
background-color=${urgent}
|
||||
border-color=${urgent}
|
||||
text-color=${bg}
|
||||
'';
|
||||
};
|
||||
|
||||
home.file."${config.xdg.configHome}/tofi/config" = {
|
||||
enable = true;
|
||||
text = ''
|
||||
font = ${pkgs.iosevkaLyteTerm}/share/fonts/truetype/IosevkaLyteTerm-regular.ttf
|
||||
|
||||
text-color = #f8f8f8
|
||||
prompt-color = #f38ba8
|
||||
selection-color = #66d9ef
|
||||
background-color = #1e1e2e
|
||||
border-width = 4
|
||||
border-color = #66d9ef
|
||||
|
||||
fuzzy-match = true
|
||||
'';
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
/*
|
||||
TODO:
|
||||
TODO:
|
||||
+ Super+r should rotate the selected group of windows.
|
||||
+ Super+Control+{1-9} should control the size of the preselect space.
|
||||
+ Super+Shift+b should balance the size of all selected nodes.
|
||||
|
@ -42,17 +80,6 @@
|
|||
|
||||
systemd = {
|
||||
enable = true;
|
||||
variables = [
|
||||
"DISPLAY"
|
||||
"WAYLAND_DISPLAY"
|
||||
"SWAYSOCK"
|
||||
"XDG_CURRENT_DESKTOP"
|
||||
"XDG_SESSION_TYPE"
|
||||
"NIXOS_OZONE_WL"
|
||||
"XCURSOR_THEME"
|
||||
"XCURSOR_SIZE"
|
||||
"PATH"
|
||||
];
|
||||
};
|
||||
|
||||
# TODO: stuff is opening on workspace 10 (0?)
|
||||
|
@ -76,6 +103,12 @@
|
|||
*/
|
||||
];
|
||||
|
||||
output = {
|
||||
# "*" = {
|
||||
# background = "$HOME/.wallpaper fill";
|
||||
# };
|
||||
};
|
||||
|
||||
# TODO: popup_during_fullscreen smart
|
||||
focus = {
|
||||
wrapping = "no"; # maybe workspace?
|
||||
|
@ -100,11 +133,6 @@
|
|||
};
|
||||
|
||||
startup = [
|
||||
{command = "kdeconnect-indicator";}
|
||||
{command = "mako";}
|
||||
{
|
||||
command = "swaybg -i $HOME/.wallpaper";
|
||||
}
|
||||
{
|
||||
command = "swayosd-server";
|
||||
}
|
||||
|
@ -134,6 +162,7 @@
|
|||
"timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\" & maybe-good-morning &'"
|
||||
];
|
||||
}
|
||||
# {command = "mako";}
|
||||
# {command = "firefox";}
|
||||
# {command = "wezterm";}
|
||||
];
|
||||
|
@ -158,13 +187,13 @@
|
|||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_options = "ctrl:nocaps";
|
||||
repeat_delay = "180";
|
||||
repeat_rate = "100";
|
||||
repeat_delay = "200";
|
||||
repeat_rate = "60";
|
||||
};
|
||||
|
||||
"type:pointer" = {
|
||||
accel_profile = "flat";
|
||||
pointer_accel = "0.5";
|
||||
pointer_accel = "0";
|
||||
};
|
||||
|
||||
"type:touchpad" = {
|
||||
|
@ -188,7 +217,6 @@
|
|||
"${mod}+c" = "kill";
|
||||
"${mod}+shift+c" = "kill # TODO: kill -9?";
|
||||
"${mod}+alt+space" = "exec wofi --show drun";
|
||||
"${mod}" = "exec ${menu}";
|
||||
"${mod}+space" = "exec ${menu}";
|
||||
"${mod}+shift+s" = "exec clipshot";
|
||||
"${mod}+e" = "exec thunar";
|
||||
|
@ -266,54 +294,39 @@
|
|||
# TODO: this should also reset the horizontal and vertical gaps?
|
||||
"${mod}+control+equal" = "gaps inner current set 0";
|
||||
|
||||
"${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
|
||||
"${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
|
||||
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
|
||||
"XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
|
||||
"${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
|
||||
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
|
||||
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
|
||||
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120";
|
||||
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120";
|
||||
# "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
|
||||
# "XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
|
||||
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
|
||||
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
|
||||
# "XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
|
||||
# "XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
|
||||
|
||||
# "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
# "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
# "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
# "XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
|
||||
# "XF86MonBrightnessUp" = "exec brightnessctl set +10%";
|
||||
# "shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
|
||||
# "shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
|
||||
# "control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
|
||||
# "control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
|
||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
"--locked ${mod}+shift+v" = "exec swayosd-client --input-volume mute-toggle";
|
||||
"--locked ${mod}+F1" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"--locked XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
|
||||
"--locked XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
|
||||
"--locked XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
|
||||
"--locked XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle";
|
||||
"--locked XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
|
||||
"--locked XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
|
||||
"--locked control+XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||
"--locked control+XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||
"--locked XF86AudioPlay" = "exec playerctl play-pause";
|
||||
"--locked XF86AudioNext" = "exec playerctl next";
|
||||
"--locked XF86AudioPrev" = "exec playerctl previous";
|
||||
|
||||
/*
|
||||
"XF86MonBrightnessUp" = " exec swayosd-client --brightness 10";
|
||||
"XF86MonBrightnessDown" = "exec swayosd-client --brightness -10";
|
||||
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume 15";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume -15";
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise --max-volume 120";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower --max-volume 120";
|
||||
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume +10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
|
||||
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume -10 --device alsa_output.pci-0000_11_00.4.analog-stereo.monitor";
|
||||
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
|
||||
"XF86MonBrightnessUp" = "exec brightnessctl set +10%";
|
||||
"shift+XF86MonBrightnessDown" = "exec brightnessctl set 1%";
|
||||
"shift+XF86MonBrightnessUp" = "exec brightnessctl set 100%";
|
||||
"control+XF86MonBrightnessDown" = "exec brightnessctl set 1%-";
|
||||
"control+XF86MonBrightnessUp" = "exec brightnessctl set +1%";
|
||||
"${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
*/
|
||||
# "${mod}+shift+v" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
|
||||
"${mod}+control+shift+l" = "exec swaylock";
|
||||
|
||||
|
@ -321,7 +334,7 @@
|
|||
};
|
||||
assigns = {};
|
||||
bars = [];
|
||||
colors = with style.colors; {
|
||||
colors = with colors; {
|
||||
background = bg;
|
||||
focused = {
|
||||
background = bg;
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
{style, ...}: {
|
||||
{
|
||||
font,
|
||||
# colors,
|
||||
...
|
||||
}: {
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
color = "ffffffff";
|
||||
image = "~/.wallpaper";
|
||||
font = style.font.name;
|
||||
font = font.name;
|
||||
show-failed-attempts = true;
|
||||
ignore-empty-password = true;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
style,
|
||||
colors,
|
||||
font,
|
||||
...
|
||||
}: {
|
||||
programs.waybar = {
|
||||
|
@ -10,41 +10,38 @@
|
|||
"layer" = "top";
|
||||
"position" = "bottom";
|
||||
"output" = ["eDP-1" "DP-3"];
|
||||
"height" = 50;
|
||||
"modules-left" = [
|
||||
"idle_inhibitor"
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
"modules-center" = [];
|
||||
"height" = 32;
|
||||
"modules-left" = ["clock" "sway/window"];
|
||||
"modules-center" = ["sway/workspaces"];
|
||||
"modules-right" = [
|
||||
"privacy"
|
||||
"power-profiles-daemon"
|
||||
"mpris"
|
||||
## "disk"
|
||||
## TODO: will need a custom module for Disk IO
|
||||
|
||||
## "wireplumber" # pulseaudio module is more featureful
|
||||
"idle_inhibitor"
|
||||
"bluetooth"
|
||||
# "wireplumber",
|
||||
"pulseaudio"
|
||||
"network"
|
||||
# "network",
|
||||
"cpu"
|
||||
"memory"
|
||||
"temperature"
|
||||
# "temperature",
|
||||
"backlight"
|
||||
"battery"
|
||||
|
||||
"bluetooth"
|
||||
"tray"
|
||||
"clock"
|
||||
];
|
||||
"bluetooth" = {
|
||||
"format" = "<span></span>";
|
||||
"on-click" = "${pkgs.blueman}/bin/blueman-manager";
|
||||
};
|
||||
"wireplumber" = {
|
||||
"format" = "{volume}% {icon}";
|
||||
"on-click" = "helvum";
|
||||
"format" = "<span</span>";
|
||||
"format-connected" = "<span></span>";
|
||||
"format-connected-battery" = "<span></span>";
|
||||
# "format-device-preference" = [ "device1", "device2" ], # preference list deciding the displayed devic;
|
||||
"tooltip-format" = "{controller_alias}@{controller_address} ({num_connections} connected)";
|
||||
"tooltip-format-connected" = "{controller_alias}@{controller_address} ({num_connections} connected)\n{device_enumerate}";
|
||||
"tooltip-format-enumerate-connected" = "{device_alias}@{device_address}";
|
||||
"tooltip-format-enumerate-connected-battery" = "{device_alias}@{device_address} ( {device_battery_percentage}%)";
|
||||
};
|
||||
# "wireplumber" = ;
|
||||
# "format" = "{volume}% {icon}";
|
||||
# "format-muted" = "";
|
||||
# "on-click" = "helvum;
|
||||
# },
|
||||
"sway/workspaces" = {
|
||||
"disable-scroll" = false;
|
||||
"persistent_workspaces" = {
|
||||
|
@ -62,40 +59,31 @@
|
|||
"tray" = {
|
||||
"icon-size" = 24;
|
||||
"spacing" = 4;
|
||||
"show-passive-items" = true;
|
||||
};
|
||||
"clock" = {
|
||||
"interval" = 1;
|
||||
"format" = "{:%a %b %d\n%H:%M:%S}";
|
||||
"justify" = "center";
|
||||
"format" = "{:%a %b %d %H:%M:%S}";
|
||||
};
|
||||
"cpu" = {
|
||||
"format" = "{usage}%\nCPU";
|
||||
"format" = "{usage} <span></span>";
|
||||
"tooltip" = true;
|
||||
"interval" = 5;
|
||||
"justify" = "center";
|
||||
"interval" = 3;
|
||||
};
|
||||
"memory" = {
|
||||
"format" = "{}%\nRAM";
|
||||
"tooltip" = true;
|
||||
"interval" = 5;
|
||||
"justify" = "center";
|
||||
"format" = "{} ";
|
||||
};
|
||||
"temperature" = {
|
||||
/*
|
||||
"thermal-zone" = 2;
|
||||
"hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
"format-critical" = "{temperatureC}°C {icon}";
|
||||
*/
|
||||
# "thermal-zone" = 2;
|
||||
# "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
|
||||
"critical-threshold" = 80;
|
||||
"format" = "{temperatureC}\n°C";
|
||||
"justify" = "center";
|
||||
# "format-critical" = "{temperatureC}°C {icon}";
|
||||
"format" = "{temperatureC}°C {icon}";
|
||||
"format-icons" = ["" "" ""];
|
||||
};
|
||||
"backlight" = {
|
||||
# "device" = "acpi_video1";
|
||||
"format" = "{percent}%\n{icon}";
|
||||
"format" = "{percent}% {icon}";
|
||||
"format-icons" = ["" ""];
|
||||
"justify" = "center";
|
||||
};
|
||||
"battery" = {
|
||||
"states" = {
|
||||
|
@ -103,55 +91,55 @@
|
|||
"warning" = 30;
|
||||
"critical" = 1;
|
||||
};
|
||||
"tooltip-format" = "{timeTo}\n{power} watts\n{health}% health\n{cycles} cycles";
|
||||
"format" = "{icon}{capacity}%-\n{time}";
|
||||
"format-charging" = "{capacity}%+\n{time}";
|
||||
"format-plugged" = "{capacity}%=\n{time}";
|
||||
"format-alt" = "{capacity}%";
|
||||
"format" = "{capacity}% {time} {icon}";
|
||||
"format-charging" = "{capacity}% {time} ";
|
||||
"format-plugged" = "{capacity}% {time} ";
|
||||
"format-alt" = "{capacity}% {icon}";
|
||||
"format-good" = ""; # An empty format will hide the module
|
||||
"format-time" = "{H}:{m}";
|
||||
"justify" = "center";
|
||||
"format-full" = "";
|
||||
"format-icons" = ["" "" "" "" ""];
|
||||
};
|
||||
"network" = {
|
||||
"format-wifi" = "{bandwidthUpBits} up \n{bandwidthDownBits} down";
|
||||
"format-ethernet" = "{bandwidthUpBits} up \n{bandwidthDownBits} down";
|
||||
"format-linked" = "{bandwidthUpBits} up \n{bandwidthDownBits} down";
|
||||
"format-disconnected" = "No Network {icon}";
|
||||
"format-alt" = "{bandwidthUpBits} up \n{bandwidthDownBits} down";
|
||||
"interval" = 5;
|
||||
"justify" = "right";
|
||||
"format-wifi" = "{essid} ({signalStrength}%) ";
|
||||
"format-ethernet" = "{ifname}: {ipaddr}/{cidr} ";
|
||||
"format-linked" = "{ifname} (No IP) ";
|
||||
"format-disconnected" = "Disconnected ⚠";
|
||||
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
|
||||
};
|
||||
"mpris" = {
|
||||
"format" = "{title}\nby {artist}";
|
||||
"title-len" = 64;
|
||||
"artist-len" = 61;
|
||||
"justify" = "center";
|
||||
"format" = "{title} by {artist}";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
/*
|
||||
"scroll-step" = 1, # %, can be a floa;
|
||||
"format" = "{volume}% {icon} {format_source}";
|
||||
"format-muted" = " {format_source}";
|
||||
*/
|
||||
"format" = "{volume}%\n{format_source}";
|
||||
"format-muted" = "MUTE\n{format_source}";
|
||||
"format-bluetooth" = "{volume}%\n{format_source}";
|
||||
"format-bluetooth-muted" = "MUTE\n{format_source}";
|
||||
"format-source" = "MIC ON";
|
||||
"format-source-muted" = "MIC OFF";
|
||||
# "scroll-step" = 1, # %, can be a floa;
|
||||
"format" = "{volume} {icon} <span>{format_source}</span>";
|
||||
#"format" = "{volume}% {icon} {format_source}";
|
||||
#"format-bluetooth" = "{volume}% {icon} {format_source}";
|
||||
#"format-bluetooth-muted" = " {icon} {format_source}";
|
||||
#"format-muted" = " {format_source}";
|
||||
"format-muted" = " {format_source}";
|
||||
"format-source" = "";
|
||||
"format-source-muted" = "";
|
||||
"format-icons" = {
|
||||
"headphones" = "";
|
||||
"handsfree" = "";
|
||||
"headset" = "";
|
||||
"phone" = "";
|
||||
"portable" = "";
|
||||
"car" = "";
|
||||
"default" = ["" "" ""];
|
||||
};
|
||||
# TODO: toggle mute?
|
||||
"on-click" = "${pkgs.pavucontrol}/bin/pavucontrol";
|
||||
"justify" = "center";
|
||||
"on-click" = "pavucontrol";
|
||||
};
|
||||
};
|
||||
};
|
||||
style = let
|
||||
border-width = "0px";
|
||||
in
|
||||
with style.colors.withHashPrefix; ''
|
||||
with colors.withHashPrefix; ''
|
||||
* {
|
||||
border-radius: 0;
|
||||
font-family: "${style.font.name}", "Symbols Nerd Font Mono", sans-serif;
|
||||
font-family: "${font.name}", "Symbols Nerd Font Mono", sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
[colors]
|
||||
ansi = ["#45475a", "#f38ba8", "#a6e3a1", "#fab387", "#74c7ec", "#cba6f7", "#f9e2af", "#bac2de"]
|
||||
background = "#1e1e2e"
|
||||
brights = ["#585b70", "#f38ba8", "#a6e3a1", "#fab387", "#74c7ec", "#cba6f7", "#f9e2af", "#a6adc8"]
|
||||
compose_cursor = "#fab387"
|
||||
cursor_bg = "#cdd6f4"
|
||||
cursor_border = "#cdd6f4"
|
||||
cursor_fg = "#1e1e2e"
|
||||
foreground = "#cdd6f4"
|
||||
scrollbar_thumb = "#181825"
|
||||
selection_bg = "#f9e2af"
|
||||
selection_fg = "#1e1e2e"
|
||||
split = "#585b70"
|
||||
|
||||
[colors.tab_bar]
|
||||
background = "#313244"
|
||||
[colors.tab_bar.active_tab]
|
||||
bg_color = "#74c7ec"
|
||||
fg_color = "#1e1e2e"
|
||||
italic = false
|
||||
|
||||
[colors.tab_bar.inactive_tab]
|
||||
bg_color = "#181825"
|
||||
fg_color = "#6c7086"
|
||||
italic = false
|
||||
|
||||
[colors.tab_bar.inactive_tab_hover]
|
||||
bg_color = "#313244"
|
||||
fg_color = "#74c7ec"
|
||||
italic = false
|
||||
|
||||
[colors.tab_bar.new_tab]
|
||||
bg_color = "#181825"
|
||||
fg_color = "#6c7086"
|
||||
italic = false
|
||||
|
||||
[colors.tab_bar.new_tab_hover]
|
||||
bg_color = "#313244"
|
||||
fg_color = "#74c7ec"
|
||||
italic = false
|
149
modules/home-manager/wezterm/config.lua
Normal file
149
modules/home-manager/wezterm/config.lua
Normal file
|
@ -0,0 +1,149 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local config = {}
|
||||
if wezterm.config_builder then
|
||||
config = wezterm.config_builder()
|
||||
end
|
||||
|
||||
config.font = wezterm.font_with_fallback {
|
||||
{ family = "IosevkaLyteTerm", weight = 'Medium', italic = false },
|
||||
{ family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false },
|
||||
'Noto Color Emoji',
|
||||
}
|
||||
config.font_size = 12.0
|
||||
-- config.window_frame.font = config.font
|
||||
-- config.window_frame.font_size = font_size
|
||||
|
||||
config.default_cursor_style = 'BlinkingBar'
|
||||
-- config.disable_default_key_bindings = true
|
||||
config.hide_tab_bar_if_only_one_tab = true
|
||||
config.use_fancy_tab_bar = false
|
||||
config.tab_bar_at_bottom = true
|
||||
config.window_background_opacity = 1.0
|
||||
config.enable_kitty_keyboard = true
|
||||
config.show_new_tab_button_in_tab_bar = true
|
||||
|
||||
-- config.front_end = "WebGpu"
|
||||
|
||||
local function tab_title(tab_info)
|
||||
local title = tab_info.tab_title
|
||||
if title and #title > 0 then
|
||||
return title
|
||||
end
|
||||
return tab_info.active_pane.title
|
||||
end
|
||||
|
||||
-- wezterm.on('format-tab-title', function (tab, tabs, panes, config, hover, max_width)
|
||||
wezterm.on('format-tab-title', function(tab, _, _, _, _, max_width)
|
||||
local title = tab_title(tab)
|
||||
return ' ' .. string.sub(title, 0, max_width - 2) .. ' '
|
||||
end)
|
||||
|
||||
-- see nix module which has home manager create this color scheme file
|
||||
config.color_scheme = 'catppuccin-mocha-sapphire';
|
||||
|
||||
config.inactive_pane_hsb = {
|
||||
saturation = 0.8,
|
||||
brightness = 0.7,
|
||||
}
|
||||
|
||||
config.keys = {
|
||||
{
|
||||
key = 'Insert',
|
||||
mods = 'SHIFT',
|
||||
action = wezterm.action.PasteFrom 'Clipboard'
|
||||
},
|
||||
{
|
||||
key = 'v',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.PasteFrom 'PrimarySelection'
|
||||
},
|
||||
{
|
||||
key = 't',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.SpawnTab 'CurrentPaneDomain'
|
||||
},
|
||||
{
|
||||
key = 'h',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.ActivatePaneDirection 'Left'
|
||||
},
|
||||
{
|
||||
key = 'l',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.ActivatePaneDirection 'Right'
|
||||
},
|
||||
{
|
||||
key = 'k',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.ActivatePaneDirection 'Up'
|
||||
},
|
||||
{
|
||||
key = 'j',
|
||||
mods = 'CTRL',
|
||||
action = wezterm.action.ActivatePaneDirection 'Down'
|
||||
},
|
||||
{
|
||||
key = 'j',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }
|
||||
},
|
||||
{
|
||||
key = 'l',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }
|
||||
},
|
||||
{
|
||||
key = 'k',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.SplitVertical { args = { 'top' }, domain = 'CurrentPaneDomain' }
|
||||
},
|
||||
{
|
||||
key = 'h',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.SplitHorizontal { args = { 'right' }, domain = 'CurrentPaneDomain' }
|
||||
},
|
||||
{
|
||||
key = 'p',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.ActivateCommandPalette
|
||||
},
|
||||
{
|
||||
key = 'w',
|
||||
mods = 'CTRL|SHIFT',
|
||||
action = wezterm.action.CloseCurrentPane { confirm = true },
|
||||
},
|
||||
{
|
||||
key = 'w',
|
||||
mods = 'CTRL|ALT|SHIFT',
|
||||
action = wezterm.action.CloseCurrentTab { confirm = true },
|
||||
},
|
||||
{
|
||||
key = 'l',
|
||||
mods = 'CTRL|SHIFT|ALT',
|
||||
action = wezterm.action.ShowDebugOverlay
|
||||
},
|
||||
{
|
||||
key = 'r',
|
||||
mods = 'CTRL|SHIFT|ALT',
|
||||
action = wezterm.action.RotatePanes 'Clockwise'
|
||||
},
|
||||
}
|
||||
|
||||
-- config.unix_domains = {
|
||||
-- {
|
||||
-- name = 'unix',
|
||||
-- local_echo_threshold_ms = 10,
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- config.default_gui_startup_args = { 'connect', 'unix' }
|
||||
-- config.default_domain = 'unix'
|
||||
|
||||
config.window_padding = {
|
||||
top = '0.5cell',
|
||||
bottom = '0.5cell',
|
||||
left = '1cell',
|
||||
right = '1cell',
|
||||
}
|
||||
|
||||
return config
|
|
@ -1,167 +0,0 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local config = wezterm.config_builder()
|
||||
|
||||
config.adjust_window_size_when_changing_font_size = false
|
||||
|
||||
config.color_scheme = 'catppuccin-mocha-sapphire';
|
||||
config.font_size = 12.0
|
||||
config.font = wezterm.font_with_fallback {
|
||||
{ family = "IosevkaLyteTerm", weight = 'Medium', italic = false },
|
||||
{ family = 'Symbols Nerd Font Mono', weight = 'Regular', italic = false },
|
||||
'Noto Color Emoji',
|
||||
}
|
||||
|
||||
config.hide_tab_bar_if_only_one_tab = true
|
||||
config.use_fancy_tab_bar = false
|
||||
config.tab_bar_at_bottom = true
|
||||
config.notification_handling = "SuppressFromFocusedTab"
|
||||
-- config.window_decorations = "RESIZE"
|
||||
|
||||
local a = wezterm.action
|
||||
local s = { domain = 'CurrentPaneDomain' }
|
||||
local st = { domain = 'CurrentPaneDomain', args={'top'} }
|
||||
local sr = { domain = 'CurrentPaneDomain', args={'right'} }
|
||||
config.keys = {
|
||||
{ key = 'j', mods = 'CTRL|SHIFT', action = a.SplitVertical(s) },
|
||||
{ key = 'k', mods = 'CTRL|SHIFT', action = a.SplitVertical(st) },
|
||||
{ key = 'l', mods = 'CTRL|SHIFT', action = a.SplitHorizontal(s) },
|
||||
{ key = 'h', mods = 'CTRL|SHIFT', action = a.SplitHorizontal(sr) },
|
||||
{ key = 'j', mods = 'CTRL', action = a.ActivatePaneDirection'Down' },
|
||||
{ key = 'k', mods = 'CTRL', action = a.ActivatePaneDirection'Up' },
|
||||
{ key = 'l', mods = 'CTRL', action = a.ActivatePaneDirection'Right' },
|
||||
{ key = 'h', mods = 'CTRL', action = a.ActivatePaneDirection'Left' },
|
||||
{ key = 'w', mods = 'CTRL', action = a.CloseCurrentPane{confirm=true} },
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
-- config.window_background_opacity = 1.0
|
||||
-- config.enable_kitty_keyboard = true
|
||||
-- config.show_new_tab_button_in_tab_bar = true
|
||||
-- config.notification_handling = "SuppressFromFocusedTab"
|
||||
|
||||
-- config.front_end = "WebGpu"
|
||||
-- config.webgpu_power_preference = 'HighPerformance'
|
||||
-- config.enable_wayland = true
|
||||
-- config.use_ime = true
|
||||
|
||||
-- local function tab_title(tab_info)
|
||||
-- local title = tab_info.tab_title
|
||||
-- if title and #title > 0 then
|
||||
-- return title
|
||||
-- end
|
||||
-- return tab_info.active_pane.title
|
||||
-- end
|
||||
|
||||
-- wezterm.on('format-tab-title', function (tab, tabs, panes, config, hover, max_width)
|
||||
-- wezterm.on('format-tab-title', function(tab, _, _, _, _, max_width)
|
||||
-- local title = tab_title(tab)
|
||||
-- return ' ' .. string.sub(title, 0, max_width - 2) .. ' '
|
||||
-- end)
|
||||
|
||||
-- see nix module which has home manager create this color scheme file
|
||||
|
||||
-- config.inactive_pane_hsb = {
|
||||
-- saturation = 0.8,
|
||||
-- brightness = 0.7,
|
||||
-- }
|
||||
|
||||
-- config.keys = {
|
||||
-- {
|
||||
-- key = 'Insert',
|
||||
-- mods = 'SHIFT',
|
||||
-- action = wezterm.action.PasteFrom 'Clipboard'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'v',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.PasteFrom 'PrimarySelection'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 't',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.SpawnTab 'CurrentPaneDomain'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'h',
|
||||
-- mods = 'CTRL',
|
||||
-- action = wezterm.action.ActivatePaneDirection 'Left'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'l',
|
||||
-- mods = 'CTRL',
|
||||
-- action = wezterm.action.ActivatePaneDirection 'Right'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'k',
|
||||
-- mods = 'CTRL',
|
||||
-- action = wezterm.action.ActivatePaneDirection 'Up'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'j',
|
||||
-- mods = 'CTRL',
|
||||
-- action = wezterm.action.ActivatePaneDirection 'Down'
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'j',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'l',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'k',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.SplitVertical { args = { 'top' }, domain = 'CurrentPaneDomain' }
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'h',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.SplitHorizontal { args = { 'right' }, domain = 'CurrentPaneDomain' }
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'p',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.ActivateCommandPalette
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'w',
|
||||
-- mods = 'CTRL|SHIFT',
|
||||
-- action = wezterm.action.CloseCurrentPane { confirm = true },
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'w',
|
||||
-- mods = 'CTRL|ALT|SHIFT',
|
||||
-- action = wezterm.action.CloseCurrentTab { confirm = true },
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'l',
|
||||
-- mods = 'CTRL|SHIFT|ALT',
|
||||
-- action = wezterm.action.ShowDebugOverlay
|
||||
-- },
|
||||
-- {
|
||||
-- key = 'r',
|
||||
-- mods = 'CTRL|SHIFT|ALT',
|
||||
-- action = wezterm.action.RotatePanes 'Clockwise'
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- config.unix_domains = {
|
||||
-- {
|
||||
-- name = 'unix',
|
||||
-- local_echo_threshold_ms = 10,
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- config.default_gui_startup_args = { 'connect', 'unix' }
|
||||
-- config.default_domain = 'unix'
|
||||
|
||||
-- config.window_padding = {
|
||||
-- top = '0.5cell',
|
||||
-- bottom = '0.5cell',
|
||||
-- left = '1cell',
|
||||
-- right = '1cell',
|
||||
-- }
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
disko,
|
||||
sops-nix,
|
||||
style,
|
||||
colors,
|
||||
flakeInputs,
|
||||
homeManagerModules,
|
||||
home-manager,
|
||||
|
@ -11,173 +11,6 @@
|
|||
pubkey,
|
||||
overlays,
|
||||
}: {
|
||||
ewwbar = {pkgs, ...}: {
|
||||
# imports = with nixosModules; [];
|
||||
environment.systemPackages = with pkgs; [eww upower jq];
|
||||
|
||||
# TODO: include the home-manager modules for daniel?
|
||||
};
|
||||
|
||||
niri = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [niri];
|
||||
|
||||
systemd.user.services.polkit = {
|
||||
description = "PolicyKit Authentication Agent";
|
||||
wantedBy = ["niri.service"];
|
||||
after = ["graphical-session.target"];
|
||||
partOf = ["graphical-session.target"];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
programs.dconf.enable = pkgs.lib.mkDefault true;
|
||||
fonts.enableDefaultPackages = pkgs.lib.mkDefault true;
|
||||
security.polkit.enable = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
};
|
||||
|
||||
hyprland = {pkgs, ...}: {
|
||||
imports = with nixosModules; [
|
||||
ewwbar
|
||||
pipewire
|
||||
];
|
||||
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge netcat-openbsd];
|
||||
|
||||
programs.hyprland = {
|
||||
package = flakeInputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
};
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
hyprland
|
||||
];
|
||||
};
|
||||
|
||||
# TODO: include the home-manager modules for daniel?
|
||||
};
|
||||
|
||||
sway = {pkgs, ...}: {
|
||||
imports = with nixosModules; [
|
||||
pipewire
|
||||
];
|
||||
|
||||
systemd.user.services."wait-for-full-path" = {
|
||||
description = "wait for systemd units to have full PATH";
|
||||
wantedBy = ["xdg-desktop-portal.service"];
|
||||
before = ["xdg-desktop-portal.service"];
|
||||
path = with pkgs; [systemd coreutils gnugrep];
|
||||
script = ''
|
||||
ispresent () {
|
||||
systemctl --user show-environment | grep -E '^PATH=.*/.nix-profile/bin'
|
||||
}
|
||||
while ! ispresent; do
|
||||
sleep 0.1;
|
||||
done
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
TimeoutStartSec = "60";
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
sway
|
||||
];
|
||||
};
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
# TODO: a lot of this probably needs de-duping with hyprland?
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
# gtk.enable = true;
|
||||
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
|
||||
services.dbus.enable = true;
|
||||
security.polkit.enable = true; # needed for home-manager integration
|
||||
|
||||
programs.thunar = {
|
||||
enable = true;
|
||||
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
|
||||
};
|
||||
|
||||
services.gvfs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = {
|
||||
VISUAL = "hx";
|
||||
};
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
feh
|
||||
grim
|
||||
libinput
|
||||
libinput-gestures
|
||||
libnotify
|
||||
mako
|
||||
noto-fonts
|
||||
pamixer
|
||||
playerctl
|
||||
pulseaudio
|
||||
pulsemixer
|
||||
slurp
|
||||
swaybg
|
||||
swayidle
|
||||
swaylock
|
||||
swayosd
|
||||
tofi
|
||||
waybar
|
||||
wl-clipboard
|
||||
zathura
|
||||
|
||||
/*
|
||||
gimp
|
||||
inkscape
|
||||
krita
|
||||
lutris
|
||||
nil
|
||||
nixpkgs-fmt
|
||||
pavucontrol
|
||||
rclone
|
||||
restic
|
||||
steam
|
||||
vlc
|
||||
vulkan-tools
|
||||
weechat
|
||||
wine
|
||||
*/
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix;
|
||||
|
||||
fallback-hostname = {lib, ...}: {
|
||||
|
@ -221,9 +54,22 @@
|
|||
};
|
||||
};
|
||||
|
||||
less-pager = {pkgs, ...}: {
|
||||
environment = {
|
||||
systemPackages = [
|
||||
pkgs.less
|
||||
];
|
||||
variables = {
|
||||
PAGER = "less";
|
||||
MANPAGER = "less";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
helix-text-editor = {pkgs, ...}: {
|
||||
environment = {
|
||||
systemPackages = [
|
||||
pkgs.less
|
||||
helix.packages.${pkgs.system}.helix
|
||||
];
|
||||
variables = {
|
||||
|
@ -263,37 +109,28 @@
|
|||
|
||||
my-favorite-default-system-apps = {pkgs, ...}: {
|
||||
imports = with nixosModules; [
|
||||
less-pager
|
||||
helix-text-editor
|
||||
zellij-multiplexer
|
||||
fish-shell
|
||||
];
|
||||
|
||||
environment = {
|
||||
variables = {
|
||||
PAGER = "bat --style=plain";
|
||||
MANPAGER = "bat --style=plain";
|
||||
};
|
||||
systemPackages = with pkgs; [
|
||||
aria2
|
||||
curl
|
||||
dua
|
||||
bat
|
||||
eza
|
||||
fd
|
||||
file
|
||||
iputils
|
||||
nettools
|
||||
/*
|
||||
nodePackages.bash-language-server # just pull in as needed?
|
||||
shellcheck
|
||||
shfmt
|
||||
*/
|
||||
killall
|
||||
ripgrep
|
||||
rsync
|
||||
sd
|
||||
];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
dua
|
||||
eza # TODO: needs shell aliases
|
||||
fd
|
||||
file
|
||||
iputils
|
||||
nettools
|
||||
# nodePackages.bash-language-server # just pull in as needed?
|
||||
# shellcheck
|
||||
# shfmt
|
||||
killall
|
||||
ripgrep
|
||||
rsync
|
||||
sd
|
||||
];
|
||||
|
||||
programs = {
|
||||
traceroute.enable = true;
|
||||
|
@ -317,11 +154,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
/*
|
||||
https://nixos.wiki/wiki/Remote_disk_unlocking
|
||||
"When using DHCP, make sure your computer is always attached to the network and is able to get an IP adress, or the boot process will hang."
|
||||
^ seems less than ideal
|
||||
*/
|
||||
# https://nixos.wiki/wiki/Remote_disk_unlocking
|
||||
# "When using DHCP, make sure your computer is always attached to the network and is able to get an IP adress, or the boot process will hang."
|
||||
# ^ seems less than ideal
|
||||
boot.kernelParams = ["ip=dhcp"];
|
||||
boot.initrd = {
|
||||
# availableKernelModules = ["r8169"]; # ethernet drivers
|
||||
|
@ -351,26 +186,22 @@
|
|||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitRootLogin = lib.mkForce "prohibit-password";
|
||||
PermitRootLogin = "prohibit-password";
|
||||
};
|
||||
|
||||
openFirewall = lib.mkDefault true;
|
||||
|
||||
/*
|
||||
listenAddresses = [
|
||||
{ addr = "0.0.0.0"; port = 22; }
|
||||
];
|
||||
*/
|
||||
# listenAddresses = [
|
||||
# { addr = "0.0.0.0"; port = 22; }
|
||||
# ];
|
||||
};
|
||||
};
|
||||
|
||||
password-manager = {pkgs, ...}: {
|
||||
/*
|
||||
programs.goldwarden = {
|
||||
## NOTE: This didn't seem to work for me, but would be awesome! (but I can't remember why?)
|
||||
enable = true;
|
||||
};
|
||||
*/
|
||||
# programs.goldwarden = {
|
||||
# NOTE: This didn't seem to work for me, but would be awesome!
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
home-manager.users.daniel = {
|
||||
imports = with homeManagerModules; [
|
||||
|
@ -394,10 +225,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
cross-compiler = {config, ...}: {
|
||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "i686-linux"];
|
||||
};
|
||||
|
||||
default-nix-configuration-and-overlays = {
|
||||
lib,
|
||||
config,
|
||||
|
@ -420,14 +247,12 @@
|
|||
trusted-users = ["root" "daniel"];
|
||||
experimental-features = lib.mkDefault ["nix-command" "flakes"];
|
||||
|
||||
extra-platforms = ["i686-linux" "aarch64-linux"];
|
||||
|
||||
substituters = [
|
||||
# TODO: dedupe with flake's config? is that even necessary?
|
||||
"https://cache.nixos.org/"
|
||||
"https://helix.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nix.h.lyte.dev"
|
||||
# "https://nix.h.lyte.dev"
|
||||
"https://hyprland.cachix.org"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
|
@ -449,46 +274,10 @@
|
|||
wifi
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
acpi
|
||||
];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
|
||||
'';
|
||||
|
||||
services.upower.enable = true;
|
||||
|
||||
# NOTE: I previously let plasma settings handle this
|
||||
services.logind = {
|
||||
lidSwitch = "suspend-then-hibernate";
|
||||
extraConfig = ''
|
||||
KillUserProcesses=no
|
||||
HandlePowerKey=suspend
|
||||
HandlePowerKeyLongPress=poweroff
|
||||
HandleRebootKey=reboot
|
||||
HandleRebootKeyLongPress=poweroff
|
||||
HandleSuspendKey=suspend
|
||||
HandleSuspendKeyLongPress=hibernate
|
||||
HandleHibernateKey=hibernate
|
||||
HandleHibernateKeyLongPress=ignore
|
||||
HandleLidSwitch=suspend
|
||||
HandleLidSwitchExternalPower=suspend
|
||||
HandleLidSwitchDocked=suspend
|
||||
HandleLidSwitchDocked=suspend
|
||||
IdleActionSec=11m
|
||||
IdleAction=ignore
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
touchscreen = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
wvkbd # on-screen keyboard
|
||||
flakeInputs.iio-hyprland.outputs.packages.${system}.default # auto-rotate hyprland displays
|
||||
flakeInputs.hyprgrass.outputs.packages.${system}.hyprgrass # hyprland touch gestures
|
||||
];
|
||||
};
|
||||
|
||||
emacs = {pkgs, ...}: {
|
||||
|
@ -503,11 +292,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
development-tools = {
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
development-tools = {pkgs, ...}: {
|
||||
imports = with nixosModules; [
|
||||
postgres
|
||||
podman
|
||||
|
@ -518,20 +303,18 @@
|
|||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
/*
|
||||
plugins = [
|
||||
pkgs.vimPlugins.nvim-treesitter.withAllGrammars
|
||||
];
|
||||
*/
|
||||
# plugins = [
|
||||
# pkgs.vimPlugins.nvim-treesitter.withAllGrammars
|
||||
# ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
taplo # toml language server for editing helix configs per repo
|
||||
picocom # serial
|
||||
pgcli
|
||||
oils-for-unix
|
||||
oil
|
||||
watchexec
|
||||
android-tools
|
||||
kubectl
|
||||
stern
|
||||
libresprite
|
||||
# logseq
|
||||
|
@ -547,6 +330,7 @@
|
|||
nodePackages.yaml-language-server
|
||||
xh
|
||||
curl
|
||||
google-chrome
|
||||
];
|
||||
|
||||
hardware.gpgSmartcards.enable = true;
|
||||
|
@ -570,17 +354,6 @@
|
|||
yubico-piv-tool
|
||||
];
|
||||
|
||||
programs.direnv.mise = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.mise = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.thunderbird = {
|
||||
enable = true;
|
||||
|
||||
|
@ -597,7 +370,7 @@
|
|||
};
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = lib.mkDefault true;
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.k9s = {
|
||||
|
@ -612,6 +385,10 @@
|
|||
enable = true;
|
||||
};
|
||||
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
package = pkgs.btop.override {
|
||||
|
@ -623,8 +400,6 @@
|
|||
|
||||
troubleshooting-tools = {pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
comma
|
||||
iftop
|
||||
bottom
|
||||
btop
|
||||
dnsutils
|
||||
|
@ -636,7 +411,6 @@
|
|||
hexyl
|
||||
pkgs.unixtools.xxd
|
||||
usbutils
|
||||
comma
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -658,13 +432,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
android-dev = {pkgs, ...}: {
|
||||
services.udev.packages = [
|
||||
pkgs.android-udev-rules
|
||||
];
|
||||
environment.systemPackages = [pkgs.android-studio];
|
||||
};
|
||||
|
||||
graphical-workstation = {
|
||||
pkgs,
|
||||
lib,
|
||||
|
@ -673,31 +440,15 @@
|
|||
...
|
||||
}: {
|
||||
imports = with nixosModules; [
|
||||
sway
|
||||
hyprland
|
||||
plasma6
|
||||
enable-flatpaks-and-appimages
|
||||
fonts
|
||||
development-tools
|
||||
printing
|
||||
music-consumption
|
||||
kde-connect
|
||||
# plasma6
|
||||
video-tools
|
||||
radio-tools
|
||||
android-dev
|
||||
];
|
||||
|
||||
services.displayManager.sddm = {
|
||||
enable = false;
|
||||
package = lib.mkForce pkgs.kdePackages.sddm;
|
||||
settings = {};
|
||||
# theme = "";
|
||||
wayland = {
|
||||
enable = true;
|
||||
compositor = "weston";
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.enable = true;
|
||||
|
||||
hardware =
|
||||
|
@ -705,11 +456,8 @@
|
|||
then {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
/*
|
||||
driSupport32Bit = true;
|
||||
driSupport = true;
|
||||
*/
|
||||
# driSupport32Bit = true;
|
||||
# driSupport = true;
|
||||
};
|
||||
}
|
||||
else {
|
||||
|
@ -721,53 +469,33 @@
|
|||
};
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
firefox
|
||||
google-chrome
|
||||
libnotify
|
||||
slides
|
||||
slack
|
||||
discord
|
||||
];
|
||||
variables = {
|
||||
/*
|
||||
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
|
||||
GTK_USE_PORTAL = "1";
|
||||
*/
|
||||
# GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
|
||||
# GTK_USE_PORTAL = "1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# ewwbar = {};
|
||||
# gnome = {};
|
||||
# hyprland = {};
|
||||
# intel = {};
|
||||
|
||||
radio-tools = {pkgs, ...}: {
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
chirp
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
kde-connect = {
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
/*
|
||||
# handled by enabling
|
||||
networking.firewall = {
|
||||
allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
||||
allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
|
||||
};
|
||||
*/
|
||||
# networking.firewall = {
|
||||
# allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
|
||||
# allowedUDPPortRanges = [ { from = 1714; to = 1764; } ];
|
||||
# };
|
||||
};
|
||||
|
||||
fonts = {pkgs, ...}: {
|
||||
fonts.packages = [
|
||||
(
|
||||
# allow nixpkgs 24.11 and unstable to both work
|
||||
if builtins.hasAttr "nerd-fonts" pkgs
|
||||
then (pkgs.nerd-fonts.symbols-only)
|
||||
else (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||
)
|
||||
fonts.packages = with pkgs; [
|
||||
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||
pkgs.iosevkaLyteTerm
|
||||
];
|
||||
};
|
||||
|
@ -807,27 +535,24 @@
|
|||
maliit-framework
|
||||
|
||||
kdePackages.kate
|
||||
# kdePackages.kdenlive
|
||||
# kdePackages.merkuro
|
||||
kdePackages.kcalc
|
||||
# kdePackages.neochat
|
||||
kdePackages.filelight
|
||||
kdePackages.krdc
|
||||
kdePackages.krfb
|
||||
kdePackages.kclock
|
||||
kdePackages.kweather
|
||||
kdePackages.ktorrent
|
||||
# kdePackages.kdevelop
|
||||
# kdePackages.kdialog
|
||||
kdePackages.kdeplasma-addons
|
||||
|
||||
unstable-packages.kdePackages.krdp
|
||||
|
||||
/*
|
||||
kdePackages.kdenlive
|
||||
kdePackages.merkuro
|
||||
kdePackages.neochat
|
||||
kdePackages.kdevelop
|
||||
kdePackages.kdialog
|
||||
*/
|
||||
];
|
||||
|
||||
programs.gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-qt;
|
||||
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-tty;
|
||||
};
|
||||
|
||||
lutris = {pkgs, ...}: {
|
||||
|
@ -842,8 +567,8 @@
|
|||
|
||||
gaming = {pkgs, ...}: {
|
||||
imports = with nixosModules; [
|
||||
# lutris # use the flatpak
|
||||
steam # TODO: use the flatpak?
|
||||
lutris
|
||||
steam
|
||||
];
|
||||
|
||||
environment = {
|
||||
|
@ -905,56 +630,50 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
/*
|
||||
extraConfig.pipewire."92-low-latency" = {
|
||||
context.properties = {
|
||||
default.clock.rate = 48000;
|
||||
default.clock.quantum = 32;
|
||||
default.clock.min-quantum = 32;
|
||||
default.clock.max-quantum = 32;
|
||||
};
|
||||
};
|
||||
*/
|
||||
# extraConfig.pipewire."92-low-latency" = {
|
||||
# context.properties = {
|
||||
# default.clock.rate = 48000;
|
||||
# default.clock.quantum = 32;
|
||||
# default.clock.min-quantum = 32;
|
||||
# default.clock.max-quantum = 32;
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
# recommended by https://nixos.wiki/wiki/PipeWire
|
||||
security.rtkit.enable = true;
|
||||
|
||||
/*
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
# services.pipewire = {
|
||||
# enable = true;
|
||||
|
||||
wireplumber.enable = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
# wireplumber.enable = true;
|
||||
# pulse.enable = true;
|
||||
# jack.enable = true;
|
||||
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
};
|
||||
# alsa = {
|
||||
# enable = true;
|
||||
# support32Bit = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
hardware = {
|
||||
pulseaudio = {
|
||||
enable = false;
|
||||
support32Bit = true;
|
||||
};
|
||||
};
|
||||
# hardware = {
|
||||
# pulseaudio = {
|
||||
# enable = false;
|
||||
# support32Bit = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
security = {
|
||||
# I forget why I need these exactly...
|
||||
polkit.enable = true;
|
||||
# security = {
|
||||
# # I forget why I need these exactly...
|
||||
# polkit.enable = true;
|
||||
|
||||
rtkit.enable = true;
|
||||
};
|
||||
*/
|
||||
# rtkit.enable = true;
|
||||
# };
|
||||
};
|
||||
|
||||
music-production = {pkgs, ...}: {
|
||||
/*
|
||||
TODO: may want to force nixpkgs-stable for a more-stable music production
|
||||
environment?
|
||||
*/
|
||||
# TODO: may want to force nixpkgs-stable for a more-stable music production
|
||||
# environment?
|
||||
imports = [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
@ -965,12 +684,11 @@
|
|||
}
|
||||
];
|
||||
|
||||
/*
|
||||
TODO: things to look into for music production:
|
||||
- https://linuxmusicians.com/viewtopic.php?t=27016
|
||||
- KXStudio?
|
||||
- falktx (https://github.com/DISTRHO/Cardinal)
|
||||
*/
|
||||
# TODO: things to look into for music production:
|
||||
# - https://linuxmusicians.com/viewtopic.php?t=27016
|
||||
# - KXStudio?
|
||||
# - falktx (https://github.com/DISTRHO/Cardinal)
|
||||
# -
|
||||
};
|
||||
|
||||
podman = {pkgs, ...}: {
|
||||
|
@ -993,24 +711,6 @@
|
|||
backend = "podman";
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
extraHosts = ''
|
||||
127.0.0.1 host.docker.internal
|
||||
::1 host.docker.internal
|
||||
127.0.0.1 host.containers.internal
|
||||
::1 host.containers.internal
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
virtual-machines = {pkgs, ...}: {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
users.users.daniel.extraGroups = ["libvirtd"];
|
||||
};
|
||||
|
||||
virtual-machines-gui = {pkgs, ...}: {
|
||||
programs.virt-manager.enable = true;
|
||||
};
|
||||
|
||||
postgres = {pkgs, ...}: {
|
||||
|
@ -1071,6 +771,8 @@
|
|||
services.printing.drivers = [pkgs.gutenprint];
|
||||
};
|
||||
|
||||
sway = {};
|
||||
|
||||
enable-flatpaks-and-appimages = {
|
||||
services.flatpak.enable = true;
|
||||
programs.appimage.binfmt = true;
|
||||
|
@ -1079,51 +781,25 @@
|
|||
wifi = {lib, ...}: let
|
||||
inherit (lib) mkDefault;
|
||||
in {
|
||||
networking.networkmanager = {
|
||||
enable = mkDefault true;
|
||||
# ensureProfiles = {
|
||||
# profiles = {
|
||||
# home-wifi = {
|
||||
# id="home-wifi";
|
||||
# permissions = "";
|
||||
# type = "wifi";
|
||||
# };
|
||||
# wifi = {
|
||||
# ssid = "";
|
||||
# };
|
||||
# wifi-security = {
|
||||
# # auth-alg = "";
|
||||
# # key-mgmt = "";
|
||||
# psk = "";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
networking.networkmanager.enable = mkDefault true;
|
||||
systemd.services.NetworkManager-wait-online.enable = mkDefault false;
|
||||
|
||||
/*
|
||||
TODO: networking.networkmanager.wifi.backend = "iwd"; ?
|
||||
TODO: powersave?
|
||||
TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets?
|
||||
*/
|
||||
hardware.wirelessRegulatoryDatabase = true;
|
||||
boot.extraModprobeConfig = ''
|
||||
options cfg80211 ieee80211_regdom="US"
|
||||
'';
|
||||
# TODO: networking.networkmanager.wifi.backend = "iwd"; ?
|
||||
# TODO: powersave?
|
||||
# TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets?
|
||||
};
|
||||
|
||||
steam = {pkgs, ...}: {
|
||||
programs.gamescope.enable = true;
|
||||
# programs.gamescope.enable = true;
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
# extest.enable = true;
|
||||
# gamescopeSession.enable = true;
|
||||
|
||||
extest.enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
gamescope
|
||||
];
|
||||
# extraPackages = with pkgs; [
|
||||
# gamescope
|
||||
# ];
|
||||
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
|
@ -1141,10 +817,8 @@
|
|||
];
|
||||
|
||||
# remote play ports - should be unnecessary due to programs.steam.remotePlay.openFirewall = true;
|
||||
/*
|
||||
networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
|
||||
networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
|
||||
*/
|
||||
# networking.firewall.allowedUDPPortRanges = [ { from = 27031; to = 27036; } ];
|
||||
# networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
|
||||
};
|
||||
|
||||
root = {
|
||||
|
@ -1179,7 +853,7 @@
|
|||
createHome = true;
|
||||
openssh.authorizedKeys.keys = [pubkey];
|
||||
group = username;
|
||||
extraGroups = ["users" "wheel" "video" "dialout" "uucp" "kvm"];
|
||||
extraGroups = ["users" "wheel" "video" "dialout" "uucp"];
|
||||
packages = [];
|
||||
};
|
||||
home-manager.users.daniel = {
|
||||
|
@ -1276,51 +950,48 @@
|
|||
root
|
||||
];
|
||||
|
||||
# boot.tmp.useTmpfs = true;
|
||||
boot.tmp.useTmpfs = true;
|
||||
systemd.services.nix-daemon = {
|
||||
environment.TMPDIR = "/var/tmp";
|
||||
};
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
# boot.uki.tries = 3;
|
||||
# services.irqbalance.enable = true;
|
||||
services.irqbalance.enable = true;
|
||||
|
||||
# this is not ready for primetime yet
|
||||
# services.kanidm = {
|
||||
# enableClient = true;
|
||||
# enablePam = true;
|
||||
# package = pkgs.kanidm;
|
||||
services.kanidm = {
|
||||
enableClient = true;
|
||||
enablePam = true;
|
||||
package = pkgs.kanidm;
|
||||
|
||||
# clientSettings.uri = "https://idm.h.lyte.dev";
|
||||
# unixSettings = {
|
||||
# # hsm_pin_path = "/somewhere/else";
|
||||
# pam_allowed_login_groups = [];
|
||||
# };
|
||||
# };
|
||||
# systemd.tmpfiles.rules = [
|
||||
# "d /etc/kanidm 1755 nobody users -"
|
||||
# ];
|
||||
clientSettings.uri = "https://idm.h.lyte.dev";
|
||||
unixSettings = {
|
||||
# hsm_pin_path = "/somewhere/else";
|
||||
pam_allowed_login_groups = [];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /etc/kanidm 1755 nobody users -"
|
||||
];
|
||||
|
||||
# module has the incorrect file permissions out of the box
|
||||
# environment.etc = {
|
||||
/*
|
||||
"kanidm" = {
|
||||
enable = true;
|
||||
user = "nobody";
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
environment.etc = {
|
||||
# "kanidm" = {
|
||||
# enable = true;
|
||||
# user = "nobody";
|
||||
# group = "users";
|
||||
# mode = "0755";
|
||||
# };
|
||||
"kanidm/unixd" = {
|
||||
user = "kanidm-unixd";
|
||||
group = "kanidm-unixd";
|
||||
mode = "0700";
|
||||
};
|
||||
"kanidm/config" = {
|
||||
user = "nobody";
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
};
|
||||
};
|
||||
*/
|
||||
# "kanidm/unixd" = {
|
||||
# user = "kanidm-unixd";
|
||||
# group = "kanidm-unixd";
|
||||
# mode = "0700";
|
||||
# };
|
||||
# "kanidm/config" = {
|
||||
# user = "nobody";
|
||||
# group = "users";
|
||||
# mode = "0755";
|
||||
# };
|
||||
# };
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
|
@ -1328,7 +999,7 @@
|
|||
};
|
||||
|
||||
time = {
|
||||
timeZone = "America/Chicago";
|
||||
timeZone = lib.mkDefault "America/Chicago";
|
||||
};
|
||||
|
||||
i18n = {
|
||||
|
@ -1351,7 +1022,7 @@
|
|||
useXkbConfig = lib.mkDefault true;
|
||||
earlySetup = lib.mkDefault true;
|
||||
|
||||
colors = with style.colors; [
|
||||
colors = with colors; [
|
||||
bg
|
||||
red
|
||||
green
|
||||
|
@ -1379,6 +1050,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
system.stateVersion = lib.mkDefault "24.05";
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ in {
|
|||
requestTimeout = mkOption {
|
||||
type = types.int;
|
||||
description = "The maximum number of seconds before the HTTP request times out.";
|
||||
default = 180;
|
||||
default = 30;
|
||||
};
|
||||
afterBootTime = mkOption {
|
||||
type = types.str;
|
||||
|
@ -64,24 +64,18 @@ in {
|
|||
set -eu
|
||||
password="$(cat "${cfg.passwordFile}")"
|
||||
${optionalString cfg.ipv4 ''
|
||||
"${pkgs.curl}/bin/curl" -4 -s \
|
||||
-vvv \
|
||||
${pkgs.curl}/bin/curl -4 -s \
|
||||
-X POST \
|
||||
--max-time ${toString cfg.requestTimeout} \
|
||||
-u "${cfg.username}:''${password}" \
|
||||
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records" 2>&1 \
|
||||
| "${pkgs.sd}/bin/sd" --fixed-strings "''${password}" "[REDACTED]" \
|
||||
| "${pkgs.sd}/bin/sd" -f i "Authorization: .*" "Authorization: [REST OF LINE REDACTED]"
|
||||
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records"
|
||||
''}
|
||||
${optionalString cfg.ipv6 ''
|
||||
${pkgs.curl}/bin/curl -6 -s \
|
||||
-vvv \
|
||||
-X POST \
|
||||
--max-time ${toString cfg.requestTimeout} \
|
||||
-u "${cfg.username}:''${password}" \
|
||||
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records" 2>&1 \
|
||||
| "${pkgs.sd}/bin/sd" --fixed-strings "''${password}" "[REDACTED]" \
|
||||
| "${pkgs.sd}/bin/sd" -f i "Authorization: .*" "Authorization: [REST OF LINE REDACTED]"
|
||||
-L "${cfg.endpoint}/v1/netlify-ddns/replace-all-relevant-user-dns-records"
|
||||
''}
|
||||
'';
|
||||
serviceConfig = {
|
||||
|
|
3
modules/nixos/ewwbar.nix
Normal file
3
modules/nixos/ewwbar.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [eww upower jq];
|
||||
}
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
environment = {
|
||||
variables = {
|
||||
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
|
||||
VISUAL = "hx";
|
||||
PAGER = "less";
|
||||
MANPAGER = "less";
|
||||
|
@ -49,35 +50,36 @@
|
|||
gnome.gnome-power-manager
|
||||
brightnessctl
|
||||
feh
|
||||
# gimp
|
||||
grim
|
||||
# inkscape
|
||||
# krita
|
||||
libinput
|
||||
libinput-gestures
|
||||
libnotify
|
||||
# lutris
|
||||
# nil
|
||||
# nixpkgs-fmt
|
||||
noto-fonts
|
||||
pamixer
|
||||
# pavucontrol
|
||||
playerctl
|
||||
# pulseaudio
|
||||
pulsemixer
|
||||
# rclone
|
||||
# restic
|
||||
slurp
|
||||
# steam
|
||||
swaybg
|
||||
swayidle
|
||||
swaylock
|
||||
# vlc
|
||||
# vulkan-tools
|
||||
waybar
|
||||
# weechat
|
||||
# wine
|
||||
wl-clipboard
|
||||
zathura
|
||||
/*
|
||||
gimp
|
||||
inkscape
|
||||
krita
|
||||
pavucontrol
|
||||
pulseaudio
|
||||
rclone
|
||||
restic
|
||||
steam
|
||||
vlc
|
||||
vulkan-tools
|
||||
weechat
|
||||
wine
|
||||
*/
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
17
modules/nixos/hyprland.nix
Normal file
17
modules/nixos/hyprland.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./ewwbar.nix
|
||||
./pipewire.nix
|
||||
{
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
|
||||
};
|
||||
environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge socat];
|
||||
}
|
||||
];
|
||||
}
|
81
modules/nixos/sway.nix
Normal file
81
modules/nixos/sway.nix
Normal file
|
@ -0,0 +1,81 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./pipewire.nix
|
||||
];
|
||||
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-wlr
|
||||
];
|
||||
};
|
||||
|
||||
services.dbus.enable = true;
|
||||
|
||||
programs.thunar = {
|
||||
enable = true;
|
||||
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
|
||||
};
|
||||
|
||||
services.gvfs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
variables = {
|
||||
GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark";
|
||||
VISUAL = "hx";
|
||||
PAGER = "less";
|
||||
MANPAGER = "less";
|
||||
};
|
||||
|
||||
systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
feh
|
||||
# gimp
|
||||
grim
|
||||
# inkscape
|
||||
# krita
|
||||
libinput
|
||||
libinput-gestures
|
||||
libnotify
|
||||
# mako
|
||||
# lutris
|
||||
# nil
|
||||
# nixpkgs-fmt
|
||||
noto-fonts
|
||||
pamixer
|
||||
# pavucontrol
|
||||
playerctl
|
||||
pulseaudio
|
||||
pulsemixer
|
||||
# rclone
|
||||
# restic
|
||||
slurp
|
||||
# steam
|
||||
swaybg
|
||||
swayidle
|
||||
swaylock
|
||||
swayosd
|
||||
tofi
|
||||
# vlc
|
||||
# vulkan-tools
|
||||
waybar
|
||||
# weechat
|
||||
# wine
|
||||
wl-clipboard
|
||||
zathura
|
||||
];
|
||||
};
|
||||
}
|
2747
nixos/beefcake.nix
2747
nixos/beefcake.nix
File diff suppressed because it is too large
Load diff
|
@ -40,23 +40,21 @@
|
|||
};
|
||||
};
|
||||
|
||||
/*
|
||||
networking = {
|
||||
firewall = let
|
||||
terraria = 7777;
|
||||
stardew-valley = 24642;
|
||||
web-dev-lan = 18888;
|
||||
ports = [
|
||||
terraria
|
||||
stardew-valley
|
||||
web-dev-lan
|
||||
];
|
||||
in {
|
||||
allowedTCPPorts = ports;
|
||||
allowedUDPPorts = ports;
|
||||
};
|
||||
};
|
||||
*/
|
||||
# networking = {
|
||||
# firewall = let
|
||||
# terraria = 7777;
|
||||
# stardew-valley = 24642;
|
||||
# web-dev-lan = 18888;
|
||||
# ports = [
|
||||
# terraria
|
||||
# stardew-valley
|
||||
# web-dev-lan
|
||||
# ];
|
||||
# in {
|
||||
# allowedTCPPorts = ports;
|
||||
# allowedUDPPorts = ports;
|
||||
# };
|
||||
# };
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
radeontop
|
||||
|
@ -65,73 +63,69 @@
|
|||
];
|
||||
|
||||
home-manager.users.daniel = {
|
||||
/*
|
||||
slippi-launcher = {
|
||||
enable = true;
|
||||
# isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso";
|
||||
launchMeleeOnPlay = false;
|
||||
};
|
||||
*/
|
||||
# slippi-launcher = {
|
||||
# enable = true;
|
||||
# # isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso";
|
||||
# launchMeleeOnPlay = false;
|
||||
# };
|
||||
|
||||
# TODO: monitor config module?
|
||||
/*
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
env = [
|
||||
"EWW_BAR_MON,1"
|
||||
];
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
# "DP-2,3840x2160@60,-2160x0,1,transform,3"
|
||||
"DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
|
||||
## HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
|
||||
## "desc:LG Display 0x0521,3840x2160@120,0x0,1"
|
||||
## "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
|
||||
"DP-2,3840x2160@60,0x0,1.5,transform,1"
|
||||
];
|
||||
input = {
|
||||
force_no_accel = true;
|
||||
sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
|
||||
};
|
||||
};
|
||||
};
|
||||
# wayland.windowManager.hyprland = {
|
||||
# settings = {
|
||||
# env = [
|
||||
# "EWW_BAR_MON,1"
|
||||
# ];
|
||||
# # See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
# monitor = [
|
||||
# # "DP-2,3840x2160@60,-2160x0,1,transform,3"
|
||||
# "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
|
||||
# # HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
|
||||
# # "desc:LG Display 0x0521,3840x2160@120,0x0,1"
|
||||
# # "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
|
||||
# "DP-2,3840x2160@60,0x0,1.5,transform,1"
|
||||
# ];
|
||||
# input = {
|
||||
# force_no_accel = true;
|
||||
# sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
config = {
|
||||
output = {
|
||||
"GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
|
||||
mode = "3840x2160@120Hz";
|
||||
position = "${toString (builtins.ceil (2160 / 1.5))},0";
|
||||
};
|
||||
# wayland.windowManager.sway = {
|
||||
# config = {
|
||||
# output = {
|
||||
# "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
|
||||
# mode = "3840x2160@120Hz";
|
||||
# position = "${toString (builtins.ceil (2160 / 1.5))},0";
|
||||
# };
|
||||
|
||||
"Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# desktop left vertical monitor
|
||||
mode = "3840x2160@60Hz";
|
||||
transform = "90";
|
||||
scale = "1.5";
|
||||
position = "0,0";
|
||||
};
|
||||
};
|
||||
# "Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# # desktop left vertical monitor
|
||||
# mode = "3840x2160@60Hz";
|
||||
# transform = "90";
|
||||
# scale = "1.5";
|
||||
# position = "0,0";
|
||||
# };
|
||||
# };
|
||||
|
||||
workspaceOutputAssign =
|
||||
(
|
||||
map
|
||||
(ws: {
|
||||
output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
|
||||
workspace = toString ws;
|
||||
})
|
||||
(lib.range 1 7)
|
||||
)
|
||||
++ (
|
||||
map
|
||||
(ws: {
|
||||
output = "Dell Inc. DELL U2720Q D3TM623";
|
||||
workspace = toString ws;
|
||||
})
|
||||
(lib.range 8 9)
|
||||
);
|
||||
};
|
||||
};
|
||||
*/
|
||||
# workspaceOutputAssign =
|
||||
# (
|
||||
# map
|
||||
# (ws: {
|
||||
# output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
|
||||
# workspace = toString ws;
|
||||
# })
|
||||
# (lib.range 1 7)
|
||||
# )
|
||||
# ++ (
|
||||
# map
|
||||
# (ws: {
|
||||
# output = "Dell Inc. DELL U2720Q D3TM623";
|
||||
# workspace = toString ws;
|
||||
# })
|
||||
# (lib.range 8 9)
|
||||
# );
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
153
nixos/dragon.nix
153
nixos/dragon.nix
|
@ -6,39 +6,11 @@
|
|||
}: {
|
||||
imports = [
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
system.stateVersion = "24.05";
|
||||
home-manager.users.daniel.home.stateVersion = "24.05";
|
||||
networking.hostName = "dragon";
|
||||
}
|
||||
|
||||
{
|
||||
# sops secrets config
|
||||
sops = {
|
||||
defaultSopsFile = ../secrets/dragon/secrets.yml;
|
||||
age = {
|
||||
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||
keyFile = "/var/lib/sops-nix/key.txt";
|
||||
generateKey = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
sops.secrets = {
|
||||
ddns-pass = {mode = "0400";};
|
||||
};
|
||||
services.deno-netlify-ddns-client = {
|
||||
passwordFile = config.sops.secrets.ddns-pass.path;
|
||||
};
|
||||
}
|
||||
];
|
||||
hardware.amdgpu = {
|
||||
amdvlk = {
|
||||
enable = true;
|
||||
support32Bit = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
hardware.graphics.extraPackages = [
|
||||
# pkgs.rocmPackages.clr.icd
|
||||
pkgs.amdvlk
|
||||
|
@ -101,77 +73,62 @@
|
|||
};
|
||||
|
||||
# TODO: monitor config module?
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"eww open bar1"
|
||||
];
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
# "DP-2,3840x2160@60,-2160x0,1,transform,3"
|
||||
# "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
|
||||
"DP-3,3840x2160@120,0x0,1"
|
||||
# TODO: HDR breaks screenshare?
|
||||
/*
|
||||
"DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
|
||||
"desc:LG Display 0x0521,3840x2160@120,0x0,1"
|
||||
"desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
|
||||
*/
|
||||
"DP-2,3840x2160@60,3840x0,1.5,transform,3"
|
||||
];
|
||||
input = {
|
||||
force_no_accel = true;
|
||||
sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
|
||||
};
|
||||
workspace = [
|
||||
"1, monitor:DP-3, default:true"
|
||||
"2, monitor:DP-3, default:false"
|
||||
"3, monitor:DP-3, default:false"
|
||||
"4, monitor:DP-3, default:false"
|
||||
"5, monitor:DP-3, default:false"
|
||||
"6, monitor:DP-3, default:false"
|
||||
"7, monitor:DP-3, default:false"
|
||||
"8, monitor:DP-2, default:true"
|
||||
"9, monitor:DP-2, default:false"
|
||||
];
|
||||
};
|
||||
};
|
||||
# wayland.windowManager.hyprland = {
|
||||
# settings = {
|
||||
# env = [
|
||||
# "EWW_BAR_MON,1"
|
||||
# ];
|
||||
# # See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
# monitor = [
|
||||
# # "DP-2,3840x2160@60,-2160x0,1,transform,3"
|
||||
# "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1"
|
||||
# # HDR breaks screenshare? "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10"
|
||||
# # "desc:LG Display 0x0521,3840x2160@120,0x0,1"
|
||||
# # "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1"
|
||||
# "DP-2,3840x2160@60,0x0,1.5,transform,1"
|
||||
# ];
|
||||
# input = {
|
||||
# force_no_accel = true;
|
||||
# sensitivity = 1; # -1.0 - 1.0, 0 means no modification.
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
config = {
|
||||
output = {
|
||||
"GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
|
||||
mode = "3840x2160@120Hz";
|
||||
position = "${toString (builtins.ceil (2160 / 1.5))},0";
|
||||
};
|
||||
# wayland.windowManager.sway = {
|
||||
# config = {
|
||||
# output = {
|
||||
# "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = {
|
||||
# mode = "3840x2160@120Hz";
|
||||
# position = "${toString (builtins.ceil (2160 / 1.5))},0";
|
||||
# };
|
||||
|
||||
"Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# desktop left vertical monitor
|
||||
mode = "3840x2160@60Hz";
|
||||
transform = "270";
|
||||
scale = "1.5";
|
||||
position = "0,0";
|
||||
};
|
||||
};
|
||||
# "Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# # desktop left vertical monitor
|
||||
# mode = "3840x2160@60Hz";
|
||||
# transform = "90";
|
||||
# scale = "1.5";
|
||||
# position = "0,0";
|
||||
# };
|
||||
# };
|
||||
|
||||
workspaceOutputAssign =
|
||||
(
|
||||
map
|
||||
(ws: {
|
||||
output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
|
||||
workspace = toString ws;
|
||||
})
|
||||
(lib.range 1 7)
|
||||
)
|
||||
++ (
|
||||
map
|
||||
(ws: {
|
||||
output = "Dell Inc. DELL U2720Q D3TM623";
|
||||
workspace = toString ws;
|
||||
})
|
||||
(lib.range 8 9)
|
||||
);
|
||||
};
|
||||
};
|
||||
# workspaceOutputAssign =
|
||||
# (
|
||||
# map
|
||||
# (ws: {
|
||||
# output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307";
|
||||
# workspace = toString ws;
|
||||
# })
|
||||
# (lib.range 1 7)
|
||||
# )
|
||||
# ++ (
|
||||
# map
|
||||
# (ws: {
|
||||
# output = "Dell Inc. DELL U2720Q D3TM623";
|
||||
# workspace = toString ws;
|
||||
# })
|
||||
# (lib.range 8 9)
|
||||
# );
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"x86_64-linux": {
|
||||
"headless": {
|
||||
"stable": {
|
||||
"name": "factorio_headless_x64-2.0.15.tar.xz",
|
||||
"needsAuth": false,
|
||||
"sha256": "cLRBy4B4EaYFhsARBySMHY164EO9HyNnX8kk+6qlONg=",
|
||||
"tarDirectory": "x64",
|
||||
"url": "https://factorio.com/get-download/2.0.15/headless/linux64",
|
||||
"version": "2.0.15"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +1,42 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
home-manager.users.daniel.home.stateVersion = "24.11";
|
||||
system.stateVersion = "24.05";
|
||||
home-manager.users.daniel.home.stateVersion = "24.05";
|
||||
networking.hostName = "foxtrot";
|
||||
}
|
||||
{
|
||||
# laptop power management
|
||||
services.upower.enable = true;
|
||||
swapDevices = [
|
||||
# TODO: move this to disko?
|
||||
# NOTE(oninstall):
|
||||
/*
|
||||
sudo btrfs subvolume create /swap
|
||||
sudo btrfs filesystem mkswapfile --size 32g --uuid clear /swap/swapfile
|
||||
sudo swapon /swap/swapfile
|
||||
*/
|
||||
# sudo btrfs subvolume create /swap
|
||||
# sudo btrfs filesystem mkswapfile --size 32g --uuid clear /swap/swapfile
|
||||
# sudo swapon /swap/swapfile
|
||||
{device = "/swap/swapfile";}
|
||||
];
|
||||
# findmnt -no UUID -T /swap/swapfile
|
||||
# boot.resumeDevice = "/dev/disk/by-uuid/81c3354a-f629-4b6b-a249-7705aeb9f0d5";
|
||||
# systemd.sleep.extraConfig = "HibernateDelaySec=180m";
|
||||
boot.resumeDevice = "/dev/disk/by-uuid/81c3354a-f629-4b6b-a249-7705aeb9f0d5";
|
||||
systemd.sleep.extraConfig = "HibernateDelaySec=30m";
|
||||
services.fwupd.enable = true;
|
||||
services.fwupd.extraRemotes = ["lvfs-testing"];
|
||||
|
||||
# NOTE: I'm letting plasma settings handle this I guess?
|
||||
# services.logind = {
|
||||
# lidSwitch = "suspend-then-hibernate";
|
||||
# # HandleLidSwitchDocked=ignore
|
||||
# extraConfig = ''
|
||||
# HandlePowerKey=suspend-then-hibernate
|
||||
# IdleActionSec=10m
|
||||
# IdleAction=suspend-then-hibernate
|
||||
# '';
|
||||
# };
|
||||
}
|
||||
];
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
easyeffects
|
||||
godot_4
|
||||
fractal
|
||||
prismlauncher
|
||||
|
@ -45,95 +56,37 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.easyeffects = {
|
||||
enable = true;
|
||||
preset = "philonmetal";
|
||||
# clone from https://github.com/ceiphr/ee-framework-presets
|
||||
# then `cp *.json ~/.config/easyeffects/output`
|
||||
# TODO: nixify this
|
||||
};
|
||||
# wayland.windowManager.hyprland = {
|
||||
# settings = {
|
||||
# env = [
|
||||
# "EWW_BAR_MON,0"
|
||||
# ];
|
||||
# # See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
# monitor = [
|
||||
# "eDP-1,2256x1504@60,0x0,${toString scale}"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
programs.hyprlock.settings = {
|
||||
label = [
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 32;
|
||||
# wayland.windowManager.sway = {
|
||||
# config = {
|
||||
# output = {
|
||||
# "BOE 0x0BCA Unknown" = {
|
||||
# mode = "2256x1504@60Hz";
|
||||
# position = "0,0";
|
||||
# scale = toString scale;
|
||||
# };
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(255, 255, 255, 0.5)";
|
||||
|
||||
position = "0 -500";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = "cmd[update:30000] acpi";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
services.hypridle = let
|
||||
secondsPerMinute = 60;
|
||||
lockSeconds = 10 * secondsPerMinute;
|
||||
in {
|
||||
settings = {
|
||||
listener = [
|
||||
{
|
||||
timeout = lockSeconds + 55;
|
||||
on-timeout = ''systemctl suspend'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"eww open bar0"
|
||||
];
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
"eDP-1,2880x1920@120Hz,0x0,1.5"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
config = {
|
||||
output = {
|
||||
"BOE NE135A1M-NY1 Unknown" = {
|
||||
mode = "2880x1920@120Hz";
|
||||
position = "1092,2160";
|
||||
scale = toString (5 / 3);
|
||||
};
|
||||
|
||||
"Dell Inc. DELL U2720Q CWTM623" = {
|
||||
mode = "3840x2160@60Hz";
|
||||
position = "0,0";
|
||||
scale = toString 1.25;
|
||||
};
|
||||
|
||||
/*
|
||||
"BOE 0x0BCA Unknown" = {
|
||||
mode = "2256x1504@60Hz";
|
||||
position = "0,0";
|
||||
scale = toString scale;
|
||||
};
|
||||
|
||||
"Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# desktop left vertical monitor
|
||||
mode = "1920x1080@60Hz";
|
||||
# transform = "90";
|
||||
# scale = "1.5";
|
||||
position = "${toString (builtins.floor (2256 / scale))},0";
|
||||
};
|
||||
*/
|
||||
};
|
||||
};
|
||||
};
|
||||
# "Dell Inc. DELL U2720Q D3TM623" = {
|
||||
# # desktop left vertical monitor
|
||||
# mode = "1920x1080@60Hz";
|
||||
# # transform = "90";
|
||||
# # scale = "1.5";
|
||||
# position = "${toString (builtins.floor (2256 / scale))},0";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
hardware.graphics.extraPackages = [
|
||||
|
@ -145,59 +98,39 @@
|
|||
pkgs.vaapiVdpau
|
||||
];
|
||||
|
||||
hardware.amdgpu = {
|
||||
amdvlk = {
|
||||
enable = true;
|
||||
support32Bit = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.networkmanager.wifi.powersave = false;
|
||||
hardware.wirelessRegulatoryDatabase = true;
|
||||
|
||||
hardware.framework.amd-7040.preventWakeOnAC = true;
|
||||
|
||||
boot = {
|
||||
# kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# https://github.com/void-linux/void-packages/issues/50417#issuecomment-2131802836 fix framework 13 not shutting down
|
||||
/*
|
||||
kernelPatches = [
|
||||
{
|
||||
name = "framework13shutdownfix";
|
||||
patch = builtins.fetchurl {
|
||||
url = "https://github.com/void-linux/void-packages/files/15445612/0001-Add-hopefully-a-solution-for-shutdown-regression.PATCH";
|
||||
sha256 = "sha256:10zcnzy5hkam2cnxx441b978gzhvnqlcc49k7bpz9dc28xyjik50";
|
||||
};
|
||||
}
|
||||
];
|
||||
*/
|
||||
# kernelPatches = [
|
||||
# {
|
||||
# name = "framework13shutdownfix";
|
||||
# patch = builtins.fetchurl {
|
||||
# url = "https://github.com/void-linux/void-packages/files/15445612/0001-Add-hopefully-a-solution-for-shutdown-regression.PATCH";
|
||||
# sha256 = "sha256:10zcnzy5hkam2cnxx441b978gzhvnqlcc49k7bpz9dc28xyjik50";
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
extraEntries = {
|
||||
"arch.conf" = ''
|
||||
title Arch
|
||||
efi /efi/Arch/grubx64.efi
|
||||
'';
|
||||
};
|
||||
};
|
||||
systemd-boot.enable = true;
|
||||
};
|
||||
|
||||
# NOTE(oninstall):
|
||||
/*
|
||||
sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
|
||||
the above won't work for btrfs, instead you need btrfs inspect-internal map-swapfile -r /swap/swapfile
|
||||
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
|
||||
many of these come from https://wiki.archlinux.org/title/Framework_Laptop_13#Suspend
|
||||
*/
|
||||
# sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
|
||||
# the above won't work for btrfs, instead you need
|
||||
# btrfs inspect-internal map-swapfile -r /swap/swapfile
|
||||
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
|
||||
# many of these come from https://wiki.archlinux.org/title/Framework_Laptop_13#Suspend
|
||||
kernelParams = [
|
||||
"rtc_cmos.use_acpi_alarm=1"
|
||||
"amdgpu.sg_display=0"
|
||||
"boot.shell_on_fail=1"
|
||||
"acpi_osi=\"!Windows 2020\""
|
||||
|
||||
# "nvme.noacpi=1" # maybe causing crashes upon waking?
|
||||
|
@ -207,41 +140,28 @@
|
|||
];
|
||||
initrd.availableKernelModules = ["xhci_pci" "nvme" "thunderbolt"];
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModprobeConfig = ''
|
||||
options cfg80211 ieee80211_regdom="US"
|
||||
'';
|
||||
};
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
# TODO: when resuming from hibernation, it would be nice if this would
|
||||
# simply resume the power state at the time of hibernation
|
||||
powerOnBoot = false;
|
||||
|
||||
package = pkgs.bluez.overrideAttrs (finalAttrs: previousAttrs: rec {
|
||||
version = "5.78";
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://kernel/linux/bluetooth/bluez-${version}.tar.xz";
|
||||
sha256 = "sha256-gw/tGRXF03W43g9eb0X83qDcxf9f+z0x227Q8A1zxeM=";
|
||||
};
|
||||
patches = [];
|
||||
buildInputs =
|
||||
previousAttrs.buildInputs
|
||||
++ [
|
||||
pkgs.python3Packages.pygments
|
||||
];
|
||||
});
|
||||
};
|
||||
powerManagement.cpuFreqGovernor = "ondemand";
|
||||
/*
|
||||
powerManagement.resumeCommands = ''
|
||||
modprobe -rv mt7921e
|
||||
modprobe -v mt7921e
|
||||
'';
|
||||
*/
|
||||
# powerManagement.resumeCommands = ''
|
||||
# modprobe -rv mt7921e
|
||||
# modprobe -v mt7921e
|
||||
# '';
|
||||
|
||||
services.power-profiles-daemon = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.fprintd = {
|
||||
enable = false;
|
||||
enable = true;
|
||||
package = pkgs.fprintd.overrideAttrs {
|
||||
# Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f
|
||||
mesonCheckFlags = [
|
||||
|
@ -250,40 +170,36 @@
|
|||
"fprintd:TestPamFprintd"
|
||||
];
|
||||
};
|
||||
# tod.enable = true;
|
||||
# tod.driver = pkgs.libfprint-2-tod1-goodix;
|
||||
};
|
||||
|
||||
/*
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "ondemand";
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 80;
|
||||
# services.tlp = {
|
||||
# enable = true;
|
||||
# settings = {
|
||||
# CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
# CPU_SCALING_GOVERNOR_ON_BAT = "ondemand";
|
||||
# CPU_MIN_PERF_ON_BAT = 0;
|
||||
# CPU_MAX_PERF_ON_BAT = 80;
|
||||
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
};
|
||||
};
|
||||
*/
|
||||
# CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
# CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
# CPU_MIN_PERF_ON_AC = 0;
|
||||
# CPU_MAX_PERF_ON_AC = 100;
|
||||
# };
|
||||
# };
|
||||
|
||||
networking.firewall.allowedTCPPorts = let
|
||||
stardewValley = 24642;
|
||||
factorio = 34197;
|
||||
in [
|
||||
8000 # dev stuff
|
||||
factorio
|
||||
stardewValley
|
||||
7777
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = let
|
||||
stardewValley = 24642;
|
||||
factorio = 34197;
|
||||
in [
|
||||
8000 # dev stuff
|
||||
factorio
|
||||
stardewValley
|
||||
7777
|
||||
];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
|
|
|
@ -58,19 +58,15 @@
|
|||
hardware.raspberry-pi."4".audio.enable = true;
|
||||
|
||||
nixpkgs.overlays = [
|
||||
/*
|
||||
nixos-22.05
|
||||
(self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; })
|
||||
nixos-22.11
|
||||
(self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};})
|
||||
*/
|
||||
# nixos-22.05
|
||||
# (self: super: { libcec = super.libcec.override { inherit (self) libraspberrypi; }; })
|
||||
# nixos-22.11
|
||||
# (self: super: {libcec = super.libcec.override {withLibraspberrypi = true;};})
|
||||
];
|
||||
|
||||
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
|
||||
/*
|
||||
systemd.services."getty@tty1".enable = false;
|
||||
systemd.services."autovt@tty1".enable = false;
|
||||
*/
|
||||
# systemd.services."getty@tty1".enable = false;
|
||||
# systemd.services."autovt@tty1".enable = false;
|
||||
|
||||
# hardware
|
||||
systemd.targets.sleep.enable = false;
|
||||
|
@ -103,40 +99,38 @@
|
|||
};
|
||||
};
|
||||
|
||||
/*
|
||||
services.udev.extraRules = ''
|
||||
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
|
||||
SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
|
||||
'';
|
||||
# services.udev.extraRules = ''
|
||||
# # allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
|
||||
# SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
|
||||
# '';
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
# powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
||||
optional: attach a persisted cec-client to `/run/cec.fifo`, to avoid the CEC ~1s startup delay per command
|
||||
scan for devices: `echo 'scan' > /run/cec.fifo ; journalctl -u cec-client.service`
|
||||
set pi as active source: `echo 'as' > /run/cec.fifo`
|
||||
systemd.sockets."cec-client" = {
|
||||
after = ["dev-vchiq.device"];
|
||||
bindsTo = ["dev-vchiq.device"];
|
||||
wantedBy = ["sockets.target"];
|
||||
socketConfig = {
|
||||
ListenFIFO = "/run/cec.fifo";
|
||||
SocketGroup = "video";
|
||||
SocketMode = "0660";
|
||||
};
|
||||
};
|
||||
systemd.services."cec-client" = {
|
||||
after = ["dev-vchiq.device"];
|
||||
bindsTo = ["dev-vchiq.device"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
|
||||
ExecStop = ''/bin/sh -c "echo q > /run/cec.fifo"'';
|
||||
StandardInput = "socket";
|
||||
StandardOutput = "journal";
|
||||
Restart = "no";
|
||||
};
|
||||
};
|
||||
*/
|
||||
# optional: attach a persisted cec-client to `/run/cec.fifo`, to avoid the CEC ~1s startup delay per command
|
||||
# scan for devices: `echo 'scan' > /run/cec.fifo ; journalctl -u cec-client.service`
|
||||
# set pi as active source: `echo 'as' > /run/cec.fifo`
|
||||
# systemd.sockets."cec-client" = {
|
||||
# after = ["dev-vchiq.device"];
|
||||
# bindsTo = ["dev-vchiq.device"];
|
||||
# wantedBy = ["sockets.target"];
|
||||
# socketConfig = {
|
||||
# ListenFIFO = "/run/cec.fifo";
|
||||
# SocketGroup = "video";
|
||||
# SocketMode = "0660";
|
||||
# };
|
||||
# };
|
||||
# systemd.services."cec-client" = {
|
||||
# after = ["dev-vchiq.device"];
|
||||
# bindsTo = ["dev-vchiq.device"];
|
||||
# wantedBy = ["multi-user.target"];
|
||||
# serviceConfig = {
|
||||
# ExecStart = ''${pkgs.libcec}/bin/cec-client -d 1'';
|
||||
# ExecStop = ''/bin/sh -c "echo q > /run/cec.fifo"'';
|
||||
# StandardInput = "socket";
|
||||
# StandardOutput = "journal";
|
||||
# Restart = "no";
|
||||
# };
|
||||
# };
|
||||
|
||||
hardware.graphics.driSupport32Bit = lib.mkForce false;
|
||||
|
||||
|
|
|
@ -25,14 +25,11 @@
|
|||
device = "/dev/sda";
|
||||
};
|
||||
|
||||
users.groups.beefcake = {};
|
||||
users.users = {
|
||||
beefcake = {
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
home = "/storage/backups/beefcake";
|
||||
group = "beefcake";
|
||||
extraGroups = ["sftponly"];
|
||||
# used for restic backups
|
||||
# TODO: can this be a system user?
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keys =
|
||||
config.users.users.daniel.openssh.authorizedKeys.keys
|
||||
++ [
|
||||
|
@ -55,13 +52,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
services.openssh.extraConfig = ''
|
||||
Match Group sftponly
|
||||
ChrootDirectory /storage/backups/%u
|
||||
ForceCommand internal-sftp
|
||||
AllowTcpForwarding no
|
||||
'';
|
||||
|
||||
networking = {
|
||||
hostName = "rascal";
|
||||
networkmanager.enable = true;
|
||||
|
|
663
nixos/router.nix
663
nixos/router.nix
|
@ -1,19 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
# outputs,
|
||||
# config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
/*
|
||||
NOTE: My goal is to be able to apply most of the common tweaks to the router
|
||||
either live on the system for ad-hoc changes (such as forwarding a port for a
|
||||
multiplayer game) or to tweak these values just below without reaching deeper
|
||||
into the modules' implementation of these configuration values
|
||||
NOTE: I could turn this into a cool NixOS module?
|
||||
TODO: review https://francis.begyn.be/blog/nixos-home-router
|
||||
TODO: more recent: https://github.com/ghostbuster91/blogposts/blob/a2374f0039f8cdf4faddeaaa0347661ffc2ec7cf/router2023-part2/main.md
|
||||
*/
|
||||
# NOTE: My goal is to be able to apply most of the common tweaks to the router
|
||||
# either live on the system for ad-hoc changes (such as forwarding a port for a
|
||||
# multiplayer game) or to tweak these values just below without reaching deeper
|
||||
# into the modules' implementation of these configuration values
|
||||
# NOTE: I could turn this into a cool NixOS module?
|
||||
# TODO: review https://francis.begyn.be/blog/nixos-home-router
|
||||
# TODO: more recent: https://github.com/ghostbuster91/blogposts/blob/a2374f0039f8cdf4faddeaaa0347661ffc2ec7cf/router2023-part2/main.md
|
||||
hostname = "router";
|
||||
domain = "h.lyte.dev";
|
||||
ip = "192.168.0.1";
|
||||
|
@ -47,22 +45,17 @@
|
|||
ip = "192.168.0.9";
|
||||
additionalHosts = [
|
||||
".beefcake.lan"
|
||||
"a.lyte.dev"
|
||||
"atuin.h.lyte.dev"
|
||||
"nix.h.lyte.dev"
|
||||
"idm.h.lyte.dev"
|
||||
"git.lyte.dev"
|
||||
"video.lyte.dev"
|
||||
"audio.lyte.dev"
|
||||
"a.lyte.dev"
|
||||
"bw.lyte.dev"
|
||||
"files.lyte.dev"
|
||||
"finances.h.lyte.dev"
|
||||
"git.lyte.dev"
|
||||
"grafana.h.lyte.dev"
|
||||
"idm.h.lyte.dev"
|
||||
"nextcloud.h.lyte.dev"
|
||||
"nix.h.lyte.dev"
|
||||
"onlyoffice.h.lyte.dev"
|
||||
"paperless.h.lyte.dev"
|
||||
"prometheus.h.lyte.dev"
|
||||
"video.lyte.dev"
|
||||
"vpn.h.lyte.dev"
|
||||
"atuin.h.lyte.dev"
|
||||
"a.lyte.dev"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
@ -103,25 +96,6 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
iftop
|
||||
];
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = ../secrets/router/secrets.yml;
|
||||
age = {
|
||||
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
|
||||
keyFile = "/var/lib/sops-nix/key.txt";
|
||||
generateKey = true;
|
||||
};
|
||||
secrets = {
|
||||
netlify-ddns-password = {mode = "0400";};
|
||||
};
|
||||
};
|
||||
services.deno-netlify-ddns-client = {
|
||||
passwordFile = config.sops.secrets.netlify-ddns-password.path;
|
||||
};
|
||||
|
||||
boot.kernel.sysctl =
|
||||
sysctl-entries
|
||||
// {
|
||||
|
@ -161,25 +135,24 @@ in {
|
|||
in {
|
||||
enable = true;
|
||||
checkRuleset = true;
|
||||
flushRuleset = true;
|
||||
ruleset = with inf; ''
|
||||
table inet filter {
|
||||
## set LANv4 {
|
||||
## type ipv4_addr
|
||||
## flags interval
|
||||
## elements = { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
|
||||
## }
|
||||
## set LANv6 {
|
||||
## type ipv6_addr
|
||||
## flags interval
|
||||
## elements = { fd00::/8, fe80::/10 }
|
||||
## }
|
||||
## TODO: maybe tailnet?
|
||||
# set LANv4 {
|
||||
# type ipv4_addr
|
||||
# flags interval
|
||||
# elements = { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 }
|
||||
# }
|
||||
# set LANv6 {
|
||||
# type ipv6_addr
|
||||
# flags interval
|
||||
# elements = { fd00::/8, fe80::/10 }
|
||||
# }
|
||||
# TODO: maybe tailnet?
|
||||
|
||||
## chain my_input_lan {
|
||||
## udp sport 1900 udp dport >= 1024 meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply"
|
||||
## udp sport netbios-ns udp dport >= 1024 meta pkttype unicast accept comment "Accept Samba Workgroup browsing replies"
|
||||
## }
|
||||
# chain my_input_lan {
|
||||
# udp sport 1900 udp dport >= 1024 meta pkttype unicast limit rate 4/second burst 20 packets accept comment "Accept UPnP IGD port mapping reply"
|
||||
# udp sport netbios-ns udp dport >= 1024 meta pkttype unicast accept comment "Accept Samba Workgroup browsing replies"
|
||||
# }
|
||||
|
||||
chain input {
|
||||
type filter hook input priority 0; policy drop;
|
||||
|
@ -214,13 +187,12 @@ in {
|
|||
udp dport { 80, 443 } accept comment "Allow QUIC to server (see nat prerouting)"
|
||||
tcp dport { 22 } accept comment "Allow SSH to server (see nat prerouting)"
|
||||
tcp dport { 25565 } accept comment "Allow Minecraft server connections (see nat prerouting)"
|
||||
udp dport { 34197 } accept comment "Allow Factorio server connections (see nat prerouting)"
|
||||
|
||||
iifname "${lan}" accept comment "Allow local network to access the router"
|
||||
iifname "tailscale0" accept comment "Allow local network to access the router"
|
||||
|
||||
## ip6 saddr @LANv6 jump my_input_lan comment "Connections from private IP address ranges"
|
||||
## ip saddr @LANv4 jump my_input_lan comment "Connections from private IP address ranges"
|
||||
# ip6 saddr @LANv6 jump my_input_lan comment "Connections from private IP address ranges"
|
||||
# ip saddr @LANv4 jump my_input_lan comment "Connections from private IP address ranges"
|
||||
|
||||
iifname "${wan}" counter drop comment "Drop all other unsolicited traffic from wan"
|
||||
}
|
||||
|
@ -235,13 +207,13 @@ in {
|
|||
accept
|
||||
}
|
||||
|
||||
## chain forward {
|
||||
## type filter hook forward priority filter; policy drop;
|
||||
# chain forward {
|
||||
# type filter hook forward priority filter; policy drop;
|
||||
|
||||
## iifname { "${lan}" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
|
||||
## iifname { "tailscale0" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
|
||||
## iifname { "${wan}" } oifname { "${lan}" } ct state { established, related } accept comment "Allow established back to LAN"
|
||||
## }
|
||||
# iifname { "${lan}" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
|
||||
# iifname { "tailscale0" } oifname { "${wan}" } accept comment "Allow trusted LAN to WAN"
|
||||
# iifname { "${wan}" } oifname { "${lan}" } ct state { established, related } accept comment "Allow established back to LAN"
|
||||
# }
|
||||
}
|
||||
|
||||
table ip nat {
|
||||
|
@ -257,7 +229,6 @@ in {
|
|||
iifname ${wan} tcp dport {26966} dnat to ${hosts.beefcake.ip}
|
||||
iifname ${wan} tcp dport {25565} dnat to ${hosts.bald.ip}
|
||||
iifname ${wan} udp dport {25565} dnat to ${hosts.bald.ip}
|
||||
iifname ${wan} udp dport {34197} dnat to ${hosts.beefcake.ip}
|
||||
}
|
||||
|
||||
chain postrouting {
|
||||
|
@ -269,58 +240,56 @@ in {
|
|||
};
|
||||
|
||||
# NOTE: see flake.nix 'nnf.nixosModules.default'
|
||||
/*
|
||||
nftables.firewall = let
|
||||
me = config.networking.nftables.firewall.localZoneName;
|
||||
in {
|
||||
enable = true;
|
||||
snippets.nnf-common.enable = true;
|
||||
# nftables.firewall = let
|
||||
# me = config.networking.nftables.firewall.localZoneName;
|
||||
# in {
|
||||
# enable = true;
|
||||
# snippets.nnf-common.enable = true;
|
||||
|
||||
zones = {
|
||||
${interfaces.wan.name} = {
|
||||
interfaces = [interfaces.wan.name interfaces.lan.name];
|
||||
};
|
||||
${interfaces.lan.name} = {
|
||||
parent = interfaces.wan.name;
|
||||
ipv4Addresses = [cidr];
|
||||
};
|
||||
## banned = {
|
||||
## ingressExpression = [
|
||||
## "ip saddr @banlist"
|
||||
## "ip6 saddr @banlist6"
|
||||
## ];
|
||||
## egressExpression = [
|
||||
## "ip daddr @banlist"
|
||||
## "ip6 daddr @banlist6"
|
||||
## ];
|
||||
## };
|
||||
};
|
||||
# zones = {
|
||||
# ${interfaces.wan.name} = {
|
||||
# interfaces = [interfaces.wan.name interfaces.lan.name];
|
||||
# };
|
||||
# ${interfaces.lan.name} = {
|
||||
# parent = interfaces.wan.name;
|
||||
# ipv4Addresses = [cidr];
|
||||
# };
|
||||
# # banned = {
|
||||
# # ingressExpression = [
|
||||
# # "ip saddr @banlist"
|
||||
# # "ip6 saddr @banlist6"
|
||||
# # ];
|
||||
# # egressExpression = [
|
||||
# # "ip daddr @banlist"
|
||||
# # "ip6 daddr @banlist6"
|
||||
# # ];
|
||||
# # };
|
||||
# };
|
||||
|
||||
rules = {
|
||||
dhcp = {
|
||||
from = "all";
|
||||
to = [hosts.beefcake.ip];
|
||||
allowedTCPPorts = [67];
|
||||
allowedUDPPorts = [67];
|
||||
};
|
||||
http = {
|
||||
from = "all";
|
||||
to = [me];
|
||||
allowedTCPPorts = [80 443];
|
||||
};
|
||||
router-ssh = {
|
||||
from = "all";
|
||||
to = [me];
|
||||
allowedTCPPorts = [2201];
|
||||
};
|
||||
server-ssh = {
|
||||
from = "all";
|
||||
to = [hosts.beefcake.ip];
|
||||
allowedTCPPorts = [22];
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
# rules = {
|
||||
# dhcp = {
|
||||
# from = "all";
|
||||
# to = [hosts.beefcake.ip];
|
||||
# allowedTCPPorts = [67];
|
||||
# allowedUDPPorts = [67];
|
||||
# };
|
||||
# http = {
|
||||
# from = "all";
|
||||
# to = [me];
|
||||
# allowedTCPPorts = [80 443];
|
||||
# };
|
||||
# router-ssh = {
|
||||
# from = "all";
|
||||
# to = [me];
|
||||
# allowedTCPPorts = [2201];
|
||||
# };
|
||||
# server-ssh = {
|
||||
# from = "all";
|
||||
# to = [hosts.beefcake.ip];
|
||||
# allowedTCPPorts = [22];
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
|
||||
systemd.network = {
|
||||
|
@ -368,35 +337,29 @@ in {
|
|||
ConfigureWithoutCarrier = true;
|
||||
# IPv6AcceptRA = false;
|
||||
IPv6SendRA = true;
|
||||
DHCPPrefixDelegation = true;
|
||||
DHCPv6PrefixDelegation = true;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
WAN configuration requires DHCP to get addresses
|
||||
we also disable some options to be certain we retain as much networking
|
||||
control as we reasonably can, such as not letting the ISP determine our
|
||||
hostname or DNS configuration
|
||||
TODO: IPv6 (prefix delegation)
|
||||
*/
|
||||
# WAN configuration requires DHCP to get addresses
|
||||
# we also disable some options to be certain we retain as much networking
|
||||
# control as we reasonably can, such as not letting the ISP determine our
|
||||
# hostname or DNS configuration
|
||||
# TODO: IPv6 (prefix delegation)
|
||||
"40-${interfaces.wan.name}" = {
|
||||
matchConfig.Name = "${interfaces.wan.name}";
|
||||
networkConfig = {
|
||||
Description = "WAN network - connection to fiber ISP jack";
|
||||
DHCP = true;
|
||||
/*
|
||||
IPv6AcceptRA = true;
|
||||
IPv6PrivacyExtensions = true;
|
||||
IPForward = true;
|
||||
*/
|
||||
# IPv6AcceptRA = true;
|
||||
# IPv6PrivacyExtensions = true;
|
||||
# IPForward = true;
|
||||
};
|
||||
dhcpV6Config = {
|
||||
/*
|
||||
ForceDHCPv6PDOtherInformation = true;
|
||||
UseHostname = false;
|
||||
UseDNS = false;
|
||||
UseNTP = false;
|
||||
*/
|
||||
# ForceDHCPv6PDOtherInformation = true;
|
||||
# UseHostname = false;
|
||||
# UseDNS = false;
|
||||
# UseNTP = false;
|
||||
PrefixDelegationHint = "::/56";
|
||||
};
|
||||
dhcpV4Config = {
|
||||
|
@ -422,21 +385,17 @@ in {
|
|||
|
||||
services.resolved.enable = false;
|
||||
|
||||
/*
|
||||
dnsmasq serves as our DHCP and DNS server
|
||||
almost all the configuration should be derived from the values at the top of
|
||||
this file
|
||||
*/
|
||||
# dnsmasq serves as our DHCP and DNS server
|
||||
# almost all the configuration should be derived from the values at the top of
|
||||
# this file
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
listen-address = "::,127.0.0.1,${ip}";
|
||||
port = 53;
|
||||
|
||||
/*
|
||||
dhcp-authoritative = true;
|
||||
dnssec = true;
|
||||
*/
|
||||
# dhcp-authoritative = true;
|
||||
# dnssec = true;
|
||||
enable-ra = true;
|
||||
|
||||
server = ["1.1.1.1" "9.9.9.9" "8.8.8.8"];
|
||||
|
@ -489,10 +448,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
/*
|
||||
since the home network reserves port 22 for ssh to the big server and to
|
||||
gitea, the router uses port 2201 for ssh
|
||||
*/
|
||||
# since the home network reserves port 22 for ssh to the big server and to
|
||||
# gitea, the router uses port 2201 for ssh
|
||||
services.openssh.listenAddresses = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
|
@ -516,254 +473,252 @@ in {
|
|||
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
/*
|
||||
NOTE: everything from here on is deprecated or old stuff
|
||||
# NOTE: everything from here on is deprecated or old stuff
|
||||
|
||||
TODO: may not be strictly necessary for IPv6?
|
||||
TODO: also may not even be the best implementation?
|
||||
services.radvd = {
|
||||
enable = false;
|
||||
## NOTE: this config is just the default arch linux config I think and may
|
||||
## need tweaking? this is what I had on the arch linux router, though :shrug:
|
||||
config = ''
|
||||
interface lo
|
||||
{
|
||||
AdvSendAdvert on;
|
||||
MinRtrAdvInterval 3;
|
||||
MaxRtrAdvInterval 10;
|
||||
AdvDefaultPreference low;
|
||||
AdvHomeAgentFlag off;
|
||||
# TODO: may not be strictly necessary for IPv6?
|
||||
# TODO: also may not even be the best implementation?
|
||||
# services.radvd = {
|
||||
# enable = false;
|
||||
# # NOTE: this config is just the default arch linux config I think and may
|
||||
# # need tweaking? this is what I had on the arch linux router, though :shrug:
|
||||
# config = ''
|
||||
# interface lo
|
||||
# {
|
||||
# AdvSendAdvert on;
|
||||
# MinRtrAdvInterval 3;
|
||||
# MaxRtrAdvInterval 10;
|
||||
# AdvDefaultPreference low;
|
||||
# AdvHomeAgentFlag off;
|
||||
|
||||
prefix 2001:db8:1:0::/64
|
||||
{
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvRouterAddr off;
|
||||
};
|
||||
# prefix 2001:db8:1:0::/64
|
||||
# {
|
||||
# AdvOnLink on;
|
||||
# AdvAutonomous on;
|
||||
# AdvRouterAddr off;
|
||||
# };
|
||||
|
||||
prefix 0:0:0:1234::/64
|
||||
{
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvRouterAddr off;
|
||||
Base6to4Interface ppp0;
|
||||
AdvPreferredLifetime 120;
|
||||
AdvValidLifetime 300;
|
||||
};
|
||||
# prefix 0:0:0:1234::/64
|
||||
# {
|
||||
# AdvOnLink on;
|
||||
# AdvAutonomous on;
|
||||
# AdvRouterAddr off;
|
||||
# Base6to4Interface ppp0;
|
||||
# AdvPreferredLifetime 120;
|
||||
# AdvValidLifetime 300;
|
||||
# };
|
||||
|
||||
route 2001:db0:fff::/48
|
||||
{
|
||||
AdvRoutePreference high;
|
||||
AdvRouteLifetime 3600;
|
||||
};
|
||||
# route 2001:db0:fff::/48
|
||||
# {
|
||||
# AdvRoutePreference high;
|
||||
# AdvRouteLifetime 3600;
|
||||
# };
|
||||
|
||||
RDNSS 2001:db8::1 2001:db8::2
|
||||
{
|
||||
AdvRDNSSLifetime 30;
|
||||
};
|
||||
# RDNSS 2001:db8::1 2001:db8::2
|
||||
# {
|
||||
# AdvRDNSSLifetime 30;
|
||||
# };
|
||||
|
||||
DNSSL branch.example.com example.com
|
||||
{
|
||||
AdvDNSSLLifetime 30;
|
||||
};
|
||||
};
|
||||
'';
|
||||
};
|
||||
# DNSSL branch.example.com example.com
|
||||
# {
|
||||
# AdvDNSSLLifetime 30;
|
||||
# };
|
||||
# };
|
||||
# '';
|
||||
# };
|
||||
|
||||
TODO: old config, should be deleted ASAP
|
||||
services.dnsmasq = {
|
||||
enable = false;
|
||||
settings = {
|
||||
# server endpoints
|
||||
listen-address = "::1,127.0.0.1,${ip}";
|
||||
port = "53";
|
||||
# TODO: old config, should be deleted ASAP
|
||||
# services.dnsmasq = {
|
||||
# enable = false;
|
||||
# settings = {
|
||||
# # server endpoints
|
||||
# listen-address = "::1,127.0.0.1,${ip}";
|
||||
# port = "53";
|
||||
|
||||
# DNS cache entries
|
||||
cache-size = "10000";
|
||||
# # DNS cache entries
|
||||
# cache-size = "10000";
|
||||
|
||||
# local domain entries
|
||||
local = "/lan/";
|
||||
domain = "lan";
|
||||
expand-hosts = true;
|
||||
# # local domain entries
|
||||
# local = "/lan/";
|
||||
# domain = "lan";
|
||||
# expand-hosts = true;
|
||||
|
||||
dhcp-authoritative = true;
|
||||
# dhcp-authoritative = true;
|
||||
|
||||
conf-file = "/usr/share/dnsmasq/trust-anchors.conf";
|
||||
dnssec = true;
|
||||
# conf-file = "/usr/share/dnsmasq/trust-anchors.conf";
|
||||
# dnssec = true;
|
||||
|
||||
except-interface = "${wan_if}";
|
||||
interface = "${lan_if}";
|
||||
# except-interface = "${wan_if}";
|
||||
# interface = "${lan_if}";
|
||||
|
||||
enable-ra = true;
|
||||
# enable-ra = true;
|
||||
|
||||
# dhcp-option = "121,${cidr},${ip}";
|
||||
# # dhcp-option = "121,${cidr},${ip}";
|
||||
|
||||
dhcp-range = [
|
||||
"lan,${dhcp_lease_space.min},${dhcp_lease_space.max},${netmask},10m"
|
||||
"tag:${lan_if},::1,constructor:${lan_if},ra-names,12h"
|
||||
];
|
||||
# dhcp-range = [
|
||||
# "lan,${dhcp_lease_space.min},${dhcp_lease_space.max},${netmask},10m"
|
||||
# "tag:${lan_if},::1,constructor:${lan_if},ra-names,12h"
|
||||
# ];
|
||||
|
||||
dhcp-host = [
|
||||
"${hosts.dragon.host},${hosts.dragon.ip},12h"
|
||||
"${hosts.beefcake.host},${hosts.beefcake.ip},12h"
|
||||
];
|
||||
# dhcp-host = [
|
||||
# "${hosts.dragon.host},${hosts.dragon.ip},12h"
|
||||
# "${hosts.beefcake.host},${hosts.beefcake.ip},12h"
|
||||
# ];
|
||||
|
||||
# may need to go in /etc/hosts (networking.extraHosts), too?
|
||||
address = [
|
||||
"/video.lyte.dev/192.168.0.9"
|
||||
"/git.lyte.dev/192.168.0.9"
|
||||
"/bw.lyte.dev/192.168.0.9"
|
||||
"/files.lyte.dev/192.168.0.9"
|
||||
"/vpn.h.lyte.dev/192.168.0.9"
|
||||
"/.h.lyte.dev/192.168.0.9"
|
||||
];
|
||||
# # may need to go in /etc/hosts (networking.extraHosts), too?
|
||||
# address = [
|
||||
# "/video.lyte.dev/192.168.0.9"
|
||||
# "/git.lyte.dev/192.168.0.9"
|
||||
# "/bw.lyte.dev/192.168.0.9"
|
||||
# "/files.lyte.dev/192.168.0.9"
|
||||
# "/vpn.h.lyte.dev/192.168.0.9"
|
||||
# "/.h.lyte.dev/192.168.0.9"
|
||||
# ];
|
||||
|
||||
server = [
|
||||
"${ip}"
|
||||
"8.8.8.8"
|
||||
"8.8.4.4"
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
];
|
||||
};
|
||||
};
|
||||
# server = [
|
||||
# "${ip}"
|
||||
# "8.8.8.8"
|
||||
# "8.8.4.4"
|
||||
# "1.1.1.1"
|
||||
# "1.0.0.1"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
TODO: old config, should be deleted ASAP
|
||||
nftables = {
|
||||
enable = false;
|
||||
flushRuleset = true;
|
||||
# TODO: old config, should be deleted ASAP
|
||||
# nftables = {
|
||||
# enable = false;
|
||||
# flushRuleset = true;
|
||||
|
||||
tables = {
|
||||
filter = {
|
||||
family = "inet";
|
||||
content = ''
|
||||
chain input {
|
||||
# type filter hook input priority filter; policy accept;
|
||||
type filter hook input priority 0;
|
||||
# tables = {
|
||||
# filter = {
|
||||
# family = "inet";
|
||||
# content = ''
|
||||
# chain input {
|
||||
# # type filter hook input priority filter; policy accept;
|
||||
# type filter hook input priority 0;
|
||||
|
||||
# anything from loopback interface
|
||||
iifname "lo" accept
|
||||
# # anything from loopback interface
|
||||
# iifname "lo" accept
|
||||
|
||||
# accept traffic we originated
|
||||
ct state { established, related } counter accept
|
||||
ct state invalid counter drop
|
||||
# # accept traffic we originated
|
||||
# ct state { established, related } counter accept
|
||||
# ct state invalid counter drop
|
||||
|
||||
# ICMP
|
||||
ip6 nexthdr icmpv6 icmpv6 type { echo-request, nd-neighbor-solicit, nd-neighbor-advert, nd-router-solicit, nd-router-advert, mld-listener-query, destination-unreachable, packet-too-big, time-exceeded, parameter-problem } counter accept
|
||||
ip protocol icmp icmp type { echo-request, destination-unreachable, router-advertisement, time-exceeded, parameter-problem } counter accept
|
||||
ip protocol icmpv6 counter accept
|
||||
ip protocol icmp counter accept
|
||||
meta l4proto ipv6-icmp counter accept
|
||||
udp dport dhcpv6-client counter accept
|
||||
# # ICMP
|
||||
# ip6 nexthdr icmpv6 icmpv6 type { echo-request, nd-neighbor-solicit, nd-neighbor-advert, nd-router-solicit, nd-router-advert, mld-listener-query, destination-unreachable, packet-too-big, time-exceeded, parameter-problem } counter accept
|
||||
# ip protocol icmp icmp type { echo-request, destination-unreachable, router-advertisement, time-exceeded, parameter-problem } counter accept
|
||||
# ip protocol icmpv6 counter accept
|
||||
# ip protocol icmp counter accept
|
||||
# meta l4proto ipv6-icmp counter accept
|
||||
# udp dport dhcpv6-client counter accept
|
||||
|
||||
tcp dport { 64022, 22, 53, 67, 25565 } counter accept
|
||||
udp dport { 64020, 22, 53, 67 } counter accept
|
||||
# tcp dport { 64022, 22, 53, 67, 25565 } counter accept
|
||||
# udp dport { 64020, 22, 53, 67 } counter accept
|
||||
|
||||
## iifname "iot" ip saddr $iot-ip tcp dport { llmnr } counter accept
|
||||
## iifname "iot" ip saddr $iot-ip udp dport { mdns, llmnr } counter accept
|
||||
iifname "${lan_if}" tcp dport { llmnr } counter accept
|
||||
iifname "${lan_if}" udp dport { mdns, llmnr } counter accept
|
||||
# # iifname "iot" ip saddr $iot-ip tcp dport { llmnr } counter accept
|
||||
# # iifname "iot" ip saddr $iot-ip udp dport { mdns, llmnr } counter accept
|
||||
# iifname "${lan_if}" tcp dport { llmnr } counter accept
|
||||
# iifname "${lan_if}" udp dport { mdns, llmnr } counter accept
|
||||
|
||||
counter drop
|
||||
}
|
||||
# counter drop
|
||||
# }
|
||||
|
||||
# allow all outgoing
|
||||
chain output {
|
||||
type filter hook output priority 0;
|
||||
accept
|
||||
}
|
||||
# # allow all outgoing
|
||||
# chain output {
|
||||
# type filter hook output priority 0;
|
||||
# accept
|
||||
# }
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority 0;
|
||||
accept
|
||||
}
|
||||
'';
|
||||
};
|
||||
# chain forward {
|
||||
# type filter hook forward priority 0;
|
||||
# accept
|
||||
# }
|
||||
# '';
|
||||
# };
|
||||
|
||||
nat = {
|
||||
family = "ip";
|
||||
content = ''
|
||||
set masq_saddr {
|
||||
type ipv4_addr
|
||||
flags interval
|
||||
elements = { ${cidr} }
|
||||
}
|
||||
# nat = {
|
||||
# family = "ip";
|
||||
# content = ''
|
||||
# set masq_saddr {
|
||||
# type ipv4_addr
|
||||
# flags interval
|
||||
# elements = { ${cidr} }
|
||||
# }
|
||||
|
||||
map map_port_ipport {
|
||||
type inet_proto . inet_service : ipv4_addr . inet_service
|
||||
}
|
||||
# map map_port_ipport {
|
||||
# type inet_proto . inet_service : ipv4_addr . inet_service
|
||||
# }
|
||||
|
||||
chain prerouting {
|
||||
iifname ${lan_if} accept
|
||||
# chain prerouting {
|
||||
# iifname ${lan_if} accept
|
||||
|
||||
type nat hook prerouting priority dstnat + 1; policy accept;
|
||||
fib daddr type local dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
|
||||
# type nat hook prerouting priority dstnat + 1; policy accept;
|
||||
# fib daddr type local dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
|
||||
|
||||
iifname ${wan_if} tcp dport { 22, 80, 443, 25565, 64022 } dnat to ${hosts.beefcake.ip}
|
||||
iifname ${wan_if} udp dport { 64020 } dnat to ${hosts.beefcake.ip}
|
||||
# iifname ${wan_if} tcp dport { 22, 80, 443, 25565, 64022 } dnat to ${hosts.beefcake.ip}
|
||||
# iifname ${wan_if} udp dport { 64020 } dnat to ${hosts.beefcake.ip}
|
||||
|
||||
## iifname ${wan_if} tcp dport { 25565 } dnat to 192.168.0.244
|
||||
## iifname ${wan_if} udp dport { 25565 } dnat to 192.168.0.244
|
||||
# # iifname ${wan_if} tcp dport { 25565 } dnat to 192.168.0.244
|
||||
# # iifname ${wan_if} udp dport { 25565 } dnat to 192.168.0.244
|
||||
|
||||
## router
|
||||
iifname ${wan_if} tcp dport { 2201 } dnat to ${ip}
|
||||
}
|
||||
# # router
|
||||
# iifname ${wan_if} tcp dport { 2201 } dnat to ${ip}
|
||||
# }
|
||||
|
||||
chain output {
|
||||
type nat hook output priority -99; policy accept;
|
||||
ip daddr != 127.0.0.0/8 oif "lo" dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
|
||||
}
|
||||
# chain output {
|
||||
# type nat hook output priority -99; policy accept;
|
||||
# ip daddr != 127.0.0.0/8 oif "lo" dnat ip addr . port to meta l4proto . th dport map @map_port_ipport
|
||||
# }
|
||||
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority srcnat + 1; policy accept;
|
||||
oifname ${lan_if} masquerade
|
||||
ip saddr @masq_saddr masquerade
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# chain postrouting {
|
||||
# type nat hook postrouting priority srcnat + 1; policy accept;
|
||||
# oifname ${lan_if} masquerade
|
||||
# ip saddr @masq_saddr masquerade
|
||||
# }
|
||||
# '';
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
TODO: also want to try to avoid using dhcpcd for IPv6 since systemd-networkd
|
||||
should be sufficient?
|
||||
dhcpcd = {
|
||||
enable = false;
|
||||
extraConfig = ''
|
||||
duid
|
||||
# TODO: also want to try to avoid using dhcpcd for IPv6 since systemd-networkd
|
||||
# should be sufficient?
|
||||
# dhcpcd = {
|
||||
# enable = false;
|
||||
# extraConfig = ''
|
||||
# duid
|
||||
|
||||
## No way.... https://github.com/NetworkConfiguration/dhcpcd/issues/36#issuecomment-954777644
|
||||
## issues caused by guests with oneplus devices
|
||||
noarp
|
||||
# # No way.... https://github.com/NetworkConfiguration/dhcpcd/issues/36#issuecomment-954777644
|
||||
# # issues caused by guests with oneplus devices
|
||||
# noarp
|
||||
|
||||
persistent
|
||||
vendorclassid
|
||||
# persistent
|
||||
# vendorclassid
|
||||
|
||||
option domain_name_servers, domain_name, domain_search
|
||||
option classless_static_routes
|
||||
option interface_mtu
|
||||
option host_name
|
||||
#option ntp_servers
|
||||
# option domain_name_servers, domain_name, domain_search
|
||||
# option classless_static_routes
|
||||
# option interface_mtu
|
||||
# option host_name
|
||||
# #option ntp_servers
|
||||
|
||||
require dhcp_server_identifier
|
||||
slaac private
|
||||
noipv4ll
|
||||
noipv6rs
|
||||
# require dhcp_server_identifier
|
||||
# slaac private
|
||||
# noipv4ll
|
||||
# noipv6rs
|
||||
|
||||
static domain_name_servers=${ip}
|
||||
# static domain_name_servers=${ip}
|
||||
|
||||
interface ${wan_if}
|
||||
gateway
|
||||
ipv6rs
|
||||
iaid 1
|
||||
## option rapid_commit
|
||||
## ia_na 1
|
||||
ia_pd 1 ${lan_if}
|
||||
# interface ${wan_if}
|
||||
# gateway
|
||||
# ipv6rs
|
||||
# iaid 1
|
||||
# # option rapid_commit
|
||||
# # ia_na 1
|
||||
# ia_pd 1 ${lan_if}
|
||||
|
||||
interface ${lan_if}
|
||||
static ip_address=${cidr}
|
||||
static routers=${ip}
|
||||
static domain_name_servers=${ip}
|
||||
'';
|
||||
};
|
||||
*/
|
||||
# interface ${lan_if}
|
||||
# static ip_address=${cidr}
|
||||
# static routers=${ip}
|
||||
# static domain_name_servers=${ip}
|
||||
# '';
|
||||
# };
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
networking.hostName = "thablet";
|
||||
|
||||
home-manager.users.daniel = {
|
||||
};
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
services.fprintd = {
|
||||
|
@ -42,26 +44,11 @@
|
|||
boot.kernelModules = ["kvm-intel" "acpi_call"];
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [acpi_call];
|
||||
|
||||
hardware = {
|
||||
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
intel-media-driver
|
||||
intel-ocl
|
||||
intel-vaapi-driver
|
||||
];
|
||||
};
|
||||
};
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = false;
|
||||
};
|
||||
|
||||
services.power-profiles-daemon = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
|
@ -74,74 +61,5 @@
|
|||
};
|
||||
};
|
||||
|
||||
home-manager.users.daniel = {
|
||||
home = {
|
||||
pointerCursor = {
|
||||
size = 40;
|
||||
};
|
||||
};
|
||||
|
||||
programs.hyprlock.settings = {
|
||||
label = [
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 32;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(255, 255, 255, 0.5)";
|
||||
|
||||
position = "0 -500";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = "cmd[update:30000] acpi";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
services.hypridle = let
|
||||
secondsPerMinute = 60;
|
||||
lockSeconds = 10 * secondsPerMinute;
|
||||
in {
|
||||
settings = {
|
||||
listener = [
|
||||
{
|
||||
timeout = lockSeconds + 55;
|
||||
on-timeout = ''systemctl suspend'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"eww open bar0"
|
||||
];
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
"eDP-1,2560x1440@60Hz,0x0,1.25"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
config = {
|
||||
output = {
|
||||
"AU Optronics 0x2236 Unknown" = {
|
||||
mode = "2560x1440@60Hz";
|
||||
position = "0,0";
|
||||
scale = toString 1.25;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
|
|
|
@ -6,65 +6,13 @@
|
|||
efi.canTouchEfiVariables = true;
|
||||
systemd-boot.enable = true;
|
||||
};
|
||||
/*
|
||||
sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
|
||||
the above won't work for btrfs, instead you need
|
||||
btrfs inspect-internal map-swapfile -r /swap/swapfile
|
||||
https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
|
||||
*/
|
||||
# kernelParams = ["boot.shell_on_fail"];
|
||||
# sudo filefrag -v /swap/swapfile | awk '$1=="0:" {print substr($4, 1, length($4)-2)}'
|
||||
# the above won't work for btrfs, instead you need
|
||||
# btrfs inspect-internal map-swapfile -r /swap/swapfile
|
||||
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file
|
||||
kernelParams = ["boot.shell_on_fail"];
|
||||
initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci"];
|
||||
};
|
||||
|
||||
home-manager.users.daniel = {
|
||||
programs.hyprlock.settings = {
|
||||
label = [
|
||||
{
|
||||
monitor = "";
|
||||
font_size = 32;
|
||||
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
text_align = "center";
|
||||
color = "rgba(255, 255, 255, 0.5)";
|
||||
|
||||
position = "0 -500";
|
||||
font_family = "IosevkaLyteTerm";
|
||||
text = "cmd[update:30000] acpi";
|
||||
|
||||
shadow_passes = 3;
|
||||
shadow_size = 1;
|
||||
shadow_color = "rgba(0, 0, 0, 1.0)";
|
||||
shadow_boost = 1.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
services.hypridle = let
|
||||
secondsPerMinute = 60;
|
||||
lockSeconds = 10 * secondsPerMinute;
|
||||
in {
|
||||
settings = {
|
||||
listener = [
|
||||
{
|
||||
timeout = lockSeconds + 55;
|
||||
on-timeout = ''systemctl suspend'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"eww open bar0"
|
||||
];
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
monitor = [
|
||||
"eDP-1,1920x1080@60Hz,0x0,1.0"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
}
|
||||
|
|
|
@ -5,28 +5,22 @@
|
|||
pkgs = import nixpkgs {inherit (final) system;};
|
||||
};
|
||||
|
||||
/*
|
||||
This one contains whatever you want to overlay
|
||||
You can change versions, add patches, set compilation flags, anything really.
|
||||
https://nixos.wiki/wiki/Overlays
|
||||
*/
|
||||
# This one contains whatever you want to overlay
|
||||
# You can change versions, add patches, set compilation flags, anything really.
|
||||
# https://nixos.wiki/wiki/Overlays
|
||||
modifications = final: prev: {
|
||||
/*
|
||||
final.fprintd = prev.fprintd.overrideAttrs {
|
||||
# Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f
|
||||
mesonCheckFlags = [
|
||||
# PAM related checks are timing out
|
||||
"--no-suite"
|
||||
"fprintd:TestPamFprintd"
|
||||
];
|
||||
};
|
||||
*/
|
||||
# final.fprintd = prev.fprintd.overrideAttrs {
|
||||
# # Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f
|
||||
# mesonCheckFlags = [
|
||||
# # PAM related checks are timing out
|
||||
# "--no-suite"
|
||||
# "fprintd:TestPamFprintd"
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
|
||||
/*
|
||||
When applied, the unstable nixpkgs set (declared in the flake inputs) will
|
||||
be accessible through 'pkgs.unstable'
|
||||
*/
|
||||
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
|
||||
# be accessible through 'pkgs.unstable'
|
||||
unstable-packages = final: _prev: {
|
||||
unstable = import nixpkgs {
|
||||
system = final.system;
|
||||
|
|
|
@ -34,10 +34,10 @@ in ((iosevka.override {
|
|||
menu = 900
|
||||
css = 900
|
||||
|
||||
## [[buildPlans.Iosevka${set}.compatibility-ligatures]]
|
||||
## unicode = 57600 # 0xE100
|
||||
## featureTag = 'calt'
|
||||
## kequence = '<*>'
|
||||
# [[buildPlans.Iosevka${set}.compatibility-ligatures]]
|
||||
# unicode = 57600 # 0xE100
|
||||
# featureTag = 'calt'
|
||||
# kequence = '<*>'
|
||||
|
||||
[buildPlans.Iosevka${set}.variants]
|
||||
inherits = "ss01"
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
<div align="center">
|
||||
|
||||
<h1>
|
||||
<img width="100" src="images/Nix_snowflake_lytedev.svg" /> <br>
|
||||
Nix for <code>lytedev</code>
|
||||
</h1>
|
||||
# Nix
|
||||
|
||||
[![flake check status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-flake-check.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-flake-check.yaml)
|
||||
[![build status](https://git.lyte.dev/lytedev/nix/badges/workflows/nix-build.yaml/badge.svg)](https://git.lyte.dev/lytedev/nix/actions?workflow=nix-build.yaml)
|
||||
|
||||
</div>
|
||||
|
||||
My grand, declarative, and unified application, service, environment, and
|
||||
machine configuration, secret, and package management in a single flake. ❤️ ❄️
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@ plausible-admin-password: ENC[AES256_GCM,data:dC9olypZgMLdPOsmjthOaa/fMLtbGBlF9A
|
|||
plausible-erlang-cookie: ENC[AES256_GCM,data:zhmC+D6EjIE8Rw91lIrMqY0QIazTX1e1jBzcZJP/76B9VvHWZ5bCkP1+KdfCY0lk3wIEq5vRfb8=,iv:RNNjlV3OFtXn1N0a5fEb/3FWzcHX19wtCLMdaVlKNJ0=,tag:8iU5oFVbzd0eMe5Mo1PiAw==,type:str]
|
||||
plausible-secret-key-base: ENC[AES256_GCM,data:ylakPGzY4S9640krl0fxYgm0Getf0+I7zthyTqTD/IpVhz5xgYBYx3Y2lSNa9Oi9yQ7+f9OdOBC6nc7n6MuUBg==,iv:YLPax/cRjMdIFti26gJd8COKr+3jXNZ7HCA5VvQVyAo=,tag:LHqYi590oEIp1IihLcFTtw==,type:str]
|
||||
nextcloud-admin-password: ENC[AES256_GCM,data:QaoSZyommeGED3nWNru92UVO2tjk24HE9fWX7ExYT101o4ZL411TmV1TXHSyfwjmE7yLIm1K/j4xpEbIY3zvFg==,iv:xC5EZVPHumVPOob5jiiXMFAmdFQcFSUPtZgioAgGDDs=,tag:Q/kY38XWkGsqcmCkd2lodg==,type:str]
|
||||
grafana-admin-password: ENC[AES256_GCM,data:SpxQ7FgFoF5cZj5+1ug=,iv:NaQPIqFE62PHC14rT/xqYchdt7IykS8jJhuGRcC2SjM=,tag:Q8QtHiE4Beh5GG/IcvjG4w==,type:str]
|
||||
netlify-ddns-password: ENC[AES256_GCM,data:mz9MS93ZPbtziwo56DP27q5ZgA1rgCptQpgTPrq2Ihc3KjSxSACJ6p6t8NjRPr4lSDLPzDa47OnRct/N4fcm5Q==,iv:upOh9S0wvTXBwfso3GhQzpl5befY0T0hTW/LGNcvv0k=,tag:/LNP0wIaxtExulV0blVkXA==,type:str]
|
||||
grafana-smtp-password: ENC[AES256_GCM,data:eSzFlEcgSPEy7p0QW6Pr6Z86TRHuuIJcM7nSI7bBBFy/9/VQaYk6+Ztu049ZGrejPNk=,iv:o14YoiTE4dCKw/Rbh/B2m2b5oyitvaB+FnLxydgu75c=,tag:4iRngd9OiZMq5RTVKdklHw==,type:str]
|
||||
#ENC[AES256_GCM,data:IDauOj95sPt6LQkNWOaAV3AR7XPHJljX7Gef/IgtzC227ln7aKpVLCbhxD6pNTwd9/KhIXJp3vagCjfgkO/utA==,iv:Pn5jIPsFMBA2xnp3SUBgBug1NN8d3h3zy1pGVzO2hO0=,tag:NzhLA7nqE7SRRMV+rKgCjQ==,type:comment]
|
||||
forgejo-runner.env: ENC[AES256_GCM,data:x4EaDzK4W34ZEZ/Inakore2YABZf8e7TBBjoC6xTPZ9GBrSZCE85FOcHAmMXPDo=,iv:bNGOsLnhxnlC/opCKT1DSsGoWdmgJ8NgEPY3ySlN108=,tag:Ijp3qHBSdv6EDaZdomJhAA==,type:str]
|
||||
jland.env: ENC[AES256_GCM,data:u+QKwKWG9NFduuofhe3aatof3KoC0N4ZpNOD8E/7l0BTSoTe5Tqmz5/33EOcBUw99+YLFR4kTJwdUmLWHk4UD87aGsJ4liPCtXnBsToAzBGg0I3mhGQ/QM8iKXMW9oKb3ciapitQBuJa1WIp5/bHNtCXWQ==,iv:iZDET5EWM4DnAoQqLP9+Ll4S+mFHt2wZ3ENtN79Dbqw=,tag:qVpocN3FxlHfte2hAmtGPA==,type:str]
|
||||
|
@ -26,9 +24,6 @@ api.lyte.dev: ENC[AES256_GCM,data:14C5GQ41m/g7qHPzxlYoWjKWDOcm7MEDkuSofiuLfRNc/n
|
|||
restic-rascal-passphrase: ENC[AES256_GCM,data:yonKbBh4riGwxc/qcj8F/qrgAtA1sWhYejw9rdOTdCNW3a7zL/Ny1+XCI/P3bMOsY6UTmg/gxA2itp4cSbvqjg==,iv:5GwaEExn7b3dIkCVehLxaBXW+nUuSexY/bcqfCUwF5Q=,tag:dinyyw2XeVoSnw/IsYfK0w==,type:str]
|
||||
restic-rascal-ssh-private-key: ENC[AES256_GCM,data:ddsOs0XsayyQI9qc6LzwQpdDnfwNpbj8PbBJ5fyuqtlVNYndeLxaYcbZI2ULSUhgR1tN0FS+ggGTHQhVvjwksNvpskUGHNKkSLKH3D/mn5N9tsoeAblN4gZsloZdqXBVzEehumcQMdhh6iy6NkNbuinKrVKDhLV25PrFKuSBEYw9VHU7HAMW5Tfop3RzBXjZWETCDAR2OQa7d1dXsJ0Kw6b9RFmRe5MGQ0J7YhjdTg26JGMMVSeHvr5UbiUJkGA5RvOLEDM2Dfai7Lf8yRPZVxUl+rdRsNvNYEoYGu5rGLUFcuqIbQ+s40dP2uXwWauwkIvHUjEahkbP0httj4Kg3qIJBRPg7OuS+MOwAnLEAs3hl5zeBV396yA9qjWW8nhnbml58/uFFbfXbJWTM3r8cMpFbHKD+Ojo/99fm5Vy3pAMzNzEsHOaT+iyDYyNkV5OH1GyKK9n7kIRLdqmWe7GmaKXlwVvNUPi3RvLX9VXq83a4BuupFyTmaNfPGMs/17830aleV674+QVgKh3VyFtuJy6KBpMXDv16wFo,iv:S2I3h6pmKLxEc29E0zn2b8lscqA//5/ZMTV9q+/tdvs=,tag:ALeCT+nrVPDfS21xC555sA==,type:str]
|
||||
restic-ssh-priv-key-benland: ENC[AES256_GCM,data:G+uiYZTvqXhpJb66j6Q6S+otlXeRX0CdYeMHzSMjIbvbI0AVm0yCU7COO5/O8i47NpvrKKS1kVxVEK8ixLRUowkl3hgRXhxsBIPFnpkMD0ENmJttm4HOpi0qIWMwzPYTjkz/slY4HcTFnCfYy1ZpURQdWwZsr1EdAA05bUMTtM22R3uOMzjO8uf72PCWX7yffo8MxsLmWvNVAOhVlrb2H5KQNR/IquFK3TFoZitq5nVDG9tcEFkX+lgA3zsmCHU/2DvvodgeRoltaAFvgjVznNGf4e5p8owHUtSzX52HwGZRiUlMuhpre2gm1r73n8AyZe41II+LX/85fMfZDdyayIGv3AAMBib8H0/AoChexRcdLQEmzOgRrXsgucDJrWSWP6WMBVyamUm79m5ep0fvL1lJftuJqN0uuq9dBrispdso4x+6jk/pDf5pEM/FE6s1rY832BEb7q0PnjyvVogOez+cIihmMpDdnS0A/8TFzg29i3C+93x5vrt3k7atNzR/jN+/GqX2FKLzxWrrIw2d,iv:IP+N8JQu+XRvwTtBnxu54ujzU5UliltXG3mk9HfJaN8=,tag:4oinE9QMaSh8IfUd/ttM3Q==,type:str]
|
||||
paperless-superuser-password: ENC[AES256_GCM,data:lypWK73mOYI2hyQAW/4T3cDiVtsts3kKb7LZb9ES3n97Kn5l,iv:jBHUBFbb4GqQ3gnK0h5VCaGj3/kd3/eGa1QFiE7+B9I=,tag:UoQar+x1xVnCV2k+9hYjWA==,type:str]
|
||||
factorio-server-settings: ENC[AES256_GCM,data:KlHkHGenkoLtqt0YCETwQdhH0tvvqsyake3lC9Wimso3Y8IXvDfkLpOTE53Jq4frf1QMJh0LYyle+AmIgGvB0gAp/4fM1E4Ah9JPtKkcjVPyQIypuaDsPaVQMxMlJt1+TLX2fbSWdxOo0lulNg==,iv:AHq37PY3ZxKF0+ClUrSvhJSBuXFtGZLBZW/ZADrVqLI=,tag:B0gFyy6rmd6CGJfzAhO02A==,type:str]
|
||||
flanilla.env: ENC[AES256_GCM,data:qp0cpjHgpFx2gICtH8vNusJt08MLOIS3,iv:lugXNEJpMJ8mSwvo2jDwTwsY0x3kcHQDc29Z2Wz+LB4=,tag:0/FWQKUXePemFWGXbH1Tjg==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
|
@ -53,8 +48,8 @@ sops:
|
|||
bGpacHFRSkJYUUMwOEh4cVBXZ1NESmsKa5EhZ7148ojCqZldukLcPLr93HqnpNgq
|
||||
rMI0Nyz4Z4lkTVMRpA94zyNTkNwJ02/CYcKi8EJi6jGZnNPUTcnTwg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-12-26T16:42:22Z"
|
||||
mac: ENC[AES256_GCM,data:COh57637D7BnYa2ke+SsGnRuyWmS3X6xDJNV0ATWEHqKjckZ2tqyfL1ugGuokmqilIsRcXi2q5sqCd8uNrWZLicZ/6eQ5w7CqoFU8OEON6ERibQ36X0oLsz9teuT+bx9ZMfzYOKh0LZY0XP9es7W+4PC3XiBJcIB2GWTTrrGaI4=,iv:aeBvVjC7Qn/ohYmpC6lvcve0bMSBsvfRSa1kyiyj0Rg=,tag:hld5rkOq5mfcGFShKuKgng==,type:str]
|
||||
lastmodified: "2024-09-06T21:22:57Z"
|
||||
mac: ENC[AES256_GCM,data:suoBGuZnfZpo55g+sq6MXDvecwhhWRS9gtTlCvnWmSvWT+K8TFXHcz9cLZT5U2N4ueSYJovRoKPoAv9rKgtLHSSg+JKI0b0cErQge75970bTbeMKMl+SJmYF0T0ht5+8n5zjhnQjVo2mHmJJI1IekumsoNJ9+F6USPBidiK0uNU=,iv:7dMsEnXylvn0vVfmU9pQt1BgrqfKdSyoBbNTUZ782Uo=,tag:E3u9LVcdTKa7mjAxQ/m9rw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.1
|
||||
version: 3.9.0
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
ddns-pass: ENC[AES256_GCM,data:/Dpjl761JLHTM+we1PJs7pkcHcWzBk0jQ1bP4plOYGS4N3vXhXn1bHCYmENlrOwU3riETBZ5OeRA1LvFNZHPQw==,iv:LbgN5utHUBZRV49e6ux7HPG0xt4ydTqyZA+NZuaJnWs=,tag:l0VRaMJ6ie63lej6mZTMPg==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1RW5FaXYrSWxUQ1BQa0xl
|
||||
eU9GSGNqVitqeTcvOHRwTTBSSG13cEZHTUNJCjVYT2JpaGxrU2VBS3hPOWtJemlR
|
||||
S1hHck1qczhlTytWV3ZkdnE0aWVhT1UKLS0tIEoyWXczU3FmMXZiQkRJZEUwV0lV
|
||||
YldzL212ZlVaUStXcWRIN1lVMXVjd1UKqcfnuSxm19ClrxaH8koodgI3ZBlzKNWa
|
||||
fR/jUQMOGike43A383AprwnW7Y6ReLUOfixW2mMteT/ofEJeohEhEA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age14ewl97x5g52ajf269cmmwzrgf22m9dsr7mw7czfa356qugvf4gvq5dttfv
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBuNlkzNXZDWUY0VmtOTlBz
|
||||
U2dmaWlJcFo3czJjUm8yYzRFTEJzNzdBc1ZZCjg4OUdzN0QvLzFONXhmL3pYVll0
|
||||
Ym1RNHovNWF5WENMM3FXckliT3hRL1kKLS0tIGNLaG9hY25zOThrZDJCV05nbENx
|
||||
UWpwTSs2L1NIYXpZYkpDWjNWbWVQWlkKUIwLyA1EzSbJj9MJsBQ5f0bJawtbXQHT
|
||||
21TIp1Ki3juXLvsz0n7Pl+r2/lF907HpriDI7zWK+I/iviTpw+TwTA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-09-14T12:41:15Z"
|
||||
mac: ENC[AES256_GCM,data:sO3omCYH1urB/qcW3VippCinCUO1cmp5KrUSQk5ms7k+i9xUhdL3tTYHGVTa4PHV6VluukKnHuwAijo+rneNdCeMdIkAEskk/X6SDYgkwmjXuNcNEA4la22EqSrenJ8W3UafHDvP8+vpUKAzVo0E82Vmo9/YNJaqvqQM8PtciSc=,iv:2GboNZpAezZsWK3CbcwVw40zW4CucP3JhsYlvZ/Hy2M=,tag:w3XmkN76oYV+PmliPB01MQ==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.0
|
|
@ -1,30 +0,0 @@
|
|||
netlify-ddns-password: ENC[AES256_GCM,data:zp58uV2L+/n/9Cvp1BnQBhdfmNfuyH8C73R6JYrJ3pw0QbEpPpIWuzod9S28QxNq50Bj5/zGzE+D125dkYFX0A==,iv:kceEl04Nb6LWcyjl2fHYjsl0RSO8OulN3DKlDLwjIu4=,tag:nOi2H56dEX9K5okaiDaWOQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1stdue5q5teskee057ced6rh9pzzr93xsy66w4sc3zu49rgxl7cjshztt45
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBiQlZqSzBaTUROMkp2K2xI
|
||||
Z0ZIdllGNnlNYnFtVERPbVN6Y1FnWC9aeGlFCnZYci9CblA3VFZsOG5OOXE3cDZj
|
||||
TlZkbU0yY0F1ZDA5amczRVFldU1ZWGcKLS0tIEFTdi9uRFdlQW1MbUdSdm9jRW5n
|
||||
emxsSGN2b3JLZGNYQmVDYk96QUY5aVEK0w7Q/zEsIJKFcQjhgQovmRs4Iv6bhuaz
|
||||
cKn8M/p8dG+p5G50ALsiIiuTFBUM7vmFVF000PxqsEFr0Yl6eDg+uA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age1zd7c3g5d20shdftq8ghqm0r92488dg4pdp4gulur7ex3zx2yq35ssxawpn
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZK1lRTlRIc2ZxcllsRFRp
|
||||
aEZIOC80TSt2Ly9MUEdiVGQ5akkrUUJwcDFJClIyMUl0SWY3TXFLcWl0TGw3K3VM
|
||||
N0VWaGpCaVp6MXg4M2pwcnNhNkhPYjQKLS0tIEZOVGVTcUxaMmxBNEVJQ2VFSjRm
|
||||
L2lpaExJM2FkUFdqa3JpalZmOFZYV0kKmXlu5CUIYnNEOlIco3JveS7KdiF2yWTn
|
||||
r/KOKA9/v3zPbnsYc+HETxYNy1OWrQ/qDGIbR6jz8L5+v35FN+larw==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-09-13T05:37:38Z"
|
||||
mac: ENC[AES256_GCM,data:r1qpYSojCuN84FYX1c684XifKMKUPTOl7dvzuoYYuLf+mwbZrD4fUErDmZczzA4g2ttSNNv05bEq5D7XgfoXPcbhqtj/jggxvX4EGLltpo3Jy77EyKabr1c7KsYV3ciYT13sRGzFYrge06wVrUUPpozPfvAbp1qv0CwK4dUg4dc=,iv:Bpnrx8KcZnWkld4f3VRl39xMmaU388KQunig9xohUto=,tag:vKUupMf/dRb5bY8BMV4oVw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.0
|
1
templates/.gitignore
vendored
1
templates/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
flake.lock
|
3
templates/elixir/.gitignore
vendored
3
templates/elixir/.gitignore
vendored
|
@ -20,6 +20,3 @@ erl_crash.dump
|
|||
|
||||
# direnv cache
|
||||
/.direnv
|
||||
|
||||
# nix-generated pre commit hooks
|
||||
.pre-commit-config.yaml
|
||||
|
|
|
@ -1,16 +1,79 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs: let
|
||||
inherit (import nix/boilerplate.nix inputs) call;
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
|
||||
supportedSystems = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
|
||||
overlay = final: prev: {
|
||||
erlangPackages = prev.beam.packagesWith prev.erlang_26;
|
||||
erlang = final.erlangPackages.erlang;
|
||||
elixir = final.erlangPackages.elixir_1_16;
|
||||
|
||||
mixRelease = final.erlangPackages.mixRelease.override {
|
||||
elixir = final.elixir;
|
||||
};
|
||||
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
|
||||
elixir = final.elixir;
|
||||
};
|
||||
|
||||
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
|
||||
};
|
||||
|
||||
nixpkgsFor = system: ((import nixpkgs {inherit system;}).extend overlay);
|
||||
in {
|
||||
overlays = import nix/overlays.nix;
|
||||
packages = call (import nix/packages.nix);
|
||||
checks = call (import nix/checks.nix);
|
||||
devShells = call (import nix/shells.nix);
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor system;
|
||||
|
||||
inherit (pkgs) beamPackages;
|
||||
inherit (beamPackages) mixRelease fetchMixDeps;
|
||||
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
pname = "api.lyte.dev";
|
||||
in {
|
||||
# this-package = mixRelease {
|
||||
# inherit pname version src;
|
||||
# mixFodDeps = fetchMixDeps {
|
||||
# inherit version src;
|
||||
# pname = "mix-deps-${pname}";
|
||||
# hash = pkgs.lib.fakeSha256;
|
||||
# };
|
||||
# buildInputs = with pkgs; [sqlite];
|
||||
# HOME = "$(pwd)";
|
||||
# MIX_XDG = "$HOME";
|
||||
# };
|
||||
|
||||
# default = outputs.packages.${system}.this-package;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor system;
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
|
||||
buildInputs = with pkgs; [
|
||||
elixir
|
||||
elixir-ls
|
||||
|
||||
inotify-tools
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
inputs @ {
|
||||
nixpkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
forSelfOverlay =
|
||||
if builtins.hasAttr "forSelf" self.overlays
|
||||
then self.overlays.forSelf
|
||||
else (_: p: p);
|
||||
in rec {
|
||||
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
|
||||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay);
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
git-hooks,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
hook = {
|
||||
command,
|
||||
stages ? ["pre-commit"],
|
||||
...
|
||||
}: {
|
||||
inherit stages;
|
||||
enable = true;
|
||||
name = command;
|
||||
entry = command;
|
||||
pass_filenames = false;
|
||||
};
|
||||
in {
|
||||
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
||||
src = ./..;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
convco.enable = true;
|
||||
credo = hook {command = "mix credo --strict";};
|
||||
formatting = hook {command = "mix format --check-formatted";};
|
||||
dialyzer = hook {command = "mix dialyzer";};
|
||||
test = hook {command = "mix test";};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
forSelf = final: prev: {
|
||||
erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27;
|
||||
elixir = final.erlang.elixir_1_17;
|
||||
mixRelease = final.erlang.mixRelease.override {elixir = final.elixir;};
|
||||
fetchMixDeps = final.erlang.fetchMixDeps.override {elixir = final.elixir;};
|
||||
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
|
||||
};
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
version = "1.0.0";
|
||||
src = ../.;
|
||||
pname = "my-package";
|
||||
in {
|
||||
${pname} = pkgs.mixRelease {
|
||||
inherit pname version src;
|
||||
mixFodDeps = pkgs.fetchMixDeps {
|
||||
inherit version src;
|
||||
pname = "mix-deps-${pname}";
|
||||
sha256 = pkgs.lib.fakeSha256;
|
||||
};
|
||||
LANG = "C.UTF-8";
|
||||
# buildInputs = with pkgs; [];
|
||||
# HOME = "$(pwd)";
|
||||
# MIX_XDG = "$HOME";
|
||||
# RELEASE_COOKIE = "test-cookie";
|
||||
};
|
||||
|
||||
default = self.packages.${pkgs.system}.${pname};
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
elixir-dev = pkgs.mkShell {
|
||||
shellHook = ''
|
||||
${self.checks.${pkgs.system}.git-hooks.shellHook}
|
||||
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
|
||||
'';
|
||||
# inputsFrom = [self.packages.${pkgs.system}.my-package];
|
||||
buildInputs = with pkgs; [
|
||||
elixir
|
||||
elixir-ls
|
||||
inotify-tools
|
||||
];
|
||||
MIX_ENV = "dev";
|
||||
};
|
||||
default = self.outputs.devShells.${pkgs.system}.elixir-dev;
|
||||
}
|
|
@ -35,14 +35,12 @@
|
|||
default = self.outputs.devShells.${pkgs.system}.nix;
|
||||
});
|
||||
|
||||
/*
|
||||
packages = genPkgs (pkgs: import ./pkgs {inherit pkgs;});
|
||||
overlays = import ./overlays self;
|
||||
nixosModules = import ./modules/nixos;
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
nixosConfigurations = import ./nixos;
|
||||
homeConfigurations = import ./home
|
||||
templates = import ./templates;
|
||||
*/
|
||||
# packages = genPkgs (pkgs: import ./pkgs {inherit pkgs;});
|
||||
# overlays = import ./overlays self;
|
||||
# nixosModules = import ./modules/nixos;
|
||||
# homeManagerModules = import ./modules/home-manager;
|
||||
# nixosConfigurations = import ./nixos;
|
||||
# homeConfigurations = import ./home
|
||||
# templates = import ./templates;
|
||||
};
|
||||
}
|
||||
|
|
1
templates/rust/.gitignore
vendored
1
templates/rust/.gitignore
vendored
|
@ -1,4 +1,3 @@
|
|||
/target
|
||||
/result
|
||||
/.direnv
|
||||
/.pre-commit-config.yaml
|
||||
|
|
|
@ -1,14 +1,81 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
inputs.git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
inputs.git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
outputs = inputs: let
|
||||
inherit (import nix/boilerplate.nix inputs) call genPkgs;
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = {
|
||||
self,
|
||||
git-hooks,
|
||||
nixpkgs,
|
||||
}: let
|
||||
inherit (self) outputs;
|
||||
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
|
||||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: (import nixpkgs {inherit system;}).extend outputs.overlays.default;
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
in {
|
||||
# overlays = import nix/overlays.nix;
|
||||
checks = call (import nix/checks.nix);
|
||||
packages = call (import nix/packages.nix);
|
||||
devShells = call (import nix/shells.nix);
|
||||
checks = genPkgs (pkgs: {
|
||||
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
# NOTE: These do not work well with `nix flake check` due to pure environments
|
||||
# https://github.com/cachix/git-hooks.nix/issues/452
|
||||
# cargo-check.enable = true;
|
||||
# clippy = {
|
||||
# enable = true;
|
||||
# packageOverrides.cargo = pkgs.cargo;
|
||||
# packageOverrides.clippy = pkgs.rustPackages.clippy;
|
||||
# };
|
||||
rustfmt = {
|
||||
enable = true;
|
||||
packageOverrides.rustfmt = pkgs.rustfmt;
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
packages = genPkgs (pkgs: {
|
||||
my-package = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "kodotag";
|
||||
version = "0.1.0";
|
||||
|
||||
# nativeBuildInputs = with pkgs; [
|
||||
# pkg-config
|
||||
# clang
|
||||
# ];
|
||||
|
||||
# buildInputs = with pkgs; [
|
||||
# ];
|
||||
|
||||
src = ./.;
|
||||
hash = pkgs.lib.fakeHash;
|
||||
cargoHash = "sha256-W7VQlMktGsRPQL9VGVmxYV6C5u2eJ48S7eTpOM+3n8U=";
|
||||
|
||||
RUSTFLAGS = pkgs.lib.optionalString pkgs.stdenv.isLinux "-C link-arg=-fuse-ld=mold";
|
||||
};
|
||||
|
||||
default = outputs.packages.${pkgs.system}.my-package;
|
||||
});
|
||||
|
||||
devShells = genPkgs (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
inherit (self.checks.${pkgs.system}.git-hooks) shellHook;
|
||||
inputsFrom = [outputs.packages.${pkgs.system}.default];
|
||||
packages = with pkgs; [
|
||||
rustPackages.clippy
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
lldb
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
overlays = {
|
||||
default = final: prev: {};
|
||||
};
|
||||
|
||||
formatter = genPkgs (p: p.alejandra);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
inputs @ {
|
||||
nixpkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
forSelfOverlay =
|
||||
if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays
|
||||
then self.overlays.forSelf
|
||||
else (_: p: p);
|
||||
in rec {
|
||||
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
|
||||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay);
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
git-hooks,
|
||||
...
|
||||
}: {
|
||||
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
||||
src = ./..;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
cargo-check.enable = true;
|
||||
convco.enable = true;
|
||||
cargo-test = {
|
||||
enable = true;
|
||||
name = "cargo-test";
|
||||
entry = "cargo test";
|
||||
# types = ["rust"];
|
||||
# language = "rust";
|
||||
pass_filenames = false;
|
||||
stages = ["pre-commit"];
|
||||
};
|
||||
clippy.enable = true;
|
||||
rustfmt.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{pkgs, ...}: rec {
|
||||
my-package = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "my-binary";
|
||||
version = "0.1.0";
|
||||
|
||||
/*
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
clang
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
];
|
||||
*/
|
||||
|
||||
src = ./..;
|
||||
hash = pkgs.lib.fakeHash;
|
||||
cargoHash = pkgs.lib.fakeHash;
|
||||
};
|
||||
|
||||
default = my-package;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (pkgs) system;
|
||||
in rec {
|
||||
my-package-dev = pkgs.mkShell {
|
||||
inherit (self.checks.${system}.git-hooks) shellHook;
|
||||
inputsFrom = [self.packages.${system}.my-package];
|
||||
packages = with pkgs; [
|
||||
convco
|
||||
rustPackages.clippy
|
||||
typescript-language-server
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
nixd
|
||||
lldb
|
||||
];
|
||||
};
|
||||
default = my-package-dev;
|
||||
}
|
Loading…
Reference in a new issue