Compare commits
2 Commits
b4ce55c151
...
e3706e95f8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3706e95f8 | ||
|
|
ee735ee782 |
45
archive-installs.nix
Normal file
45
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)
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,27 +1,6 @@
|
|||||||
{ inputs, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
cupsadminPkg = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/kfattic/cupsadmin/releases/download/v1.4.1/cupsadmin-1.4.1.pkg";
|
|
||||||
hash = "sha256-DyIyDYSjAlcU7ivyfldMapIZw5nczEBXfnLicnK6k7Y=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
system.activationScripts.postActivation.text = ''
|
|
||||||
want="${cupsadminPkg}"
|
|
||||||
stamp=/usr/local/share/cupsadmin-pkg.stamp
|
|
||||||
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
|
|
||||||
echo "installing cupsadmin..."
|
|
||||||
if /usr/sbin/installer -pkg "$want" -target /; then
|
|
||||||
mkdir -p /usr/local/share
|
|
||||||
echo "$want" > "$stamp"
|
|
||||||
else
|
|
||||||
echo "cupsadmin install failed, skipping"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
yt = "yt-dlp";
|
yt = "yt-dlp";
|
||||||
ll = "ls -la";
|
ll = "ls -la";
|
||||||
@@ -33,15 +12,21 @@ in
|
|||||||
email = brian@briannelson.dev
|
email = brian@briannelson.dev
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.etc."yt-dlp.conf".text = ''
|
environment.etc."yt-dlp.conf".text = ''
|
||||||
-o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s
|
-o /Users/briannelson/Downloads/yt-dlp/%(title)s.%(ext)s
|
||||||
--no-mtime
|
--no-mtime
|
||||||
--restrict-filenames
|
--restrict-filenames
|
||||||
--embed-thumbnails
|
--embed-thumbnail
|
||||||
--embed-metadata
|
--embed-metadata
|
||||||
--format "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
|
--format "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
|
||||||
--merge-output-format mp4
|
--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
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,17 @@
|
|||||||
{ config, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./cli-tools.nix
|
./cli-tools.nix
|
||||||
./mac-settings.nix
|
./mac-settings.nix
|
||||||
|
./pkg-installs.nix
|
||||||
|
./archive-installs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
|
|
||||||
nixpkgs.config.problems.handlers = {
|
|
||||||
live555.broken = "warn";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.enable = false;
|
|
||||||
|
|
||||||
nix.settings.experimental-features = "nix-command flakes";
|
nix.settings.experimental-features = "nix-command flakes";
|
||||||
|
|
||||||
nixpkgs.config.allowUnsupportedSystem = true;
|
|
||||||
|
|
||||||
system.stateVersion = 6;
|
system.stateVersion = 6;
|
||||||
system.primaryUser = "briannelson";
|
system.primaryUser = "briannelson";
|
||||||
|
|
||||||
@@ -29,7 +23,6 @@
|
|||||||
git
|
git
|
||||||
helix
|
helix
|
||||||
librewolf
|
librewolf
|
||||||
nicotine-plus
|
|
||||||
tea
|
tea
|
||||||
yt-dlp
|
yt-dlp
|
||||||
];
|
];
|
||||||
@@ -43,7 +36,9 @@
|
|||||||
|
|
||||||
brews = [
|
brews = [
|
||||||
"bun"
|
"bun"
|
||||||
|
"defaultbrowser"
|
||||||
"harper"
|
"harper"
|
||||||
|
"nicotine-plus"
|
||||||
"rust"
|
"rust"
|
||||||
"ykman"
|
"ykman"
|
||||||
];
|
];
|
||||||
|
|||||||
85
flake.lock
generated
Normal file
85
flake.lock
generated
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"brew-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1793000687,
|
||||||
|
"narHash": "sha256-8mCor0DDjNhi+0e+FllfqiMABujBl+/RxYW+wgMpcto=",
|
||||||
|
"owner": "Homebrew",
|
||||||
|
"repo": "brew",
|
||||||
|
"rev": "c6069d2a943b71b0a90d91fc1ac93cb9c1634dcc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Homebrew",
|
||||||
|
"ref": "7.0.11",
|
||||||
|
"repo": "brew",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix-darwin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1792800221,
|
||||||
|
"narHash": "sha256-53jIZEWNh96irEXhsMZFoNhLJgGSU3nYl1i4wFQHAsU=",
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"rev": "d31953cf55f9027a56e9be938daf5db8c5655663",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-darwin",
|
||||||
|
"ref": "nix-darwin-26.05",
|
||||||
|
"repo": "nix-darwin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nix-homebrew": {
|
||||||
|
"inputs": {
|
||||||
|
"brew-src": "brew-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1793543863,
|
||||||
|
"narHash": "sha256-oDYLVD8KGT/M57c8HziYSSj0le4wCyA+jZ7+/qUS91M=",
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"repo": "nix-homebrew",
|
||||||
|
"rev": "52bc87da3f30c2261a6d1cfef3c892097b53daeb",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "zhaofengli",
|
||||||
|
"repo": "nix-homebrew",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1793976852,
|
||||||
|
"narHash": "sha256-bWDN3JZcE9ovYoaD0/6WYbMtXYpUu0vd5onpK0pc/SE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "57f1c8965649ce5bcac5118a0d2e41f1fbdc56e5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-26.05-darwin",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nix-darwin": "nix-darwin",
|
||||||
|
"nix-homebrew": "nix-homebrew",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
11
flake.nix
11
flake.nix
@@ -2,20 +2,14 @@
|
|||||||
description = "Brian's macOS nix-darwin configuration";
|
description = "Brian's macOS nix-darwin configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin";
|
||||||
nix-darwin.url = "github:nix-darwin/nix-darwin";
|
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
|
||||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
|
||||||
|
|
||||||
cupsadmin = {
|
|
||||||
url = "github:kfattic/cupsadmin";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: {
|
outputs = inputs@{ self, nix-darwin, nixpkgs, nix-homebrew, ... }: {
|
||||||
darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem {
|
darwinConfigurations."Brians-MacBook-Air" = nix-darwin.lib.darwinSystem {
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
nix-homebrew.darwinModules.nix-homebrew
|
||||||
@@ -24,7 +18,6 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
enableRosetta = true;
|
enableRosetta = true;
|
||||||
user = "briannelson";
|
user = "briannelson";
|
||||||
autoMigrate = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# This is a WIP, this file is not yet imported to the config
|
|
||||||
{ ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
33
pkg-installs.nix
Normal file
33
pkg-installs.nix
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# Add one entry per program you want to install from a .pkg file
|
||||||
|
pkgInstalls = [
|
||||||
|
{
|
||||||
|
name = "cupsadmin";
|
||||||
|
url = "https://github.com/kfattic/cupsadmin/releases/download/v1.4.1/cupsadmin-1.4.1.pkg";
|
||||||
|
hash = "sha256-DyIyDYSjAlcU7ivyfldMapIZw5nczEBXfnLicnK6k7Y=";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
installScript = p:
|
||||||
|
let
|
||||||
|
src = pkgs.fetchurl { inherit (p) url hash; };
|
||||||
|
in ''
|
||||||
|
stamp="/usr/local/share/nix-pkg-stamps/${p.name}"
|
||||||
|
want="${src}"
|
||||||
|
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
|
||||||
|
echo "installing ${p.name}..."
|
||||||
|
if /usr/sbin/installer -pkg "$want" -target /; then
|
||||||
|
mkdir -p /usr/local/share/nix-pkg-stamps
|
||||||
|
echo "$want" > "$stamp"
|
||||||
|
else
|
||||||
|
echo "${p.name} install failed, skipping"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
system.activationScripts.postActivation.text =
|
||||||
|
lib.concatMapStringsSep "\n" installScript pkgInstalls;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user