I need help

This commit is contained in:
Daniel Flanagan 2023-10-03 11:23:30 -05:00
parent c113949cb0
commit 3d62eaafd7
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
12 changed files with 205 additions and 120 deletions

View file

@ -19,6 +19,36 @@
"url": "ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git" "url": "ssh://gitea@git.lyte.dev/lytedev/api.lyte.dev.git"
} }
}, },
"crane": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [
"helix",
"nixpkgs"
],
"rust-overlay": [
"helix",
"rust-overlay"
]
},
"locked": {
"lastModified": 1688772518,
"narHash": "sha256-ol7gZxwvgLnxNSZwFTDJJ49xVY5teaSvF7lzlo3YQfM=",
"owner": "ipetkov",
"repo": "crane",
"rev": "8b08e96c9af8c6e3a2b69af5a7fa168750fcf88e",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
@ -38,6 +68,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -57,6 +103,24 @@
} }
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": { "locked": {
"lastModified": 1644229661, "lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
@ -71,6 +135,28 @@
"type": "github" "type": "github"
} }
}, },
"helix": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1696295907,
"narHash": "sha256-GFeo5NpbFQjVeu2lv/B/pfZY/+SIt0KRHjh26s0bXAY=",
"owner": "helix-editor",
"repo": "helix",
"rev": "75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b",
"type": "github"
},
"original": {
"owner": "helix-editor",
"repo": "helix",
"rev": "75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -140,6 +226,22 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1690272529,
"narHash": "sha256-MakzcKXEdv/I4qJUtq/k/eG+rVmyOZLnYNC2w1mB59Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ef99fa5c5ed624460217c31ac4271cfb5cb2502c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1696275311, "lastModified": 1696275311,
"narHash": "sha256-Z8aJvoUyMv/+0G7iqYIqecxRDFbz05RK2e3/irbWq9M=", "narHash": "sha256-Z8aJvoUyMv/+0G7iqYIqecxRDFbz05RK2e3/irbWq9M=",
@ -154,7 +256,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1694760568, "lastModified": 1694760568,
"narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=", "narHash": "sha256-3G07BiXrp2YQKxdcdms22MUx6spc6A++MSePtatCYuI=",
@ -174,15 +276,41 @@
"inputs": { "inputs": {
"api-lyte-dev": "api-lyte-dev", "api-lyte-dev": "api-lyte-dev",
"disko": "disko", "disko": "disko",
"helix": "helix",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"utils": "utils" "utils": "utils"
} }
}, },
"rust-overlay": {
"inputs": {
"flake-utils": [
"helix",
"flake-utils"
],
"nixpkgs": [
"helix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1690424156,
"narHash": "sha256-Bpml+L280tHTQpwpC5/BJbU4HSvEzMvW8IZ4gAXimhE=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "f335a0213504c7e6481c359dc1009be9cf34432c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_5",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
@ -214,9 +342,24 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": { "utils": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2" "flake-utils": "flake-utils_3"
}, },
"locked": { "locked": {
"lastModified": 1696272629, "lastModified": 1696272629,

View file

@ -12,6 +12,7 @@
disko.url = "github:nix-community/disko/master"; disko.url = "github:nix-community/disko/master";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
helix.url = "github:helix-editor/helix/75c0a5ceb32d8a503915a93ccc1b64c8ad1cba8b";
# TODO: hyprland.url = "github:hyprwm/Hyprland"; # TODO: hyprland.url = "github:hyprwm/Hyprland";
}; };

View file

@ -1,28 +1,25 @@
inputs: inputs:
let
mkHome = system: modules:
let
overlay = final: prev: {
helix = prev.helix // inputs.helix.packages.${system}.helix;
};
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ] ++ modules;
};
in
{ {
daniel = daniel = mkHome "x86_64-linux" [
let ./home/user.nix
system = "x86_64-linux"; ./home/linux.nix
pkgs = import inputs.nixpkgs { inherit system; }; ];
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home/user.nix
./home/linux.nix
];
};
daniel-work = daniel-work = mkHome "aarch64-darwin" [
let ./home/user.nix
system = "aarch64-darwin"; ./home/work.nix
pkgs = import inputs.nixpkgs { inherit system; }; ];
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home/user.nix
./home/work.nix
];
};
} }

View file

@ -29,9 +29,6 @@ in
# kubectl, aws # kubectl, aws
pkgs.rtx pkgs.rtx
# text editor
pkgs.helix
# I need gawk for my fish prompt # I need gawk for my fish prompt
pkgs.gawk pkgs.gawk
@ -159,6 +156,7 @@ in
helix = { helix = {
enable = true; enable = true;
package = pkgs.helix;
languages = { languages = {
language-server = { language-server = {
lexical = { lexical = {

View file

@ -137,5 +137,14 @@
driSupport = true; driSupport = true;
}; };
}; };
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
} }

View file

@ -25,18 +25,18 @@ in
{ {
# TODO: disko-fy rascal and beefcake? # TODO: disko-fy rascal and beefcake?
# beefcake = nixosSystem "x86_64-linux" [ beefcake = nixosSystem "x86_64-linux" [
# ./nixos/beefcake.nix ./nixos/beefcake.nix
# inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev
# ]; ];
# rascal = nixosSystem "x86_64-linux" [ ./nixos/rascal.nix ]; rascal = nixosSystem "x86_64-linux" [ ./nixos/rascal.nix ];
# musicbox = nixosSystem "x86_64-linux" (disko musicbox = nixosSystem "x86_64-linux" (disko
# { {
# scheme = "unencrypted"; scheme = "unencrypted";
# disks = [ "/dev/sda" ]; disks = [ "/dev/sda" ];
# } ++ [ ./nixos/musicbox.nix ]); } ++ [ ./nixos/musicbox.nix ]);
thinker = nixosSystem "x86_64-linux" (disko thinker = nixosSystem "x86_64-linux" (disko
{ {

View file

@ -16,6 +16,7 @@ in
systemPackages = with pkgs; [ systemPackages = with pkgs; [
age age
bat bat
bc
bind bind
bottom bottom
btrfs-progs btrfs-progs
@ -49,6 +50,7 @@ in
sops sops
smartmontools smartmontools
sqlite sqlite
sysstat
unzip unzip
watchexec watchexec
wget wget
@ -150,13 +152,16 @@ in
trusted-users = [ "root" "daniel" ]; trusted-users = [ "root" "daniel" ];
experimental-features = lib.mkDefault [ "nix-command" "flakes" ]; experimental-features = lib.mkDefault [ "nix-command" "flakes" ];
substituters = [ substituters = [
"https://nix.h.lyte.dev"
"https://nix-community.cachix.org"
"https://cache.nixos.org/" "https://cache.nixos.org/"
"https://helix.cachix.org"
"https://nix-community.cachix.org"
"https://nix.h.lyte.dev"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0=" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
]; ];
}; };
}; };

View file

@ -1,4 +1,4 @@
{ modulesPath, lib, ... }: { { modulesPath, lib, pkgs, ... }: {
imports = imports =
[ [
../modules/amd.nix ../modules/amd.nix
@ -22,6 +22,13 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
services.printing.enable = true; services.printing.enable = true;
environment = {
systemPackages = with pkgs; [
radeontop
];
};
networking = { networking = {
firewall = { firewall = {
enable = true; enable = true;

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
# TODO: helper for taking a data structure and building bash args?

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
# TODO: check for oathtool
key="$1"; shift
args=("$@")
oathtool --totp=sha1 -b "$key" "${args[@]}"

View file

@ -1,56 +0,0 @@
#!/usr/bin/env fish
# deps: fish, zstd, gpg, ssh
set -q HOST || set HOST (head -n 1 /etc/hostname | tr -d '\n')
# use the backup-host in the ~/.ssh/config as the default backup remote host
set -q BACKUP_REMOTE_HOST || set BACKUP_REMOTE_HOST backup-host
# use a user-specific dir by default to backup to
set -q BACKUP_REMOTE_DIR || set BACKUP_REMOTE_DIR "/storage/"(whoami)"/backups/$HOST"
set BACKUP_FILE_EXT .tar.zstd.gpg
set target $argv[1]
if test $target = '--list-backup-files'
ssh $BACKUP_REMOTE_HOST "command ls -1 $BACKUP_REMOTE_DIR"
exit 0
else if test (count $argv) -lt 1
echo "No remote backup filename provided (use --list-backup-files to show)"
exit 1
end
ssh $BACKUP_REMOTE_HOST "echo 1" &>/dev/null || begin
echo "Cannot ssh to $BACKUP_REMOTE_HOST"
exit 6
end
ssh $BACKUP_REMOTE_HOST "test -d $BACKUP_REMOTE_DIR/$target" || begin
echo "Remote directory $BACKUP_REMOTE_DIR/$target does not exist on $BACKUP_REMOTE_HOST (use --list-backup-files to show)"
exit 5
end
# TODO: autocomplete?
# TODO: checksum?
# TODO: progress indicator?
set local_dir (echo $target | awk -F. '{print $1}')
mkdir $local_dir || begin
echo "Local unbackup directory '$local_dir' exists"
exit 2
end
pushd $local_dir >/dev/null
ssh $BACKUP_REMOTE_HOST "cat $BACKUP_REMOTE_DIR/$target" |
gpg --decrypt 2>/dev/null |
zstd --ultra -T2 -22 -dc |
tar -xf - || begin
echo "Failed to stream backup"
exit 4
end
popd >/dev/null
echo "Restored to $local_dir"

View file

@ -1,8 +0,0 @@
#!/usr/bin/env bash
# TODO: get the proper monitor!
BAR_MONITOR="$(polybar --list-monitors | tail -n 1 | sed -n 's/^\s*\(.*\):.*$/\1/p')"
bspc config -m "${BAR_MONITOR}" bottom_padding "0"
bspc config -m "${BAR_MONITOR}" top_padding "0"
killall -q polybar
while pgrep -x polybar >/dev/null; do sleep 1; done