restructed modules for home and work, untested
This commit is contained in:
24
profiles/personal/apps.nix
Normal file
24
profiles/personal/apps.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
ffmpeg
|
||||
flac
|
||||
librewolf
|
||||
tea
|
||||
yt-dlp
|
||||
];
|
||||
|
||||
homebrew.brews = [
|
||||
"nicotine-plus"
|
||||
];
|
||||
|
||||
homebrew.casks = [
|
||||
"cap"
|
||||
"discord"
|
||||
"docker-desktop"
|
||||
"libreoffice"
|
||||
"protonvpn"
|
||||
"rustdesk"
|
||||
]
|
||||
}
|
||||
45
profiles/personal/archive-installs.nix
Normal file
45
profiles/personal/archive-installs.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
stampDir = "/usr/local/share/nix-pkg-stamps";
|
||||
|
||||
apps = [
|
||||
{
|
||||
name = "removemacai-app";
|
||||
app = "RemoveMacAI.app";
|
||||
url = "https://github.com/omlahore/RemoveMacAI/releases/download/v1.1.4/RemoveMacAI.zip";
|
||||
sha256 = "2063d4dc7e0b41b15cebcd9e1b9807b04615b96e3e23db35cbd1196be3c96bee";
|
||||
}
|
||||
];
|
||||
|
||||
appScript = a:
|
||||
let
|
||||
src = pkgs.fetchurl { inherit (a) url sha256; };
|
||||
in ''
|
||||
stamp="${stampDir}/${a.name}"
|
||||
want="${src}"
|
||||
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
|
||||
echo "installing ${a.name}..."
|
||||
tmp=$(mktemp -d)
|
||||
if /usr/bin/unzip -q "$want" -d "$tmp"; then
|
||||
if [ -d "$tmp/${a.app}" ]; then
|
||||
rm -rf "/Applications/${a.app}"
|
||||
/usr/bin/ditto "$tmp/${a.app}" "/Applications/${a.app}"
|
||||
mkdir -p "${stampDir}"
|
||||
echo "$want" > "$stamp"
|
||||
else
|
||||
echo "${a.name}: ${a.app} not found in zip, skipping"
|
||||
fi
|
||||
else
|
||||
echo "${a.name}: could not unzip, skipping"
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.postActivation.text =
|
||||
lib.concatStringsSep "\n" (
|
||||
(map appScript apps)
|
||||
);
|
||||
}
|
||||
23
profiles/personal/cli-tools.nix
Normal file
23
profiles/personal/cli-tools.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
environment.shellAliases = {
|
||||
yt = "yt-dlp";
|
||||
};
|
||||
|
||||
environment.etc."yt-dlp.conf".text = ''
|
||||
-o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s
|
||||
--no-mtime
|
||||
--restrict-filenames
|
||||
--embed-thumbnail
|
||||
--embed-metadata
|
||||
--format "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
|
||||
--merge-output-format mp4
|
||||
'';
|
||||
|
||||
system.activationScripts.postActivation.text = ''
|
||||
if [ -x /opt/homebrew/bin/defaultbrowser ]; then
|
||||
sudo -u briannelson /opt/homebrew/bin/defaultbrowser librewolf || echo "could not set deffault browser, skipping"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
9
profiles/personal/default.nix
Normal file
9
profiles/personal/default.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./cli-tools.nix
|
||||
./apps.nix
|
||||
./archive-installs.nix
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user