mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 20:10:14 +00:00
Compare commits
27 Commits
legacy
...
fea0396dce
Author | SHA1 | Date | |
---|---|---|---|
fea0396dce | |||
13014e6cc1 | |||
640e447006 | |||
595a02383e | |||
3689f8ef52 | |||
ab6a339c34 | |||
e6456d7f02 | |||
fb74122458 | |||
d56a48cf65 | |||
30fe7c2d18 | |||
08716d1c98 | |||
60b68785a9 | |||
c360460d80 | |||
b1b5e77f47 | |||
67af160088 | |||
80d0451ff3 | |||
0ba2492c61 | |||
3dd7fa12b0 | |||
741692e6f1 | |||
7a547f99c0 | |||
18c9e1efc8 | |||
ac3d5e495c | |||
252b3d5dac | |||
6d0b0e3560 | |||
48d33a9ef5 | |||
c08f08692b | |||
a8d1369c49 |
27
flake.lock
generated
27
flake.lock
generated
@ -69,6 +69,26 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1677116397,
|
||||||
|
"narHash": "sha256-2OHwhv4k1SDEuNxhq+zluvrd5pbW8d4TP9NKW4B8iO8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "8fddb2fd721365fa77ff68b709539639d4dc65d7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"firefox-darwin": {
|
"firefox-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
@ -281,11 +301,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1676110339,
|
"lastModified": 1676973346,
|
||||||
"narHash": "sha256-kOS/L8OOL2odpCOM11IevfHxcUeE0vnZUQ74EOiwXcs=",
|
"narHash": "sha256-rft8oGMocTAhUVqG3LW6I8K/Fo9ICGmNjRqaWTJwav0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e5530aba13caff5a4f41713f1265b754dc2abfd8",
|
"rev": "d0d55259081f0b97c828f38559cad899d351cad1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -396,6 +416,7 @@
|
|||||||
"bufferline-nvim-src": "bufferline-nvim-src",
|
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||||
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
|
"disko": "disko",
|
||||||
"firefox-darwin": "firefox-darwin",
|
"firefox-darwin": "firefox-darwin",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
|
@ -29,6 +29,12 @@
|
|||||||
# Use official Firefox binary for macOS
|
# Use official Firefox binary for macOS
|
||||||
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||||
|
|
||||||
|
# Manage disk format and partitioning
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# Wallpapers
|
# Wallpapers
|
||||||
wallpapers = {
|
wallpapers = {
|
||||||
url = "gitlab:exorcist365/wallpapers";
|
url = "gitlab:exorcist365/wallpapers";
|
||||||
@ -146,6 +152,8 @@
|
|||||||
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
diskoConfigurations = { swan = import ./hosts/swan/disks.nix; };
|
||||||
|
|
||||||
# Package servers into images with a generator
|
# Package servers into images with a generator
|
||||||
packages = forAllSystems (system: {
|
packages = forAllSystems (system: {
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The Staff
|
# The Staff
|
||||||
# ISO configuration for my USB drive
|
# ISO configuration for my USB drive
|
||||||
|
|
||||||
{ inputs, system, ... }:
|
{ inputs, system, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
@ -9,9 +9,39 @@ nixos-generators.nixosGenerate {
|
|||||||
inherit system;
|
inherit system;
|
||||||
format = "install-iso";
|
format = "install-iso";
|
||||||
modules = [{
|
modules = [{
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
networking.hostName = "staff";
|
networking.hostName = "staff";
|
||||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
||||||
];
|
];
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 22 ];
|
||||||
|
allowSFTP = true;
|
||||||
|
settings = {
|
||||||
|
GatewayPorts = "no";
|
||||||
|
X11Forwarding = false;
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
PermitRootLogin = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages =
|
||||||
|
let pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||||
|
in with pkgs; [
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
(import ../../modules/common/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
# colors = import ../../colorscheme/gruvbox.dark.neovimConfig {
|
||||||
|
# inherit pkgs;
|
||||||
|
# };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
nix.extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
warn-dirty = false
|
||||||
|
'';
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ darwin.lib.darwinSystem {
|
|||||||
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
|
charm.enable = true;
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
mail.enable = true;
|
mail.enable = true;
|
||||||
mail.aerc.enable = true;
|
mail.aerc.enable = true;
|
||||||
@ -42,7 +43,7 @@ darwin.lib.darwinSystem {
|
|||||||
python.enable = true;
|
python.enable = true;
|
||||||
lua.enable = true;
|
lua.enable = true;
|
||||||
kubernetes.enable = true;
|
kubernetes.enable = true;
|
||||||
"1password".enable = true;
|
_1password.enable = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,20 @@ nixpkgs.lib.nixosSystem {
|
|||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./disks.nix
|
||||||
../../modules/common
|
../../modules/common
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
(removeAttrs globals [ "mail.server" ])
|
(removeAttrs globals [ "mail.server" ])
|
||||||
wsl.nixosModules.wsl
|
wsl.nixosModules.wsl
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
|
disko.nixosModules.disko
|
||||||
{
|
{
|
||||||
server = true;
|
server = true;
|
||||||
|
zfs.enable = true;
|
||||||
|
|
||||||
|
# head -c 8 /etc/machine-id
|
||||||
|
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||||
|
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
@ -34,14 +41,14 @@ nixpkgs.lib.nixosSystem {
|
|||||||
|
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
|
|
||||||
boot.zfs.enabled = true;
|
# boot.zfs.enabled = true;
|
||||||
boot.kernelPackages =
|
# boot.kernelPackages =
|
||||||
config.boot.zfs.package.latestCompatibleLinuxPackages;
|
# config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
boot.zfs.extraPools = [ "mypool" ];
|
# boot.zfs.extraPools = [ "mypool" ];
|
||||||
services.zfs.autoScrub.enable = true;
|
# services.zfs.autoScrub.enable = true;
|
||||||
services.zfs.autoScrub.interval = "daily";
|
# services.zfs.autoScrub.interval = "daily";
|
||||||
|
|
||||||
services.nfs.server.enable = true;
|
# services.nfs.server.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
172
hosts/swan/disks.nix
Normal file
172
hosts/swan/disks.nix
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
{ ... }: {
|
||||||
|
disko.enableConfig = false;
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
boot = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/nvme0n1";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "ESP";
|
||||||
|
start = "0";
|
||||||
|
end = "512MiB";
|
||||||
|
fs-type = "fat32";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
extraArgs = [ "-n boot" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "root";
|
||||||
|
start = "512MiB";
|
||||||
|
end = "100%";
|
||||||
|
part-type = "primary";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
extraArgs = [ "-L nixos" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sda = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sda";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [{
|
||||||
|
type = "partition";
|
||||||
|
name = "zfs";
|
||||||
|
start = "128MiB";
|
||||||
|
end = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "tank";
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sdb = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sdb";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [{
|
||||||
|
type = "partition";
|
||||||
|
name = "zfs";
|
||||||
|
start = "128MiB";
|
||||||
|
end = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "tank";
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sdc = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/sdc";
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [{
|
||||||
|
type = "partition";
|
||||||
|
name = "zfs";
|
||||||
|
start = "128MiB";
|
||||||
|
end = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "tank";
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
tank = {
|
||||||
|
type = "zpool";
|
||||||
|
mode = "raidz1";
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "on"; # lz4 by default
|
||||||
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
ashift = "12";
|
||||||
|
};
|
||||||
|
# mountpoint = "/";
|
||||||
|
|
||||||
|
datasets = {
|
||||||
|
media = {
|
||||||
|
zfs_type = "filesystem";
|
||||||
|
mountpoint = "/media";
|
||||||
|
options."com.sun:auto-snapshot" = "false";
|
||||||
|
};
|
||||||
|
# "media/movies" = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# mountpoint = "/media/movies";
|
||||||
|
# options.recordsize = "1M";
|
||||||
|
# };
|
||||||
|
# "media/tv" = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# mountpoint = "/media/tv";
|
||||||
|
# options.recordsize = "1M";
|
||||||
|
# };
|
||||||
|
# "media/books" = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# mountpoint = "/media/books";
|
||||||
|
# };
|
||||||
|
# archive = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# mountpoint = "/archive";
|
||||||
|
# options.compression = "zstd";
|
||||||
|
# options."com.sun:auto-snapshot" = "true";
|
||||||
|
# };
|
||||||
|
# zfs_unmounted_fs = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# options.mountpoint = "none";
|
||||||
|
# };
|
||||||
|
# zfs_legacy_fs = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# options.mountpoint = "legacy";
|
||||||
|
# mountpoint = "/zfs_legacy_fs";
|
||||||
|
# };
|
||||||
|
# zfs_testvolume = {
|
||||||
|
# zfs_type = "volume";
|
||||||
|
# size = "10M";
|
||||||
|
# content = {
|
||||||
|
# type = "filesystem";
|
||||||
|
# format = "ext4";
|
||||||
|
# mountpoint = "/ext4onzfs";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# encrypted = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# size = "20M";
|
||||||
|
# options = {
|
||||||
|
# mountpoint = "none";
|
||||||
|
# encryption = "aes-256-gcm";
|
||||||
|
# keyformat = "passphrase";
|
||||||
|
# keylocation = "file:///tmp/secret.key";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# "encrypted/test" = {
|
||||||
|
# zfs_type = "filesystem";
|
||||||
|
# size = "2M";
|
||||||
|
# mountpoint = "/zfs_crypted";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
39
hosts/swan/hardware-configuration.nix
Normal file
39
hosts/swan/hardware-configuration.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules =
|
||||||
|
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
hardware.cpu.intel.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
@ -33,6 +33,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
wsl.enable = false;
|
wsl.enable = false;
|
||||||
publicKey = null;
|
publicKey = null;
|
||||||
|
|
||||||
|
charm.enable = true;
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
media.enable = true;
|
media.enable = true;
|
||||||
firefox.enable = true;
|
firefox.enable = true;
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by size | reverse | keep 10
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls **/* | where type == File | sort-by size | reverse | keep 10
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Stop all containers
|
|
||||||
if [ "$(docker ps -a -q)" ]; then
|
|
||||||
echo "Stopping docker containers..."
|
|
||||||
docker stop "$(docker ps -a -q)"
|
|
||||||
else
|
|
||||||
echo "No running docker containers."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove all stopped containers
|
|
||||||
if [ "$(docker ps -a -q)" ]; then
|
|
||||||
echo "Removing docker containers..."
|
|
||||||
docker rm "$(docker ps -a -q)"
|
|
||||||
else
|
|
||||||
echo "No stopped docker containers."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove all untagged images
|
|
||||||
if [[ $(docker images | grep "^<none>") ]]; then
|
|
||||||
docker rmi "$(docker images | grep "^<none>" | awk '{print $3}')"
|
|
||||||
else
|
|
||||||
echo "No untagged docker images."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Cleaned up docker."
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
|
||||||
# Requires the following variables to be set:
|
|
||||||
# - ATLASSIAN_EMAIL
|
|
||||||
# - ATLASSIAN_API_TOKEN
|
|
||||||
# - JIRA_HOSTNAME
|
|
||||||
# - JIRA_PROJECT
|
|
||||||
|
|
||||||
choose_issue() {
|
|
||||||
jq_template='"\(.key): \(.fields.summary)"'
|
|
||||||
query="project=$JIRA_PROJECT AND status not in (\"Done\") AND assignee=currentUser()"
|
|
||||||
|
|
||||||
branch_name=$(
|
|
||||||
curl \
|
|
||||||
--data-urlencode "jql=$query" \
|
|
||||||
--get \
|
|
||||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
|
||||||
--silent \
|
|
||||||
--compressed \
|
|
||||||
"https://$JIRA_HOSTNAME/rest/api/2/search" |
|
|
||||||
jq ".issues[] | $jq_template" |
|
|
||||||
sed -e 's/"\(.*\)"/\1/' |
|
|
||||||
fzf \
|
|
||||||
--preview='jira-details {1}' \
|
|
||||||
--preview-window=top:wrap |
|
|
||||||
sed -e 's/: /:/' -e 's/[^a-zA-Z0-9:]/-/g' |
|
|
||||||
awk -F ":" '{printf "%s/%s", $1, tolower($2)}'
|
|
||||||
)
|
|
||||||
|
|
||||||
echo "$branch_name"
|
|
||||||
}
|
|
||||||
|
|
||||||
issue_branch=$(choose_issue)
|
|
||||||
if [ -n "$issue_branch" ]; then
|
|
||||||
echo "git checkout -b \"$issue_branch\""
|
|
||||||
fi
|
|
@ -1,38 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
|
||||||
# Requires the following variables to be set:
|
|
||||||
# - ATLASSIAN_EMAIL
|
|
||||||
# - ATLASSIAN_API_TOKEN
|
|
||||||
# - JIRA_HOSTNAME
|
|
||||||
# - JIRA_PROJECT (for other script)
|
|
||||||
|
|
||||||
issue_details() {
|
|
||||||
jira_key=$(echo "$1" | cut -d":" -f1)
|
|
||||||
jq_template='"'\
|
|
||||||
'# \(.key): \(.fields.summary)\n'\
|
|
||||||
'\n'\
|
|
||||||
'*Created*: \(.fields.created)\n'\
|
|
||||||
'*Status*: \(.fields.status.statusCategory.name)\n'\
|
|
||||||
'*Reporter*: \(.fields.reporter.displayName)\n'\
|
|
||||||
'*Priority*: \(.fields.priority.name)\n'\
|
|
||||||
"*Epic*: https://$JIRA_HOSTNAME/browse/\(.fields.customfield_10014)\n"\
|
|
||||||
'\n'\
|
|
||||||
'## Link\n\n'\
|
|
||||||
"https://$JIRA_HOSTNAME/browse/\(.key)\n"\
|
|
||||||
'\n'\
|
|
||||||
'## Description\n\n'\
|
|
||||||
'\(.fields.description)'\
|
|
||||||
'"'
|
|
||||||
curl \
|
|
||||||
--get \
|
|
||||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
|
||||||
--silent \
|
|
||||||
--compressed \
|
|
||||||
"https://$JIRA_HOSTNAME/rest/api/2/issue/$jira_key" |
|
|
||||||
jq "$jq_template" |
|
|
||||||
xargs printf |
|
|
||||||
bat -l md --color always --style plain
|
|
||||||
}
|
|
||||||
|
|
||||||
issue_details "$1"
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
kubectl -n kube-system get secret "$(
|
|
||||||
kubectl -n kube-system get secret |
|
|
||||||
grep dashboard-admin |
|
|
||||||
awk '{print $1}'
|
|
||||||
)" -o json |
|
|
||||||
jq -j --raw-output '.data.token' |
|
|
||||||
base64 --decode |
|
|
||||||
pbcopy
|
|
||||||
|
|
||||||
open http://localhost:8001/api/v1/namespaces/default/services/https:kubernetes-dashboard:https/proxy/#!/login
|
|
||||||
|
|
||||||
kubectl proxy
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by modified | reverse | keep 5
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by modified | keep 5
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Credit: https://github.com/junegunn/fzf/blob/master/ADVANCED.md
|
|
||||||
|
|
||||||
read -ra tokens < <(
|
|
||||||
kubectl get pods --all-namespaces |
|
|
||||||
fzf --info=inline --layout=reverse --header-lines=1 --border \
|
|
||||||
--prompt "$(kubectl config current-context | sed 's/-context$//')> " \
|
|
||||||
--header $'Press CTRL-O to open log in editor\n\n' \
|
|
||||||
--bind ctrl-/:toggle-preview \
|
|
||||||
--bind "ctrl-o:execute:${EDITOR:-vim} <(kubectl logs --namespace {1} {2}) > /dev/tty" \
|
|
||||||
--preview-window up,follow \
|
|
||||||
--preview 'kubectl logs --follow --tail=100000 --namespace {1} {2}' "$@"
|
|
||||||
)
|
|
||||||
[ ${#tokens} -gt 1 ] &&
|
|
||||||
kubectl exec -it --namespace "${tokens[0]}" "${tokens[1]}" -- /bin/sh
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls -al | where type == Symlink | select name target
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
|
||||||
|
|
||||||
urldecode "$@"
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>Label</key>
|
|
||||||
<string>com.noah.newsboat</string>
|
|
||||||
|
|
||||||
<key>ProgramArguments</key>
|
|
||||||
<array>
|
|
||||||
<string>/usr/local/bin/newsboat -x reload</string>
|
|
||||||
</array>
|
|
||||||
|
|
||||||
<key>Nice</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
|
|
||||||
<key>StartInterval</key>
|
|
||||||
<integer>1800</integer>
|
|
||||||
|
|
||||||
<key>RunAtLoad</key>
|
|
||||||
<false/>
|
|
||||||
|
|
||||||
<key>StandardErrorPath</key>
|
|
||||||
<string>/tmp/newsboat.err</string>
|
|
||||||
|
|
||||||
<key>StandardOutPath</key>
|
|
||||||
<string>/tmp/newsboat.out</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||||||
browser "$BROWSER %u"
|
|
||||||
prepopulate-query-feeds yes
|
|
||||||
feed-sort-order lastupdated
|
|
||||||
reload-only-visible-feeds yes
|
|
||||||
text-width 72
|
|
||||||
|
|
||||||
bind-key j down
|
|
||||||
bind-key k up
|
|
||||||
bind-key j next articlelist
|
|
||||||
bind-key k prev articlelist
|
|
||||||
bind-key G end
|
|
||||||
bind-key g home
|
|
||||||
bind-key d pagedown
|
|
||||||
bind-key u pageup
|
|
||||||
bind-key n next-unread
|
|
||||||
bind-key p prev-unread
|
|
||||||
bind-key ; macro-prefix
|
|
||||||
bind-key B bookmark
|
|
||||||
bind-key f edit-flags
|
|
||||||
|
|
||||||
macro v set browser "mpv %u"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro p set browser "echo %u"; one; set browser "$BROWSER %u"
|
|
||||||
macro H set browser "clx view $(echo %u | cut -d '=' -f2)"; one; set browser "$BROWSER %u"
|
|
||||||
macro h set browser "clx view $(echo %u | cut -d '=' -f2)"; two; set browser "$BROWSER %u"
|
|
||||||
macro w set browser "w3m -o confirm_qq=false %u"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro r set browser "url-markdown %u | glow -p -w 72 -"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro d set browser "youtube-dl -o ~/Downloads/%(title)s.%(ext)s %u &"; open-in-browser-noninteractively; set browser "$BROWSER %u"
|
|
||||||
macro n set-tag News; reload-all
|
|
||||||
macro a set-tag All
|
|
||||||
macro e set-tag Reddit; reload-all
|
|
||||||
macro y set-tag YouTube; reload-all
|
|
||||||
|
|
||||||
bookmark-cmd "bookmark"
|
|
||||||
|
|
||||||
highlight article "^(Feed|Title|Author|Link|Date):.*" color243 default
|
|
||||||
highlight article "^(Links):.*" color243 default
|
|
||||||
highlight article "^(\\[[0-9]+\\]):.*" color243 default
|
|
||||||
highlight article "^(\\[[0-9]+\\])" color243 default
|
|
||||||
highlight article "^\\[.*\\]$" color243 default
|
|
||||||
highlight article "^(Title:).*" color249 default
|
|
@ -1,137 +0,0 @@
|
|||||||
# Setup Nix
|
|
||||||
|
|
||||||
# We need to distinguish between single-user and multi-user installs.
|
|
||||||
# This is difficult because there's no official way to do this.
|
|
||||||
# We could look for the presence of /nix/var/nix/daemon-socket/socket but this will fail if the
|
|
||||||
# daemon hasn't started yet. /nix/var/nix/daemon-socket will exist if the daemon has ever run, but
|
|
||||||
# I don't think there's any protection against accidentally running `nix-daemon` as a user.
|
|
||||||
# We also can't just look for /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh because
|
|
||||||
# older single-user installs used the default profile instead of a per-user profile.
|
|
||||||
# We can still check for it first, because all multi-user installs should have it, and so if it's
|
|
||||||
# not present that's a pretty big indicator that this is a single-user install. If it does exist,
|
|
||||||
# we still need to verify the install type. To that end we'll look for a root owner and sticky bit
|
|
||||||
# on /nix/store. Multi-user installs set both, single-user installs don't. It's certainly possible
|
|
||||||
# someone could do a single-user install as root and then manually set the sticky bit but that
|
|
||||||
# would be extremely unusual.
|
|
||||||
|
|
||||||
set -l nix_profile_path /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
||||||
set -l single_user_profile_path ~/.nix-profile/etc/profile.d/nix.sh
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# The path exists. Double-check that this is a multi-user install.
|
|
||||||
# We can't just check for ~/.nix-profile/… because this may be a single-user install running as
|
|
||||||
# the wrong user.
|
|
||||||
|
|
||||||
# stat is not portable. Splitting the output of ls -nd is reliable on most platforms.
|
|
||||||
set -l owner (string split -n ' ' (command ls -nd /nix/store 2>/dev/null))[3]
|
|
||||||
if not test -k /nix/store -a $owner -eq 0
|
|
||||||
# /nix/store is either not owned by root or not sticky. Assume single-user.
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# The path doesn't exist. Assume single-user
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# Source the nix setup script
|
|
||||||
# We're going to run the regular Nix profile under bash and then print out a few variables
|
|
||||||
for line in (command env -u BASH_ENV bash -c '. "$0"; for name in PATH "${!NIX_@}"; do printf "%s=%s\0" "$name" "${!name}"; done' $nix_profile_path | string split0)
|
|
||||||
set -xg (string split -m 1 = $line)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Insert Nix's fish share directories into fish's special variables.
|
|
||||||
# nixpkgs-installed fish tries to set these up already if NIX_PROFILES is defined, which won't
|
|
||||||
# be the case when sourcing $__fish_data_dir/share/config.fish normally, but might be for a
|
|
||||||
# recursive invocation. To guard against that, we'll only insert paths that don't already exit.
|
|
||||||
# Furthermore, for the vendor_conf.d sourcing, we'll use the pre-existing presence of a path in
|
|
||||||
# $fish_function_path to determine whether we want to source the relevant vendor_conf.d folder.
|
|
||||||
|
|
||||||
# To start, let's locally define NIX_PROFILES if it doesn't already exist.
|
|
||||||
set -al NIX_PROFILES
|
|
||||||
if test (count $NIX_PROFILES) -eq 0
|
|
||||||
set -a NIX_PROFILES $HOME/.nix-profile
|
|
||||||
end
|
|
||||||
# Replicate the logic from nixpkgs version of $__fish_data_dir/__fish_build_paths.fish.
|
|
||||||
set -l __nix_profile_paths (string split ' ' -- $NIX_PROFILES)[-1..1]
|
|
||||||
set -l __extra_completionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/completions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_completions.d
|
|
||||||
set -l __extra_functionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/functions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_functions.d
|
|
||||||
set -l __extra_confdir \
|
|
||||||
$__nix_profile_paths/etc/fish/conf.d \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_conf.d
|
|
||||||
### Configure fish_function_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
# Record the equivalent __extra_confdir path for any function path that exists.
|
|
||||||
set -l existing_conf_paths
|
|
||||||
for path in $__extra_functionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_function_path)
|
|
||||||
set -e fish_function_path[$idx]
|
|
||||||
set -a existing_conf_paths $__extra_confdir[(contains --index -- $path $__extra_functionsdir)]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/functions $fish_function_path)
|
|
||||||
# Fish has no way to simply insert into the middle of an array.
|
|
||||||
set -l new_path $fish_function_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_functionsdir
|
|
||||||
set fish_function_path $new_path $fish_function_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_function_path $__extra_functionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Configure fish_complete_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
for path in $__extra_completionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_complete_path)
|
|
||||||
set -e fish_complete_path[$idx]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/completions $fish_complete_path)
|
|
||||||
set -l new_path $fish_complete_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_completionsdir
|
|
||||||
set fish_complete_path $new_path $fish_complete_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_complete_path $__extra_completionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Source conf directories ###
|
|
||||||
# The built-in directories were already sourced during shell initialization.
|
|
||||||
# Any __extra_confdir that came from $__fish_data_dir/__fish_build_paths.fish was also sourced.
|
|
||||||
# As explained above, we're using the presence of pre-existing paths in $fish_function_path as a
|
|
||||||
# signal that the corresponding conf dir has also already been sourced.
|
|
||||||
# In order to simulate this, we'll run through the same algorithm as found in
|
|
||||||
# $__fish_data_dir/config.fish except we'll avoid sourcing the file if it comes from an
|
|
||||||
# already-sourced location.
|
|
||||||
# Caveats:
|
|
||||||
# * Files will be sourced in a different order than we'd ideally do (because we're coming in
|
|
||||||
# after the fact to source them).
|
|
||||||
# * If there are existing extra conf paths, files in them may have been sourced that should have
|
|
||||||
# been suppressed by paths we're inserting in front.
|
|
||||||
# * Similarly any files in $__fish_data_dir/vendor_conf.d that should have been suppressed won't
|
|
||||||
# have been.
|
|
||||||
set -l sourcelist
|
|
||||||
for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish
|
|
||||||
# We know these paths were sourced already. Just record them.
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
or set -a sourcelist $basename
|
|
||||||
end
|
|
||||||
for root in $__extra_confdir
|
|
||||||
for file in $root/*.fish
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
and continue
|
|
||||||
set -a sourcelist $basename
|
|
||||||
contains -- $root $existing_conf_paths
|
|
||||||
and continue # this is a pre-existing path, it will have been sourced already
|
|
||||||
[ -f $file -a -r $file ]
|
|
||||||
and source $file
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,168 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
|
|
||||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
|
||||||
|
|
||||||
echo "Automatically show and hide the dock"
|
|
||||||
defaults write com.apple.dock autohide -bool true
|
|
||||||
|
|
||||||
echo "Automatically show and hide the menu bar"
|
|
||||||
defaults write NSGlobalDomain _HIHideMenuBar -bool true
|
|
||||||
|
|
||||||
echo "Make Dock icons of hidden applications translucent"
|
|
||||||
defaults write com.apple.dock showhidden -bool true
|
|
||||||
|
|
||||||
echo "Use current directory as default search scope in Finder"
|
|
||||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
|
||||||
|
|
||||||
echo "Expand save panel by default"
|
|
||||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
|
||||||
|
|
||||||
echo "Expand print panel by default"
|
|
||||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
|
||||||
|
|
||||||
echo "Disable the \"Are you sure you want to open this application?\" dialog"
|
|
||||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
|
||||||
|
|
||||||
echo "Enable highlight hover effect for the grid view of a stack (Dock)"
|
|
||||||
defaults write com.apple.dock mouse-over-hilte-stack -bool true
|
|
||||||
|
|
||||||
echo "Enable spring loading for all Dock items"
|
|
||||||
defaults write enable-spring-load-actions-on-all-items -bool true
|
|
||||||
|
|
||||||
echo "Disable press-and-hold for keys in favor of key repeat"
|
|
||||||
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
|
||||||
defaults write -g ApplePressAndHoldEnabled -bool false
|
|
||||||
|
|
||||||
echo "Set a blazingly fast keyboard repeat rate"
|
|
||||||
defaults write NSGlobalDomain KeyRepeat -int 2
|
|
||||||
|
|
||||||
echo "Set a shorter Delay until key repeat"
|
|
||||||
defaults write NSGlobalDomain InitialKeyRepeat -int 12
|
|
||||||
|
|
||||||
echo "Disable disk image verification"
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
|
||||||
|
|
||||||
echo "Avoid creating .DS_Store files on network volumes"
|
|
||||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
|
||||||
|
|
||||||
echo "Disable the warning when changing a file extension"
|
|
||||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
|
||||||
|
|
||||||
# echo "Enable snap-to-grid for desktop icons"
|
|
||||||
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
|
||||||
|
|
||||||
echo "Disable the warning before emptying the Trash"
|
|
||||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
|
||||||
|
|
||||||
echo "Disable tap to click (Trackpad)"
|
|
||||||
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool false
|
|
||||||
|
|
||||||
echo "Enable Safari’s debug menu"
|
|
||||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
|
||||||
|
|
||||||
echo "Make Safari’s search banners default to Contains instead of Starts With"
|
|
||||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
|
||||||
|
|
||||||
echo "Add a context menu item for showing the Web Inspector in web views"
|
|
||||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
|
||||||
|
|
||||||
echo "Save to disk (not to iCloud) by default"
|
|
||||||
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
|
|
||||||
|
|
||||||
echo "Disable automatic capitalization as it’s annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable smart dashes as they’re annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable automatic period substitution as it’s annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable smart quotes as they’re annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable auto-correct"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Use scroll gesture with the Ctrl (^) modifier key to zoom"
|
|
||||||
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
|
|
||||||
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
|
|
||||||
echo "Follow the keyboard focus while zoomed in"
|
|
||||||
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
|
||||||
|
|
||||||
echo "Require password immediately after sleep or screen saver begins"
|
|
||||||
defaults write com.apple.screensaver askForPassword -int 1
|
|
||||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
|
||||||
|
|
||||||
echo "Save screenshots to downloads"
|
|
||||||
defaults write com.apple.screencapture location -string "${HOME}/Downloads"
|
|
||||||
|
|
||||||
echo "Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons"
|
|
||||||
defaults write com.apple.finder QuitMenuItem -bool true
|
|
||||||
|
|
||||||
echo "Show the ~/Library folder"
|
|
||||||
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
|
|
||||||
|
|
||||||
# Noah Prefs
|
|
||||||
echo "Enable dock magnification"
|
|
||||||
defaults write com.apple.dock magnification -bool true
|
|
||||||
|
|
||||||
echo "Set dock size"
|
|
||||||
defaults write com.apple.dock largesize -int 48
|
|
||||||
defaults write com.apple.dock tilesize -int 44
|
|
||||||
|
|
||||||
echo "Choose and order dock icons"
|
|
||||||
__dock_item() {
|
|
||||||
printf '%s%s%s%s%s' \
|
|
||||||
'<dict><key>tile-data</key><dict><key>file-data</key><dict>' \
|
|
||||||
'<key>_CFURLString</key><string>' \
|
|
||||||
"$1" \
|
|
||||||
'</string><key>_CFURLStringType</key><integer>0</integer>' \
|
|
||||||
'</dict></dict></dict>'
|
|
||||||
}
|
|
||||||
|
|
||||||
defaults write com.apple.dock persistent-apps -array \
|
|
||||||
"$(__dock_item /Applications/1Password\ 7.app)" \
|
|
||||||
"$(__dock_item /Applications/Slack.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Calendar.app)" \
|
|
||||||
"$(__dock_item /Applications/Firefox.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Messages.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Mail.app)" \
|
|
||||||
"$(__dock_item /Applications/Mimestream.app)" \
|
|
||||||
"$(__dock_item /Applications/zoom.us.app)" \
|
|
||||||
"$(__dock_item /Applications/Obsidian.app)" \
|
|
||||||
"$(__dock_item /Applications/Alacritty.app)" \
|
|
||||||
"$(__dock_item /System/Applications/System\ Preferences.app)"
|
|
||||||
|
|
||||||
echo "No recent items in dock"
|
|
||||||
defaults write com.apple.dock show-recents -bool FALSE
|
|
||||||
|
|
||||||
echo "Switch to dark mode"
|
|
||||||
defaults write "Apple Global Domain" "AppleInterfaceStyle" "Dark"
|
|
||||||
|
|
||||||
echo "Turn on Scroll Reverser"
|
|
||||||
open /Applications/Scroll\ Reverser.app
|
|
||||||
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}'
|
|
||||||
|
|
||||||
echo "Allow apps from anywhere"
|
|
||||||
SPCTL=$(spctl --status)
|
|
||||||
if ! [ "$SPCTL" = "assessments disabled" ]
|
|
||||||
then
|
|
||||||
sudo spctl --master-disable
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ---
|
|
||||||
|
|
||||||
echo "Reset Launchpad"
|
|
||||||
# [ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db
|
|
||||||
rm ~/Library/Application\ Support/Dock/*.db
|
|
||||||
|
|
||||||
echo "Show the ~/Library folder"
|
|
||||||
chflags nohidden ~/Library
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
echo "Kill affected applications"
|
|
||||||
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
npm update -g
|
|
||||||
npm install -g pyright
|
|
||||||
npm install -g diagnostic-languageserver
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
install_rust() {
|
|
||||||
if ! (which ~/.cargo/bin/rustup > /dev/null)
|
|
||||||
then
|
|
||||||
echo "installing rustup"
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "rustup ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
update_rust() {
|
|
||||||
~/.cargo/bin/rustup update > /dev/null 2>&1
|
|
||||||
rust_version=$(~/.cargo/bin/rustc --version | awk '{print $2}')
|
|
||||||
|
|
||||||
echo "latest rust: $rust_version ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
download_rust_analyzer() {
|
|
||||||
if ! (which rust-analyzer > /dev/null)
|
|
||||||
then
|
|
||||||
echo "downloading rust analyzer"
|
|
||||||
rust_analyzer_bin=/usr/local/bin/rust-analyzer
|
|
||||||
curl -s -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin
|
|
||||||
chmod +x $rust_analyzer_bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "rust-analyzer ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
# cargo-edit: quickly add and remove packages
|
|
||||||
# whatfeatures: see optional features for a package
|
|
||||||
install_cargos() {
|
|
||||||
set -- \
|
|
||||||
'cargo-edit' \
|
|
||||||
'cargo-whatfeatures'
|
|
||||||
for program do
|
|
||||||
cargo install "$program"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "cargos ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
install_rust
|
|
||||||
update_rust
|
|
||||||
download_rust_analyzer
|
|
||||||
install_cargos
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "downloading cheatsheet"
|
|
||||||
curl https://cht.sh/:cht.sh > ~/.local/bin/cheat
|
|
||||||
chmod 755 ~/.local/bin/cheat
|
|
||||||
echo "cheatsheet ✓"
|
|
@ -1,46 +0,0 @@
|
|||||||
#!/usr/bin/env fish
|
|
||||||
|
|
||||||
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
|
||||||
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
|
||||||
set -U CDPATH . $HOME # Directories available for immediate cd
|
|
||||||
set -Ux EDITOR nvim # Preferred text editor
|
|
||||||
set -U PROJ $HOME/dev/work # Projects directory
|
|
||||||
set -Ux NOTES_PATH "$HOME/dev/personal/notes" # Notes directory
|
|
||||||
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
|
||||||
set -Ux DIRENV_LOG_FORMAT "" # Disable direnv output
|
|
||||||
set -Ux BROWSER "/Applications/Firefox.app/Contents/MacOS/firefox"
|
|
||||||
|
|
||||||
# Load abbreviations
|
|
||||||
abbrs
|
|
||||||
|
|
||||||
# Turn off greeting
|
|
||||||
set -U fish_greeting ""
|
|
||||||
|
|
||||||
# Set colors (Base16 Eighties)
|
|
||||||
set -U fish_color_normal normal
|
|
||||||
set -U fish_color_command 99cc99
|
|
||||||
set -U fish_color_quote ffcc66
|
|
||||||
set -U fish_color_redirection d3d0c8
|
|
||||||
set -U fish_color_end cc99cc
|
|
||||||
set -U fish_color_error f2777a
|
|
||||||
set -U fish_color_selection white --bold --background=brblack
|
|
||||||
set -U fish_color_search_match bryellow --background=brblack
|
|
||||||
set -U fish_color_history_current --bold
|
|
||||||
set -U fish_color_operator 6699cc
|
|
||||||
set -U fish_color_escape 66cccc
|
|
||||||
set -U fish_color_cwd green
|
|
||||||
set -U fish_color_cwd_root red
|
|
||||||
set -U fish_color_valid_path --underline
|
|
||||||
set -U fish_color_autosuggestion 747369
|
|
||||||
set -U fish_color_user brgreen
|
|
||||||
set -U fish_color_host normal
|
|
||||||
set -U fish_color_cancel -r
|
|
||||||
set -U fish_pager_color_completion normal
|
|
||||||
set -U fish_pager_color_description B3A06D yellow
|
|
||||||
set -U fish_pager_color_prefix white --bold --underline
|
|
||||||
set -U fish_pager_color_progress brwhite --background=cyan
|
|
||||||
set -U fish_color_comment ffcc66
|
|
||||||
set -U fish_color_param d3d0c8
|
|
||||||
set -U fish_color_match 6699cc
|
|
||||||
|
|
||||||
echo "fish setup ✓"
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "downloading ytfzf"
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
curl -sL "https://raw.githubusercontent.com/pystardust/ytfzf/master/ytfzf" >~/.local/bin/ytfzf
|
|
||||||
chmod 755 ~/.local/bin/ytfzf
|
|
||||||
echo "ytfzf ✓"
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRole
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
verbs: []
|
|
@ -1,12 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name:
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
annotations:
|
|
||||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
|
||||||
data:
|
|
@ -1,33 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app:
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app:
|
|
||||||
spec:
|
|
||||||
serviceAccountName:
|
|
||||||
containers:
|
|
||||||
- name:
|
|
||||||
image:
|
|
||||||
imagePullPolicy: Always
|
|
||||||
envFrom:
|
|
||||||
- configMapRef:
|
|
||||||
name:
|
|
||||||
- secretRef:
|
|
||||||
name:
|
|
||||||
ports:
|
|
||||||
- containerPort:
|
|
||||||
protocol: TCP
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu:
|
|
||||||
requests:
|
|
||||||
cpu:
|
|
@ -1,21 +0,0 @@
|
|||||||
apiVersion: networking.k8s.io/v1beta1 # must be beta until k8s 1.19
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
kubernetes.io/ingress.class: alb
|
|
||||||
alb.ingress.kubernetes.io/group.name:
|
|
||||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
|
|
||||||
alb.ingress.kubernetes.io/scheme: internet-facing
|
|
||||||
alb.ingress.kubernetes.io/security-groups:
|
|
||||||
alb.ingress.kubernetes.io/tags: Project=
|
|
||||||
alb.ingress.kubernetes.io/target-type: instance
|
|
||||||
name:
|
|
||||||
namespace:
|
|
||||||
spec:
|
|
||||||
rules:
|
|
||||||
- host:
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- backend:
|
|
||||||
serviceName:
|
|
||||||
servicePort:
|
|
@ -1,10 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resourceNames:
|
|
||||||
resources:
|
|
||||||
verbs:
|
|
@ -1,13 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
roleRef:
|
|
||||||
kind:
|
|
||||||
name:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
subjects:
|
|
||||||
- kind:
|
|
||||||
name:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
annotations:
|
|
||||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
|
||||||
data:
|
|
@ -1,15 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
alb.ingress.kubernetes.io/healthcheck-path:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 443
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: 80
|
|
||||||
selector:
|
|
||||||
app:
|
|
||||||
type: NodePort
|
|
@ -1,5 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""
|
|
||||||
Program
|
|
||||||
"""
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""Run the program"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
|
||||||
cat <<EOH
|
|
||||||
Help text
|
|
||||||
EOH
|
|
||||||
exit
|
|
||||||
fi
|
|
@ -6,10 +6,10 @@
|
|||||||
pkgs.vimPlugins.null-ls-nvim
|
pkgs.vimPlugins.null-ls-nvim
|
||||||
];
|
];
|
||||||
|
|
||||||
use.lspconfig.sumneko_lua.setup = dsl.callWith {
|
use.lspconfig.lua_ls.setup = dsl.callWith {
|
||||||
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
||||||
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
cmd = [ "${pkgs.sumneko-lua-language-server}/bin/lua-language-server" ];
|
cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.nil_ls.setup = dsl.callWith {
|
use.lspconfig.nil_ls.setup = dsl.callWith {
|
||||||
|
@ -14,7 +14,13 @@
|
|||||||
[ "writeBoundary" ] ''
|
[ "writeBoundary" ] ''
|
||||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||||
$DRY_RUN_CMD ${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
|
||||||
|
# Force HTTPS because anonymous SSH doesn't work
|
||||||
|
GIT_CONFIG_COUNT=1 \
|
||||||
|
GIT_CONFIG_KEY_0="url.https://github.com/.insteadOf" \
|
||||||
|
GIT_CONFIG_VALUE_0="git@github.com:" \
|
||||||
|
$DRY_RUN_CMD \
|
||||||
|
${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ in {
|
|||||||
tealdeer # Cheatsheets
|
tealdeer # Cheatsheets
|
||||||
tree # View directory hierarchy
|
tree # View directory hierarchy
|
||||||
htop # Show system processes
|
htop # Show system processes
|
||||||
glow # Pretty markdown previews
|
|
||||||
qrencode # Generate qr codes
|
qrencode # Generate qr codes
|
||||||
vimv-rs # Batch rename files
|
vimv-rs # Batch rename files
|
||||||
dig # DNS lookup
|
dig # DNS lookup
|
||||||
|
@ -16,5 +16,6 @@
|
|||||||
driSupport = true;
|
driSupport = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
};
|
};
|
||||||
|
programs.gamemode.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,7 @@
|
|||||||
boot.supportedFilesystems =
|
boot.supportedFilesystems =
|
||||||
lib.mkIf (config.physical && pkgs.stdenv.isLinux) [ "ntfs" ];
|
lib.mkIf (config.physical && pkgs.stdenv.isLinux) [ "ntfs" ];
|
||||||
|
|
||||||
|
# Use latest released Linux kernel by default
|
||||||
|
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
./server.nix
|
./server.nix
|
||||||
./sleep.nix
|
./sleep.nix
|
||||||
./wifi.nix
|
./wifi.nix
|
||||||
|
./zfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
@ -4,9 +4,17 @@
|
|||||||
|
|
||||||
# Prevent wake from keyboard
|
# Prevent wake from keyboard
|
||||||
powerManagement.powerDownCommands = ''
|
powerManagement.powerDownCommands = ''
|
||||||
for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done
|
# for power in /sys/bus/usb/devices/*/power; do echo disabled > ''${power}/wakeup; done
|
||||||
|
|
||||||
|
# AMD issue: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Instantaneous_wakeups_from_suspend
|
||||||
|
for power in /sys/bus/i2c/devices/i2c-*/device/power; do echo disabled > ''${power}/wakeup; done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# From here: https://www.reddit.com/r/NixOS/comments/wcu34f/how_would_i_do_this_in_nix/
|
||||||
|
# services.udev.extraRules = ''
|
||||||
|
# ACTION=="add", SUBSYSTEM=="i2c", ATTRS{idVendor}=="<vendor>", ATTRS{idProduct}=="<product>" RUN+="${pkgs.bash}/bin/bash -c 'echo disabled > /sys/bus/i2c/devices/i2c-*/power/wakeup'"
|
||||||
|
# '';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
16
modules/nixos/hardware/zfs.nix
Normal file
16
modules/nixos/hardware/zfs.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options = { zfs.enable = lib.mkEnableOption "ZFS file system."; };
|
||||||
|
|
||||||
|
config =
|
||||||
|
lib.mkIf (pkgs.stdenv.isLinux && config.server && config.zfs.enable) {
|
||||||
|
|
||||||
|
# Only use compatible Linux kernel, since ZFS can be behind
|
||||||
|
boot.kernelPackages =
|
||||||
|
config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
|
boot.kernelParams = [ "nohibernate" ];
|
||||||
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -17,11 +17,13 @@
|
|||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = [ 22 ];
|
ports = [ 22 ];
|
||||||
passwordAuthentication = false;
|
|
||||||
gatewayPorts = "no";
|
|
||||||
forwardX11 = false;
|
|
||||||
allowSFTP = true;
|
allowSFTP = true;
|
||||||
permitRootLogin = config.permitRootLogin;
|
settings = {
|
||||||
|
GatewayPorts = "no";
|
||||||
|
X11Forwarding = false;
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
PermitRootLogin = config.permitRootLogin;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.${config.user}.openssh.authorizedKeys.keys =
|
users.users.${config.user}.openssh.authorizedKeys.keys =
|
||||||
|
Reference in New Issue
Block a user