Fix home-manager impurity and add brew configuration

This commit is contained in:
Dave Gallant
2021-06-27 10:34:51 -04:00
parent 860ae35a49
commit 893964169e
18 changed files with 133 additions and 58 deletions

43
modules/darwin/brew.nix Normal file
View File

@@ -0,0 +1,43 @@
{ config, lib, pkgs, ... }:
let
checkBrew = "command -v brew > /dev/null";
in
{
environment = {
extraInit = ''
${checkBrew} || >&2 echo "brew is not installed (install it via https://brew.sh)"
'';
};
homebrew = {
enable = true;
autoUpdate = true;
global = {
brewfile = true;
noLock = true;
};
brews = [
"aws-sam-cli"
"fabianishere/personal/pam_reattach"
"netdata"
];
casks = [
"1password"
"visual-studio-code"
];
taps = [
"aws/tap"
"homebrew/bundle"
"homebrew/cask"
"homebrew/cask-fonts"
"homebrew/cask-versions"
"homebrew/core"
"homebrew/services"
];
};
}

View File

@@ -0,0 +1,6 @@
{ pkgs, ... }: {
imports = [
./brew.nix
./preferences.nix
];
}

View File

@@ -0,0 +1,57 @@
{ config, pkgs, ... }: {
system.defaults = {
loginwindow = {
GuestEnabled = false;
SHOWFULLNAME = false;
};
finder = {
AppleShowAllExtensions = true;
FXEnableExtensionChangeWarning = true;
_FXShowPosixPathInTitle = true;
};
trackpad = {
ActuationStrength = 0;
Clicking = true;
FirstClickThreshold = 1;
SecondClickThreshold = 1;
TrackpadRightClick = false;
};
# firewall
alf = {
# 0 = disabled 1 = enabled 2 = blocks all connections except for essential services
globalstate = 1;
loggingenabled = 0;
stealthenabled = 1;
};
dock = {
autohide = true;
autohide-delay = "0.0";
autohide-time-modifier = "1.0";
tilesize = 50;
static-only = false;
showhidden = false;
show-recents = false;
show-process-indicators = true;
orientation = "bottom";
mru-spaces = false;
};
NSGlobalDomain = {
"com.apple.sound.beep.feedback" = 0;
"com.apple.sound.beep.volume" = "0.000";
ApplePressAndHoldEnabled = false;
# delay before repeating keystrokes
InitialKeyRepeat = 10;
# delay between repeated keystrokes upon holding a key
KeyRepeat = 1;
AppleShowAllExtensions = true;
AppleShowScrollBars = "Automatic";
};
};
}

View File

@@ -0,0 +1,25 @@
{ stdenv, lib, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "aws-connect";
version = "1.0.19";
src = fetchFromGitHub {
owner = "rewindio";
repo = "aws-connect";
rev = "v${version}";
sha256 = "sha256-xS5eRVjbjK/qzaZhNApwghNqnHGqVGWJ4hvgDu4dfDQ=";
};
installPhase = ''
mkdir -p $out/bin
cp ./aws-connect $out/bin
'';
meta = with lib; {
description = "Wrapper script around AWS session manager connections";
homepage = "https://github.com/rewindio/aws-connect";
license = licenses.mit;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,64 @@
{ lib, fetchFromGitHub, python3, substituteAll }:
let
py = python3.override {
packageOverrides = self: super: {
timeago = super.buildPythonPackage rec {
pname = "timeago";
version = "1.0.15";
src = super.fetchPypi {
inherit version pname;
sha256 = "sha256-z85CDYKJKvayQ50Pae6z6Ha77dq2Zww8iOv3Z2QHv0w=";
};
};
inscriptis = super.buildPythonPackage rec {
pname = "inscriptis";
version = "1.2";
propagatedBuildInputs = with py.pkgs; [ lxml requests ];
src = super.fetchPypi {
inherit version pname;
sha256 = "sha256-B2lFW/YwzCVdR8lwV9VGEW9HRfIii8u48Sy0wK+XeWY=";
};
};
};
};
in
with py.pkgs;
buildPythonApplication rec {
pname = "changedetection.io";
version = "0.30";
src = fetchFromGitHub {
owner = "dgtlmoon";
repo = "changedetection.io";
rev = "1d66160e8c9bd3cef8e1727fe66572f8b5065757";
hash = "sha256-J0J6Jj9f2FD2aH4RWR1VnarX1vqnb5T6YmycxhzuyDw=";
};
patches = [ (substituteAll { src = ./setup.patch; }) ];
propagatedBuildInputs = with py.pkgs; [
apprise
chardet
eventlet
feedgen
flask
flask_login
inscriptis
pytest
pytest-flask
pytz
requests
timeago
urllib3
validators
];
meta = with lib; {
description =
"changedetection.io - The best and simplest self-hosted website change detection monitoring service";
homepage = "https://github.com/dgtlmoon/changedetection.io";
license = licenses.asl20;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,20 @@
new file mode 100644
index 0000000..e4db3d0
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+recursive-include backend *
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..82bc34d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,8 @@
+from setuptools import setup, find_packages
+
+setup(
+ name="changedetection.io",
+ include_package_data=True,
+ packages=find_packages(),
+ scripts = [ './changedetection.py' ],
+)

View File

@@ -0,0 +1,11 @@
final: prev: {
aws-connect = prev.callPackage ./aws-connect { };
lpass = prev.callPackage ./lastpass { };
changedetection.io = prev.callPackage ./changedetection.io { };
rfd = prev.callPackage ./rfd { };
srv = prev.callPackage ./srv { };
vpngate = prev.callPackage ./vpngate { };
yar = prev.callPackage ./yar { };
}

View File

@@ -0,0 +1,46 @@
{ stdenv
, lib
, fetchFromGitHub
, asciidoc
, cmake
, docbook_xsl
, pkgconfig
, bash-completion
, curl
, openssl
, libxml2
, libxslt
}:
stdenv.mkDerivation rec {
pname = "lpass";
version = "1.3.4-unreleased";
src = fetchFromGitHub {
owner = "lastpass";
repo = "lastpass-cli";
rev = "8767b5e53192ad4e72d1352db4aa9218e928cbe1";
sha256 = "sha256:1d4m5h9byq5cccdg98m8d8457rbvp28q821d8rpglykgrfgnknwp";
};
nativeBuildInputs = [ asciidoc cmake docbook_xsl pkgconfig ];
buildInputs = [ bash-completion curl openssl libxml2 libxslt ];
enableParallelBuilding = true;
installTargets = [ "install" "install-doc" ];
postInstall = ''
install -Dm644 -T ../contrib/lpass_zsh_completion $out/share/zsh/site-functions/_lpass
install -Dm644 -T ../contrib/completions-lpass.fish $out/share/fish/vendor_completions.d/lpass.fish
'';
meta = with lib; {
description =
"Stores, retrieves, generates, and synchronizes passwords securely";
homepage = "https://github.com/lastpass/lastpass-cli";
license = licenses.gpl2Plus;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,40 @@
{ lib, fetchFromGitHub, python3 }:
let py = python3.override { };
in
with py.pkgs;
buildPythonApplication rec {
pname = "rfd";
version = "v0.7.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "davegallant";
repo = "rfd";
rev = version;
hash = "sha256-imFSkCFeSMLW7QYYF3cXp7tKEruLt8a6W3JDPblKHHU=";
};
# No tests included
doCheck = false;
nativeBuildInputs = [ poetry ];
propagatedBuildInputs = with py.pkgs; [
beautifulsoup4
click
colorama
requests
soupsieve
];
passthru.python3 = python3;
meta = with lib; {
homepage = "https://www.redflagdeals.com/";
description = "View RedFlagDeals from the command line";
license = licenses.gpl3;
maintainers = [ davegallant ];
};
}

View File

@@ -0,0 +1,22 @@
{ lib, fetchFromGitHub, buildGoModule }:
buildGoModule rec {
pname = "srv";
version = "v0.1.2";
vendorSha256 = "sha256-ebumpo9hgr7A+Fsznga4ksYu4mcOIfaaKz0uJu2rivE=";
src = fetchFromGitHub {
owner = "davegallant";
repo = "srv";
rev = version;
sha256 = "sha256-x5l/NFEbbRPMBY061g4qRHYV6QUShO7yHqSw+Hir9M0=";
};
meta = with lib; {
description = "a simple rss viewer";
license = licenses.gpl3;
maintainers = with maintainers; [ davegallant ];
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,24 @@
{ lib, fetchFromGitHub, buildGoModule }:
buildGoModule rec {
pname = "vpngate";
version = "v0.0.2";
vendorSha256 = "1ys2rvrbxgsrvmjdxqgpmxf0m9nlp905gnr2mrf3c7iaxm86wgf8";
src = fetchFromGitHub {
owner = "davegallant";
repo = "vpngate";
rev = version;
sha256 = "0ky3wd04xd4sb2zskrrlbgys2gw88yqhngg3bl0sjy8kr6099vfn";
};
meta = with lib; {
homepage = "https://www.vpngate.net";
description = "a client for vpngate.net";
license = licenses.gpl3;
maintainers = with maintainers; [ davegallant ];
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,22 @@
{ lib, fetchFromGitHub, buildGoModule }:
buildGoModule rec {
pname = "yar";
version = "master";
vendorSha256 = "sha256-bBaAP9HQ1fG6gPtoYg9HXnv53DueAFnT4OHE4rwlxvA=";
src = fetchFromGitHub {
owner = "nielsing";
repo = "yar";
rev = version;
sha256 = "sha256-f7pTS5Ur8ImbIkPkyunyQEgpeF79CIQFEodg69VxA9I=";
};
meta = with lib; {
description = "Yar is a tool for plunderin' organizations, users and/or repositories.";
license = licenses.gpl3;
maintainers = with maintainers; [ davegallant ];
platforms = platforms.linux ++ platforms.darwin;
};
}