aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschererleander <leander@schererleander.de>2025-05-08 14:24:55 +0200
committerschererleander <leander@schererleander.de>2025-05-08 14:24:55 +0200
commite0bea314193d32fb3a2fd79dffccbc5468baa91e (patch)
tree4a3eeb2a6e87f3052899f0ffab762048a1c82586
parent67fbdc5148475abcdbb5030298a1db80b7853605 (diff)
add programs
-rw-r--r--flake.nix4
-rw-r--r--hosts/darwin/configuration.nix1
-rw-r--r--overlays/minbrowser.nix78
3 files changed, 83 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index 0a72e70..f5fab7d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -23,10 +23,14 @@
username = "schererleander";
email = "leander@schererleander.de";
desktop = "nixos";
+ pkgs = import nixpkgs {
+ overlays = [ (import ./overlays/minbrowser.nix) ];
+ };
in {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = linux-system;
specialArgs = { inherit inputs; };
+ pkgs = pkgs;
modules = [
./hosts/nixos/configuration.nix
diff --git a/hosts/darwin/configuration.nix b/hosts/darwin/configuration.nix
index e3e7372..2dad61e 100644
--- a/hosts/darwin/configuration.nix
+++ b/hosts/darwin/configuration.nix
@@ -18,6 +18,7 @@
];
casks = [
"nextcloud"
+ "bambu-studio"
];
};
diff --git a/overlays/minbrowser.nix b/overlays/minbrowser.nix
new file mode 100644
index 0000000..6017c90
--- /dev/null
+++ b/overlays/minbrowser.nix
@@ -0,0 +1,78 @@
+{
+ lib,
+ stdenv,
+ fetchurl,
+
+ dpkg,
+ autoPatchelfHook,
+
+ libxkbcommon,
+ libxcb,
+ xorg,
+ alsa-lib,
+ nss,
+ at-spi2-core,
+ mesa,
+ cairo,
+ pango,
+ cups,
+ gtk3,
+ glib,
+
+ nix-update-script,
+}:
+
+stdenv.mkDerivation (finalAttrs: let
+ system = stdenv.hostPlatform.system;
+
+ asset = if lib.strings.hasPrefix "x86_64-linux" system then {
+ url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-${finalAttrs.version}-amd64.deb";
+ sha256 = "sha256-gpkjGYuHwBY3IwK5bXhzIPPosSTZ67hclmGLT4PTsG4=";
+ } else if system == "x86_64-darwin" then {
+ url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-v${finalAttrs.version}-mac-x86_64.zip";
+ sha256 = "";
+ } else if system == "aarch64-darwin" then {
+ url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-v${finalAttrs.version}-mac-arm64.zip";
+ sha256 = "";
+ } else throw "Unsupported plattform: ${system}";
+ in {
+ pname = "min";
+ version = "1.34.1";
+
+ src = fetchurl {
+ url = asset.url;
+ hash = asset.sha256;
+ };
+
+ nativeBuildInputs = [ autoPatchelfHook ];
+ nativeBuildInputs = lib.optional (lib.strings.hasPrefix "x86_64-linux" system) dpkg ++ [ autoPatchelHook ];
+
+ buildInputs = [
+ libxkbcommon libxcb at-spi2-core mesa cairo cups gtk3 pango
+ alsa-lib nss glib stdenv.cc.cc.lib
+ ] ++ (with xorg; [ libX11 libXcomposite libXdamage libXext libXfixes libXrandr ]);
+
+ unpackPhase = ''
+ ${lib.optionalString (lib.strings.hasPrefix "x86_64-linux" system) ''
+ dpkg-deb -x $src $out
+ mv $out/usr/share $out
+ ''}
+ ${lib.optionalString (system == "x86_64-darwin" || system == "aarch64-darwin") ''
+ unzip $src -d $out
+ # the zip contains e.g. Min.app; flatten:
+ mv $out/Min.app/Contents/* $out/
+ ''}
+ mkdir -p $out/bin
+ ln -s $out/opt/Min/min $out/bin/min
+ '';
+
+ passthru.updateScript = nix-update-script { };
+
+ meta = {
+ description = "Fast, minimal browser that protects your privacy";
+ homepage = "https://github.com/minbrowser/min";
+ changelog = "https://github.com/minbrowser/min/releases/tag/v${finalAttrs.version}";
+ license = lib.licenses.asl20;
+ maintainers = with lib.maintainers; [ kashw2 ];
+ };
+})