added cupsadmin as input and native build
This commit is contained in:
@@ -1,6 +1,22 @@
|
|||||||
{ config, ... }:
|
{ inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
system.activationScripts.postActivation.text = ''
|
||||||
|
stamp=/usr/local/share/cupsadmin.stamp
|
||||||
|
want="${inputs.cupsadmin}"
|
||||||
|
if [ "$(cat "$stamp" 2>/dev/null)" != "$want" ]; then
|
||||||
|
echo "building cupsadmin..."
|
||||||
|
tmp=$(mktmp -d)
|
||||||
|
cp -R "$want"/. "$tmp"
|
||||||
|
chmod -R u+w "$tmp"
|
||||||
|
( cd "$tmp" && /user/bin/swift build -c release ) \
|
||||||
|
&& install -m 755 "$tmp/.build/release/cupsadmin" /usr/local/bin/cupsadmin \
|
||||||
|
&& mkdir -p /usr/local/share && echo #$want" > "$stamp" \
|
||||||
|
|| echo "cupsadmin build failed, skipping"
|
||||||
|
rm -rf "$tmp"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
yt = "yt-dlp";
|
yt = "yt-dlp";
|
||||||
ll = "ls -la";
|
ll = "ls -la";
|
||||||
|
|||||||
@@ -6,10 +6,16 @@
|
|||||||
nix-darwin.url = "github:nix-darwin/nix-darwin";
|
nix-darwin.url = "github:nix-darwin/nix-darwin";
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user