mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 19:57:19 +00:00
start conversion to flake-parts
This commit is contained in:
parent
0d8e9ee8ce
commit
f130fd10df
24 changed files with 465 additions and 308 deletions
38
apps/chromium-mac.nix
Normal file
38
apps/chromium-mac.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs:
|
||||||
|
(
|
||||||
|
let
|
||||||
|
versions = {
|
||||||
|
aarch64-darwin = "1101351";
|
||||||
|
x86_64-darwin = "1101350";
|
||||||
|
};
|
||||||
|
|
||||||
|
version = versions.${pkgs.stdenv.hostPlatform.system};
|
||||||
|
|
||||||
|
pname = "chromium";
|
||||||
|
appName = "Chromium";
|
||||||
|
|
||||||
|
srcs = {
|
||||||
|
aarch64-darwin = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac_Arm/${version}/chrome-mac.zip";
|
||||||
|
sha256 = "sha256-LlbYlJmFLzyHIiygofa0Btm7NAOvWXXhmbjMHldVoGo=";
|
||||||
|
name = "${pname}_aarch64_${version}.zip";
|
||||||
|
};
|
||||||
|
x86_64-darwin = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/${version}/chrome-mac.zip";
|
||||||
|
sha256 = "sha256-O+OnjakEpjCRbSjDysEA6RKKaKaSMw+LSO2ZLcxz2vM=";
|
||||||
|
name = "${pname}_x86_64_${version}.zip";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
|
lib.mk-mac-binpkg {
|
||||||
|
inherit pkgs src pname appName version;
|
||||||
|
srcsubdir = "chrome-mac";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
17
apps/firefox-mac.nix
Normal file
17
apps/firefox-mac.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs: (
|
||||||
|
let
|
||||||
|
version = "109.0.1";
|
||||||
|
pname = "firefox";
|
||||||
|
appName = "Firefox";
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/mac/en-CA/Firefox%20${version}.dmg";
|
||||||
|
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
|
||||||
|
name = "${pname}_${version}.dmg";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.mk-mac-binpkg { inherit pkgs src pname appName version; }
|
||||||
|
);
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
43
apps/freecad-mac.nix
Normal file
43
apps/freecad-mac.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs:
|
||||||
|
let
|
||||||
|
version = "0.20.2";
|
||||||
|
date = "2022-12-27";
|
||||||
|
appName = "FreeCAD";
|
||||||
|
pname = "freecad";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://github.com/FreeCAD/FreeCAD/releases/download/${version}/FreeCAD_${version}-${date}-conda-macOS-x86_64-py310.dmg";
|
||||||
|
sha256 = "sha256-OAi98HUacHcLHVYSadnQFPnEhutJvE4YfRBtPSZk00c=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
export tempdir=$(mktemp -d -p /tmp)
|
||||||
|
|
||||||
|
cp $src freecad.dmg
|
||||||
|
/usr/bin/hdiutil attach -mountpoint "$tempdir" freecad.dmg
|
||||||
|
|
||||||
|
mkdir -p $out/Applications
|
||||||
|
|
||||||
|
cp -r "$tempdir/${appName}.app" $out/Applications
|
||||||
|
|
||||||
|
/usr/bin/hdiutil detach "$tempdir"
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
15
apps/pinentry-mac.nix
Normal file
15
apps/pinentry-mac.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs: pkgs.stdenv.mkDerivation {
|
||||||
|
name = "pinentry-mac";
|
||||||
|
src = pkgs.pinentry_mac;
|
||||||
|
installPhase = ''
|
||||||
|
# -*-sh-*-
|
||||||
|
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
|
||||||
|
cp "$src/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac" "$out/bin/pinentry-mac"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
17
apps/qbittorrent-mac.nix
Normal file
17
apps/qbittorrent-mac.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs:
|
||||||
|
let
|
||||||
|
version = "4.4.5";
|
||||||
|
appName = "qBittorrent";
|
||||||
|
pname = "qbittorrent";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg";
|
||||||
|
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.mk-mac-binpkg { inherit pkgs src pname appName version; };
|
||||||
|
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
17
apps/spotify-mac.nix
Normal file
17
apps/spotify-mac.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs:
|
||||||
|
let
|
||||||
|
appName = "Spotify";
|
||||||
|
pname = "spotify";
|
||||||
|
version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://download.scdn.co/Spotify.dmg";
|
||||||
|
hash = version;
|
||||||
|
name = "spotify-mac.dmg";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.mk-mac-binpkg { inherit pkgs src pname appName version; };
|
||||||
|
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
29
apps/vlc-mac.nix
Normal file
29
apps/vlc-mac.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
definition = lib: pkgs:
|
||||||
|
let
|
||||||
|
appName = "VLC";
|
||||||
|
pname = "vlc";
|
||||||
|
version = "3.0.18";
|
||||||
|
srcs = {
|
||||||
|
aarch64-darwin = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-arm64.dmg";
|
||||||
|
sha256 = "sha256-mcJZvbxSIf1QgX9Ri3Dpv57hdeiQdDkDyYB7x3hmj0c=";
|
||||||
|
name = "${pname}_aarch64_${version}.dmg";
|
||||||
|
};
|
||||||
|
x86_64-darwin = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-intel64.dmg";
|
||||||
|
sha256 = "sha256-iO3N/Os70vaANn2QCdOKDBR/p1jy3TleQ0EsHgjOHMs=";
|
||||||
|
name = "${pname}_x86_64_${version}.dmg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
||||||
|
in
|
||||||
|
lib.mk-mac-binpkg {
|
||||||
|
inherit pkgs src pname appName version;
|
||||||
|
};
|
||||||
|
|
||||||
|
systems = [ "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
}
|
||||||
|
|
15
flake-parts/apps.nix
Normal file
15
flake-parts/apps.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ lib, self, inputs, withSystem, ... }: {
|
||||||
|
flake =
|
||||||
|
let
|
||||||
|
buildProgram = system: definition: (withSystem system ({ pkgs, self', ... }: definition self.lib pkgs));
|
||||||
|
createApp = { definition, system }: { type = "app"; program = lib.getExe (buildProgram system definition); };
|
||||||
|
defineApp = system: name: definition: { ${system}.${name} = createApp { definition = definition; system = system; }; };
|
||||||
|
appsDir = self.lib.importDirToAttrs ../apps;
|
||||||
|
builtApps = lib.mapAttrsToList (name: value: (lib.forEach value.systems (system: defineApp system name value.definition))) appsDir;
|
||||||
|
flattened = lib.flatten builtApps;
|
||||||
|
assembled = builtins.foldl' (a: b: lib.recursiveUpdate a b) { } flattened;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
apps = assembled;
|
||||||
|
};
|
||||||
|
}
|
7
flake-parts/default.nix
Normal file
7
flake-parts/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./home-manager
|
||||||
|
./lib
|
||||||
|
./apps.nix
|
||||||
|
];
|
||||||
|
}
|
16
flake-parts/home-manager/configurations.nix
Normal file
16
flake-parts/home-manager/configurations.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{ lib, flake-parts-lib, self, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
inherit (flake-parts-lib) mkTransposedPerSystemModule;
|
||||||
|
in
|
||||||
|
mkTransposedPerSystemModule
|
||||||
|
{
|
||||||
|
name = "homeConfigurations";
|
||||||
|
file = ./configurations.nix;
|
||||||
|
option = mkOption {
|
||||||
|
type = types.lazyAttrsOf types.unspecified;
|
||||||
|
default = { };
|
||||||
|
description = "Home Manager user configurations.";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
38
flake-parts/home-manager/default.nix
Normal file
38
flake-parts/home-manager/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Copyright (c) 2018 Terje Larsen
|
||||||
|
|
||||||
|
# This work is licensed under the terms of the MIT license.
|
||||||
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
|
|
||||||
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/default.nix
|
||||||
|
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
flake-parts-lib,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit
|
||||||
|
(lib)
|
||||||
|
mkOption
|
||||||
|
types
|
||||||
|
;
|
||||||
|
inherit (flake-parts-lib) mkSubmoduleOptions;
|
||||||
|
in {
|
||||||
|
imports = [./modules.nix ./users.nix ./configurations.nix];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
flake = mkSubmoduleOptions {
|
||||||
|
homeManagerModules = mkOption {
|
||||||
|
type = types.lazyAttrsOf types.unspecified;
|
||||||
|
default = {};
|
||||||
|
apply = lib.mapAttrs (k: v: {
|
||||||
|
_file = "${toString self.outPath}/flake.nix#homeManagerModules.${k}";
|
||||||
|
imports = [v];
|
||||||
|
});
|
||||||
|
description = ''
|
||||||
|
Home Manager modules.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
29
flake-parts/home-manager/modules.nix
Normal file
29
flake-parts/home-manager/modules.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Copyright (c) 2018 Terje Larsen
|
||||||
|
|
||||||
|
# This work is licensed under the terms of the MIT license.
|
||||||
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
|
|
||||||
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/home-manager/modules.nix
|
||||||
|
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
flake.homeManagerModules = let
|
||||||
|
modules = self.lib.importDirToAttrs ../../home-manager/modules;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = {
|
||||||
|
imports = builtins.attrValues modules;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs-useFlakeNixpkgs = {
|
||||||
|
home.sessionVariables.NIX_PATH = "nixpkgs=${inputs.nixpkgs}";
|
||||||
|
systemd.user.sessionVariables.NIX_PATH = lib.mkForce "nixpkgs=${inputs.nixpkgs}";
|
||||||
|
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// modules;
|
||||||
|
}
|
26
flake-parts/home-manager/users.nix
Normal file
26
flake-parts/home-manager/users.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ inputs, self, lib, ... }:
|
||||||
|
{
|
||||||
|
perSystem = { pkgs, ... }:
|
||||||
|
let
|
||||||
|
activationPackages = builtins.mapAttrs (_: lib.getAttr "activationPackage") self.homeConfigurations;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
homeConfigurations.willem = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
self.homeManagerModules.profiles-user-willem
|
||||||
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit pkgs;
|
||||||
|
nurNoPkgs = import inputs.nur {
|
||||||
|
nurpkgs = pkgs;
|
||||||
|
pkgs = throw "nixpkgs eval";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
packages = lib.pipe activationPackages [
|
||||||
|
(lib.filterAttrs (_: drv: pkgs.system == drv.system))
|
||||||
|
(lib.mapAttrs' (username: lib.nameValuePair "home-${username}"))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
58
flake-parts/lib/default.nix
Normal file
58
flake-parts/lib/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# Copyright (c) 2018 Terje Larsen
|
||||||
|
|
||||||
|
# This work is licensed under the terms of the MIT license.
|
||||||
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
|
|
||||||
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/lib/default.nix
|
||||||
|
|
||||||
|
{ self
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
flake.lib = {
|
||||||
|
kebabCaseToCamelCase =
|
||||||
|
builtins.replaceStrings (map (s: "-${s}") lib.lowerChars) lib.upperChars;
|
||||||
|
|
||||||
|
importDirToAttrs = dir:
|
||||||
|
lib.pipe dir [
|
||||||
|
lib.filesystem.listFilesRecursive
|
||||||
|
(builtins.filter (lib.hasSuffix ".nix"))
|
||||||
|
(map (path: {
|
||||||
|
name = lib.pipe path [
|
||||||
|
toString
|
||||||
|
(lib.removePrefix "${toString dir}/")
|
||||||
|
(lib.removeSuffix "/default.nix")
|
||||||
|
(lib.removeSuffix ".nix")
|
||||||
|
self.lib.kebabCaseToCamelCase
|
||||||
|
(builtins.replaceStrings [ "/" ] [ "-" ])
|
||||||
|
];
|
||||||
|
value = import path;
|
||||||
|
}))
|
||||||
|
builtins.listToAttrs
|
||||||
|
];
|
||||||
|
|
||||||
|
mk-mac-binpkg = { src, version, pname, appName, pkgs, srcsubdir ? ".", ... }: pkgs.stdenv.mkDerivation {
|
||||||
|
inherit version src;
|
||||||
|
|
||||||
|
name = pname;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.undmg pkgs.unzip pkgs.makeWrapper ];
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/Applications
|
||||||
|
|
||||||
|
cp -r "${srcsubdir}/${appName}.app" $out/Applications
|
||||||
|
|
||||||
|
# wrap executable to $out/bin
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
131
flake.lock
generated
131
flake.lock
generated
|
@ -20,6 +20,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673956053,
|
||||||
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
@ -55,11 +71,11 @@
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"flake-utils_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1642700792,
|
"lastModified": 1667395993,
|
||||||
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -68,6 +84,27 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks-nix",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1660459072,
|
||||||
|
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -89,23 +126,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mach-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"pypi-deps-db": "pypi-deps-db"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 0,
|
|
||||||
"narHash": "sha256-mia90VYv/YTdWNhKpvwvFW9RfbXZJSWhJ+yva6EnLE8=",
|
|
||||||
"path": "/nix/store/rzbap34038bwk7vxgz0zmh9hbgl6h6mr-source",
|
|
||||||
"type": "path"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"id": "mach-nix",
|
|
||||||
"type": "indirect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-apple-silicon": {
|
"nixos-apple-silicon": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -129,17 +149,18 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1643805626,
|
"lastModified": 1677932085,
|
||||||
"narHash": "sha256-AXLDVMG+UaAGsGSpOtQHPIKB+IZ0KSd9WS77aanGzgc=",
|
"narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "554d2d8aa25b6e583575459c297ec23750adb6cb",
|
"rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-unstable",
|
||||||
"type": "indirect"
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
|
@ -160,17 +181,33 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1677932085,
|
"lastModified": 1673800717,
|
||||||
"narHash": "sha256-+AB4dYllWig8iO6vAiGGYl0NEgmMgGHpy9gzWJ3322g=",
|
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
|
||||||
"owner": "nixos",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3c5319ad3aa51551182ac82ea17ab1c6b0f0df89",
|
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-22.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1671271357,
|
||||||
|
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
|
@ -191,19 +228,25 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pypi-deps-db": {
|
"pre-commit-hooks-nix": {
|
||||||
"flake": false,
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661155889,
|
"lastModified": 1678376203,
|
||||||
"narHash": "sha256-t00mBTZhmZBT4jteO6pJbU0wyRS6/ep4pKmQNeztEms=",
|
"narHash": "sha256-3tyYGyC8h7fBwncLZy5nCUjTJPrHbmNwp47LlNLOHSM=",
|
||||||
"owner": "DavHau",
|
"owner": "cachix",
|
||||||
"repo": "pypi-deps-db",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "49c620f3de2b557c9d5c44f58a00fee59f27d1b0",
|
"rev": "1a20b9708962096ec2481eeb2ddca29ed747770a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "DavHau",
|
"owner": "cachix",
|
||||||
"repo": "pypi-deps-db",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -213,10 +256,10 @@
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mach-nix": "mach-nix",
|
|
||||||
"nixos-apple-silicon": "nixos-apple-silicon",
|
"nixos-apple-silicon": "nixos-apple-silicon",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs",
|
||||||
"nur": "nur"
|
"nur": "nur",
|
||||||
|
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
|
|
91
flake.nix
91
flake.nix
|
@ -12,90 +12,21 @@
|
||||||
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
|
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
|
||||||
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
|
nixos-apple-silicon.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
|
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, darwin, flake-utils, home-manager, mach-nix, nixos-apple-silicon, nixpkgs, nur, ... }:
|
outputs = inputs:
|
||||||
let
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
pkgsfunc = ({ system, overlays ? [ ] }: import nixpkgs
|
imports = [
|
||||||
{
|
./flake-parts
|
||||||
inherit system;
|
|
||||||
overlays = [ (import ./overlays) ] ++ overlays;
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
packageOverrides = pkgs: {
|
|
||||||
nur = import nur { inherit pkgs; nurpkgs = pkgs; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
user-config = (pkgs: {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.extraSpecialArgs = {
|
|
||||||
inherit pkgs;
|
|
||||||
nurNoPkgs = import nur {
|
|
||||||
nurpkgs = pkgs;
|
|
||||||
pkgs = throw "nixpkgs eval";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
home-manager.sharedModules = [ nur.hmModules.nur ];
|
|
||||||
home-manager.users.willem = ./home;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
darwinConfigurations = {
|
|
||||||
zeus = darwin.lib.darwinSystem rec {
|
|
||||||
inherit inputs;
|
|
||||||
|
|
||||||
system = "aarch64-darwin";
|
|
||||||
|
|
||||||
pkgs = pkgsfunc {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ (import ./overlays/darwin.nix) ];
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./modules/nix.nix
|
|
||||||
./system/zeus.darwin.nix
|
|
||||||
./system/common.nix
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
(user-config pkgs)
|
|
||||||
];
|
];
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.zeus-utmvm = nixpkgs.lib.nixosSystem rec {
|
systems = [
|
||||||
system = "aarch64-linux";
|
"x86_64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
pkgs = pkgsfunc { inherit system; };
|
"aarch64-darwin"
|
||||||
|
"aarch64-linux"
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
(user-config pkgs)
|
|
||||||
./modules/nix.nix
|
|
||||||
./system/zeus.utmvm.nix
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.zeus-asahi = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "aarch64-linux";
|
|
||||||
|
|
||||||
pkgs = pkgsfunc {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ nixos-apple-silicon.overlays ];
|
|
||||||
};
|
|
||||||
|
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
nixos-apple-silicon.nixosModules.apple-silicon-support
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
(user-config pkgs)
|
|
||||||
./modules/nix.nix
|
|
||||||
./system/zeus.asahi.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
versions = {
|
|
||||||
aarch64-darwin = "1101351";
|
|
||||||
x86_64-darwin = "1101350";
|
|
||||||
};
|
|
||||||
|
|
||||||
version = versions.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
|
|
||||||
pname = "chromium";
|
|
||||||
appName = "Chromium";
|
|
||||||
|
|
||||||
srcs = {
|
|
||||||
aarch64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac_Arm/${version}/chrome-mac.zip";
|
|
||||||
sha256 = "sha256-LlbYlJmFLzyHIiygofa0Btm7NAOvWXXhmbjMHldVoGo=";
|
|
||||||
name = "${pname}_aarch64_${version}.zip";
|
|
||||||
};
|
|
||||||
x86_64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/${version}/chrome-mac.zip";
|
|
||||||
sha256 = "sha256-O+OnjakEpjCRbSjDysEA6RKKaKaSMw+LSO2ZLcxz2vM=";
|
|
||||||
name = "${pname}_x86_64_${version}.zip";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
in
|
|
||||||
import ./mk-mac-binpkg.nix {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
srcsubdir = "chrome-mac";
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "109.0.1";
|
|
||||||
pname = "firefox";
|
|
||||||
appName = "Firefox";
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/mac/en-CA/Firefox%20${version}.dmg";
|
|
||||||
sha256 = "sha256-V/8W3qqYhJmte2tq/ZSPtYChdhv8WFQoSORYRaxva9Y=";
|
|
||||||
name = "${pname}_${version}.dmg";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }
|
|
|
@ -1,41 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "0.20.2";
|
|
||||||
date = "2022-12-27";
|
|
||||||
appName = "FreeCAD";
|
|
||||||
pname = "freecad";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://github.com/FreeCAD/FreeCAD/releases/download/${version}/FreeCAD_${version}-${date}-conda-macOS-x86_64-py310.dmg";
|
|
||||||
sha256 = "sha256-OAi98HUacHcLHVYSadnQFPnEhutJvE4YfRBtPSZk00c=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
name = pname;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
export tempdir=$(mktemp -d -p /tmp)
|
|
||||||
|
|
||||||
cp $src freecad.dmg
|
|
||||||
/usr/bin/hdiutil attach -mountpoint "$tempdir" freecad.dmg
|
|
||||||
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
|
|
||||||
cp -r "$tempdir/${appName}.app" $out/Applications
|
|
||||||
|
|
||||||
/usr/bin/hdiutil detach "$tempdir"
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
{ src, version, pname, appName, pkgs, srcsubdir ? ".", ... }:
|
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
inherit version src;
|
|
||||||
|
|
||||||
name = pname;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.undmg pkgs.unzip pkgs.makeWrapper ];
|
|
||||||
|
|
||||||
sourceRoot = ".";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
mkdir -p $out/Applications
|
|
||||||
|
|
||||||
cp -r "${srcsubdir}/${appName}.app" $out/Applications
|
|
||||||
|
|
||||||
# wrap executable to $out/bin
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper "$out/Applications/${appName}.app/Contents/MacOS/${appName}" "$out/bin/${pname}"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
name = "pinentry-mac";
|
|
||||||
src = pkgs.pinentry_mac;
|
|
||||||
installPhase = ''
|
|
||||||
# -*-sh-*-
|
|
||||||
|
|
||||||
mkdir -p "$out/bin"
|
|
||||||
|
|
||||||
cp "$src/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac" "$out/bin/pinentry-mac"
|
|
||||||
'';
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
version = "4.4.5";
|
|
||||||
appName = "qBittorrent";
|
|
||||||
pname = "qbittorrent";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"https://phoenixnap.dl.sourceforge.net/project/qbittorrent/qbittorrent-mac/qbittorrent-${version}/qbittorrent-${version}.dmg";
|
|
||||||
sha256 = "sha256-9h+gFAEU0tKrltOjnOKLfylbbBunGZqvPzQogdP9uQM=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
appName = "Spotify";
|
|
||||||
pname = "spotify";
|
|
||||||
version = "sha256-JESQZtyPE9o5PW/f5GdxbqbyeHCxs/oZEW0AakMJgKg=";
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://download.scdn.co/Spotify.dmg";
|
|
||||||
hash = version;
|
|
||||||
name = "spotify-mac.dmg";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./mk-mac-binpkg.nix { inherit pkgs src pname appName version; }
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
|
|
||||||
let
|
|
||||||
appName = "VLC";
|
|
||||||
pname = "vlc";
|
|
||||||
version = "3.0.18";
|
|
||||||
srcs = {
|
|
||||||
aarch64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-arm64.dmg";
|
|
||||||
sha256 = "sha256-mcJZvbxSIf1QgX9Ri3Dpv57hdeiQdDkDyYB7x3hmj0c=";
|
|
||||||
name = "${pname}_aarch64_${version}.dmg";
|
|
||||||
};
|
|
||||||
x86_64-darwin = pkgs.fetchurl {
|
|
||||||
url =
|
|
||||||
"http://get.videolan.org/vlc/${version}/macosx/vlc-${version}-intel64.dmg";
|
|
||||||
sha256 = "sha256-iO3N/Os70vaANn2QCdOKDBR/p1jy3TleQ0EsHgjOHMs=";
|
|
||||||
name = "${pname}_x86_64_${version}.dmg";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
src = srcs.${pkgs.stdenv.hostPlatform.system};
|
|
||||||
in
|
|
||||||
import ./mk-mac-binpkg.nix {
|
|
||||||
inherit pkgs src pname appName version;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue