From 66dcd9d9b6840c6d46f757b9a0ae22906692f9a3 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 22 Jul 2023 11:17:45 -0400 Subject: [PATCH] General cleanup --- flake.lock | 270 +++++++++++-------------------------------- flake.nix | 4 +- home/terminal.nix | 11 +- nixos/hercules.nix | 19 --- nixos/nix.nix | 4 +- scripts/fuckport.nix | 16 +++ systems/darwin.nix | 67 +---------- 7 files changed, 100 insertions(+), 291 deletions(-) delete mode 100644 nixos/hercules.nix create mode 100644 scripts/fuckport.nix diff --git a/flake.lock b/flake.lock index f2c9d0a..7fc5893 100644 --- a/flake.lock +++ b/flake.lock @@ -173,13 +173,13 @@ "devshell": "devshell", "drv-parts": "drv-parts", "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_4", "flake-utils-pre-commit": "flake-utils-pre-commit", "ghc-utils": "ghc-utils", "gomod2nix": "gomod2nix", "mach-nix": "mach-nix", "nix-pypi-fetcher": "nix-pypi-fetcher", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_6", "nixpkgsV1": "nixpkgsV1", "poetry2nix": "poetry2nix", "pre-commit-hooks": "pre-commit-hooks", @@ -491,8 +491,8 @@ }, "flake-outputs": { "inputs": { - "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_4", + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_3", "nuenv": "nuenv" }, "locked": { @@ -549,24 +549,6 @@ "inputs": { "nixpkgs-lib": "nixpkgs-lib_3" }, - "locked": { - "lastModified": 1666885127, - "narHash": "sha256-uXA/3lhLhwOTBMn9a5zJODKqaRT+SuL5cpEmOz2ULoo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "0e101dbae756d35a376a5e1faea532608e4a4b9a", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_4": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_4" - }, "locked": { "lastModified": 1679737941, "narHash": "sha256-srSD9CwsVPnUMsIZ7Kt/UegkKUEBcTyU1Rev7mO45S0=", @@ -581,7 +563,7 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "jenkins-nix-ci", @@ -604,9 +586,9 @@ "type": "github" } }, - "flake-parts_6": { + "flake-parts_5": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_5" + "nixpkgs-lib": "nixpkgs-lib_4" }, "locked": { "lastModified": 1688466019, @@ -622,9 +604,9 @@ "type": "github" } }, - "flake-parts_7": { + "flake-parts_6": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_6" + "nixpkgs-lib": "nixpkgs-lib_5" }, "locked": { "lastModified": 1685662779, @@ -640,9 +622,9 @@ "type": "github" } }, - "flake-parts_8": { + "flake-parts_7": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_7" + "nixpkgs-lib": "nixpkgs-lib_6" }, "locked": { "lastModified": 1672877861, @@ -722,21 +704,6 @@ } }, "flake-utils_2": { - "locked": { - "lastModified": 1667077288, - "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -751,7 +718,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_3": { "locked": { "lastModified": 1623875721, "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", @@ -766,7 +733,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "inputs": { "systems": "systems_3" }, @@ -784,7 +751,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "inputs": { "systems": "systems_4" }, @@ -802,7 +769,7 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_6": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -881,27 +848,6 @@ "type": "github" } }, - "hci": { - "inputs": { - "flake-parts": "flake-parts_3", - "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs_3", - "pre-commit-hooks-nix": "pre-commit-hooks-nix" - }, - "locked": { - "lastModified": 1671911658, - "narHash": "sha256-1mrYh+6Hz8y2szNIgWGqHQWIJ3mDxs8ceAA7A8O0ymc=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "fc43b406a0fbd6ff10ee670bf3d248c0343393e9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "type": "github" - } - }, "heist": { "flake": false, "locked": { @@ -978,8 +924,8 @@ "jenkinsPlugins2nix": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_6" + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1629079129, @@ -1026,27 +972,6 @@ } }, "nix-darwin": { - "inputs": { - "nixpkgs": [ - "hci", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1667419884, - "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, - "nix-darwin_2": { "inputs": { "nixpkgs": [ "nixpkgs" @@ -1079,10 +1004,10 @@ "evil-quick-diff": "evil-quick-diff", "explain-pause-mode": "explain-pause-mode", "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "format-all": "format-all", "nix-straight": "nix-straight", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_9", "nose": "nose", "ob-racket": "ob-racket", "org": "org", @@ -1128,7 +1053,7 @@ "nix-serve-ng": { "inputs": { "flake-compat": "flake-compat_4", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_10", "utils": "utils" }, "locked": { @@ -1165,10 +1090,10 @@ "inputs": { "devour-flake": "devour-flake_2", "dream2nix": "dream2nix", - "flake-parts": "flake-parts_6", + "flake-parts": "flake-parts_5", "flake-root": "flake-root_2", "mission-control": "mission-control", - "nixpkgs": "nixpkgs_8", + "nixpkgs": "nixpkgs_7", "systems": "systems_2", "treefmt-nix": "treefmt-nix_2" }, @@ -1188,8 +1113,8 @@ }, "nixd": { "inputs": { - "flake-parts": "flake-parts_7", - "nixpkgs": "nixpkgs_12" + "flake-parts": "flake-parts_6", + "nixpkgs": "nixpkgs_11" }, "locked": { "lastModified": 1687572024, @@ -1237,7 +1162,7 @@ }, "nixos-shell": { "inputs": { - "nixpkgs": "nixpkgs_13" + "nixpkgs": "nixpkgs_12" }, "locked": { "lastModified": 1646257415, @@ -1255,8 +1180,8 @@ }, "nixos-vscode-server": { "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_14" + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_13" }, "locked": { "lastModified": 1684517665, @@ -1325,24 +1250,6 @@ } }, "nixpkgs-lib_3": { - "locked": { - "dir": "lib", - "lastModified": 1665349835, - "narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib_4": { "locked": { "dir": "lib", "lastModified": 1678375444, @@ -1360,7 +1267,7 @@ "type": "github" } }, - "nixpkgs-lib_5": { + "nixpkgs-lib_4": { "locked": { "dir": "lib", "lastModified": 1688049487, @@ -1378,7 +1285,7 @@ "type": "github" } }, - "nixpkgs-lib_6": { + "nixpkgs-lib_5": { "locked": { "dir": "lib", "lastModified": 1685564631, @@ -1396,7 +1303,7 @@ "type": "github" } }, - "nixpkgs-lib_7": { + "nixpkgs-lib_6": { "locked": { "dir": "lib", "lastModified": 1672350804, @@ -1416,8 +1323,8 @@ }, "nixpkgs-match": { "inputs": { - "flake-parts": "flake-parts_8", - "nixpkgs": "nixpkgs_16" + "flake-parts": "flake-parts_7", + "nixpkgs": "nixpkgs_15" }, "locked": { "lastModified": 1672924430, @@ -1481,21 +1388,6 @@ } }, "nixpkgs_10": { - "locked": { - "lastModified": 1682566018, - "narHash": "sha256-HPzPRFiy2o/7k7mtnwfM1E6NVZHiFbPdmYCMoIpkHO4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8e3b64db39f2aaa14b35ee5376bd6a2e707cadc2", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixpkgs-unstable", - "type": "indirect" - } - }, - "nixpkgs_11": { "locked": { "lastModified": 1669391192, "narHash": "sha256-f/2TqduZWcdq/pPddu1E7plNmcOuzt1IN4Fh3LSUKmM=", @@ -1511,7 +1403,7 @@ "type": "github" } }, - "nixpkgs_12": { + "nixpkgs_11": { "locked": { "lastModified": 1686398752, "narHash": "sha256-nGWNQVhSw4VSL+S0D0cbrNR9vs9Bq7rlYR+1K5f5j6w=", @@ -1527,7 +1419,7 @@ "type": "github" } }, - "nixpkgs_13": { + "nixpkgs_12": { "locked": { "lastModified": 1628465643, "narHash": "sha256-QSNw9bDq9uGUniQQtakRuw4m21Jxugm23SXLVgEV4DM=", @@ -1542,7 +1434,7 @@ "type": "indirect" } }, - "nixpkgs_14": { + "nixpkgs_13": { "locked": { "lastModified": 1682526928, "narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=", @@ -1555,7 +1447,7 @@ "type": "indirect" } }, - "nixpkgs_15": { + "nixpkgs_14": { "locked": { "lastModified": 1689282004, "narHash": "sha256-VNhuyb10c9SV+3hZOlxwJwzEGytZ31gN9w4nPCnNvdI=", @@ -1571,7 +1463,7 @@ "type": "github" } }, - "nixpkgs_16": { + "nixpkgs_15": { "locked": { "lastModified": 1672756850, "narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=", @@ -1587,7 +1479,7 @@ "type": "github" } }, - "nixpkgs_17": { + "nixpkgs_16": { "locked": { "lastModified": 1679793451, "narHash": "sha256-JafTtgMDATE8dZOImBhWMA9RCn9AP8FVOpN+9K/tTlg=", @@ -1601,7 +1493,7 @@ "type": "indirect" } }, - "nixpkgs_18": { + "nixpkgs_17": { "locked": { "lastModified": 1683475240, "narHash": "sha256-sy6MYoCaIZsOenYplbzVXI4Ce9Bp/vIOpuFa97+a6wc=", @@ -1617,7 +1509,7 @@ "type": "github" } }, - "nixpkgs_19": { + "nixpkgs_18": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -1650,22 +1542,6 @@ } }, "nixpkgs_3": { - "locked": { - "lastModified": 1670495322, - "narHash": "sha256-PYwHXymeQZBrTylwDd4LgozTAgrJmp3UGf3mgnKPRr0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "80b1fb3d5e91f9027a788b4b5f7c1c9bd6d4546b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1680151711, "narHash": "sha256-7vMCXF4t7E07C1jDNzLMDXvPDAuDjNFMX3Zin+8nYY4=", @@ -1681,7 +1557,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1679793451, "narHash": "sha256-JafTtgMDATE8dZOImBhWMA9RCn9AP8FVOpN+9K/tTlg=", @@ -1695,7 +1571,7 @@ "type": "indirect" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1622516815, "narHash": "sha256-ZjBd81a6J3TwtlBr3rHsZspYUwT9OdhDk+a/SgSEf7I=", @@ -1711,7 +1587,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1665580254, "narHash": "sha256-hO61XPkp1Hphl4HGNzj1VvDH5URt7LI6LaY/385Eul4=", @@ -1726,7 +1602,7 @@ "type": "indirect" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1688590700, "narHash": "sha256-ZF055rIUP89cVwiLpG5xkJzx00gEuuGFF60Bs/LM3wc=", @@ -1742,7 +1618,7 @@ "type": "github" } }, - "nixpkgs_9": { + "nixpkgs_8": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -1758,6 +1634,21 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1682566018, + "narHash": "sha256-HPzPRFiy2o/7k7mtnwfM1E6NVZHiFbPdmYCMoIpkHO4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8e3b64db39f2aaa14b35ee5376bd6a2e707cadc2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, "nose": { "flake": false, "locked": { @@ -1776,7 +1667,7 @@ }, "nuenv": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "rust-overlay": "rust-overlay" }, "locked": { @@ -1795,7 +1686,7 @@ }, "nuenv_2": { "inputs": { - "nixpkgs": "nixpkgs_17", + "nixpkgs": "nixpkgs_16", "rust-overlay": "rust-overlay_2" }, "locked": { @@ -1938,28 +1829,6 @@ "type": "github" } }, - "pre-commit-hooks-nix": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "hci", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1667760143, - "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "pruned-racket-catalog": { "flake": false, "locked": { @@ -2000,10 +1869,9 @@ "emacs-overlay": "emacs-overlay", "emanote": "emanote", "flake-parts": "flake-parts_2", - "hci": "hci", "home-manager": "home-manager", "jenkins-nix-ci": "jenkins-nix-ci", - "nix-darwin": "nix-darwin_2", + "nix-darwin": "nix-darwin", "nix-doom-emacs": "nix-doom-emacs", "nix-serve-ng": "nix-serve-ng", "nixd": "nixd", @@ -2011,7 +1879,7 @@ "nixos-hardware": "nixos-hardware", "nixos-shell": "nixos-shell", "nixos-vscode-server": "nixos-vscode-server", - "nixpkgs": "nixpkgs_15", + "nixpkgs": "nixpkgs_14", "nixpkgs-match": "nixpkgs-match", "nuenv": "nuenv_2", "sops-nix": "sops-nix", @@ -2037,7 +1905,7 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "jenkins-nix-ci", "flake-outputs", @@ -2061,7 +1929,7 @@ }, "rust-overlay_2": { "inputs": { - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nuenv", "nixpkgs" @@ -2099,7 +1967,7 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_18", + "nixpkgs": "nixpkgs_17", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -2194,7 +2062,7 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_8" }, "locked": { "lastModified": 1688026376, @@ -2212,7 +2080,7 @@ }, "treefmt-nix_3": { "inputs": { - "nixpkgs": "nixpkgs_19" + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1689243103, diff --git a/flake.nix b/flake.nix index 6718d75..cc002fe 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Srid's NixOS configuration"; + description = "Srid's NixOS / nix-darwin configuration"; inputs = { # Principle inputs @@ -18,7 +18,6 @@ sops-nix.url = "github:juspay/sops-nix/json-nested"; # https://github.com/Mic92/sops-nix/pull/328 jenkins-nix-ci.url = "github:juspay/jenkins-nix-ci"; # jenkins-nix-ci.url = "path:/home/srid/code/jenkins-nix-ci"; - hci.url = "github:hercules-ci/hercules-ci-agent"; nix-serve-ng.url = "github:aristanetworks/nix-serve-ng"; # Software inputs @@ -80,7 +79,6 @@ appreciate = self.nixos-flake.lib.mkARMMacosSystem { imports = [ self.darwinModules.default # Defined in nix-darwin/default.nix - ./nixos/hercules.nix ./systems/darwin.nix ]; }; diff --git a/home/terminal.nix b/home/terminal.nix index 19eb6ee..130583d 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -6,16 +6,21 @@ # Unixy tools ripgrep fd + sd # Useful for Nix development - nix-output-monitor devour-flake nixci nil nixd - nixpkgs-fmt - shfmt + + # Publishing + asciinema + + # Dev + gh + fuckport ]; home.shellAliases = rec { diff --git a/nixos/hercules.nix b/nixos/hercules.nix deleted file mode 100644 index a89e6f7..0000000 --- a/nixos/hercules.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, flake, ... }: - -{ - # TODO: use sops-nix to manage - # - secrets - # - ssh keys - services.hercules-ci-agent = { - enable = true; - # nixpkgs may not always have the latest HCI. - package = flake.inputs.hci.packages.${pkgs.system}.hercules-ci-agent; - }; - - # Regularly optimize nix store if using CI, because CI use can produce *lots* - # of derivations. - nix.gc = { - automatic = ! pkgs.stdenv.isDarwin; # Enable only on Linux - options = "--delete-older-than 90d"; - }; -} diff --git a/nixos/nix.nix b/nixos/nix.nix index c9f36f2..f28109b 100644 --- a/nixos/nix.nix +++ b/nixos/nix.nix @@ -12,11 +12,13 @@ flake.inputs.nuenv.overlays.nuenv flake.inputs.nixd.overlays.default flake.inputs.nuenv.overlays.default + (self: super: { + fuckport = pkgs.callPackage ../scripts/fuckport.nix { }; + }) ]; }; nix = { - package = pkgs.nixUnstable; # Need 2.15 for bug fixes nixPath = [ "nixpkgs=${flake.inputs.nixpkgs}" ]; # Enables use of `nix-shell -p ...` etc registry.nixpkgs.flake = flake.inputs.nixpkgs; # Make `nix shell` etc use pinned nixpkgs settings = { diff --git a/scripts/fuckport.nix b/scripts/fuckport.nix new file mode 100644 index 0000000..cb782e0 --- /dev/null +++ b/scripts/fuckport.nix @@ -0,0 +1,16 @@ +{ writeShellApplication, jc, jq, ... }: + +# Kill the process with the port open +# Used only to kill stale ghc. +# FIXME: This doesn't work when lsof returns *multiple* processes. +writeShellApplication { + name = "fuckport"; + runtimeInputs = [ jc jq ]; + text = '' + lsof -i :"$1" + THEPID=$(lsof -i :"$1" | jc --lsof 2> /dev/null | jq '.[].pid') + echo "KILL $THEPID ?" + read -r + kill "$THEPID" + ''; +} diff --git a/systems/darwin.nix b/systems/darwin.nix index 35a4397..f2140fc 100644 --- a/systems/darwin.nix +++ b/systems/darwin.nix @@ -1,69 +1,13 @@ -{ pkgs, flake, rosettaPkgs, ... }: +{ pkgs, flake, ... }: +# See nix-darwin/default.nix for other modules in use. { environment.systemPackages = with pkgs; [ - asciinema - wget - ripgrep - sd - pandoc - nodejs # Required for VSCode's webhint extension - gh - nixpkgs-fmt - emanote - flake.inputs.hci.packages.${pkgs.system}.hercules-ci-cli - flake.inputs.nixpkgs-match.packages.${pkgs.system}.default + # macOS GUI programs wezterm utm - - # We must install Agda globally so that Doom-Emacs' agda config can - # recognize it. It doesn't matter that our projects use Nix/direnv. - # - # Emacs configuration system assumes global state, and is thus shit. We just work with it. - # https://github.com/hlissner/doom-emacs/blob/f458f9776049fd7e9523318582feed682e7d575c/modules/lang/agda/config.el#L3-L8 - (rosettaPkgs.agda.withPackages (p: [ p.standard-library ])) - # rosettaPkgs.idris2 - #rosettaPkgs.coq - # (rosettaPkgs.haskellPackages.callHackage "agda-language-server" "0.2.1" { }) - - # TODO: These should be moved to a separate file? - - # Kill the process with the port open - # Used only to kill stale ghc. - # FIXME: This doesn't work when lsof returns *multiple* processes. - (pkgs.writeShellApplication { - name = "fuckport"; - runtimeInputs = [ jc jq ]; - text = '' - lsof -i :"$1" - THEPID=$(lsof -i :"$1" | jc --lsof 2> /dev/null | jq '.[].pid') - echo "KILL $THEPID ?" - read -r - kill "$THEPID" - ''; - }) - ]; - # TODO: Use nix.nix? - nix = { - nixPath = [ "nixpkgs=${flake.inputs.nixpkgs}" ]; # Enables use of `nix-shell -p ...` etc - registry.nixpkgs.flake = flake.inputs.nixpkgs; # Make `nix shell` etc use pinned nixpkgs - extraOptions = '' - extra-platforms = aarch64-darwin x86_64-darwin - experimental-features = nix-command flakes repl-flake - ''; - # https://nixos.wiki/wiki/Distributed_build - /* distributedBuilds = true; - buildMachines = [ - { - hostName = (import ./hetzner/ax41.info.nix).publicIP; - system = "x86_64-linux"; - maxJobs = 10; - } - ]; */ - }; - security.pam.enableSudoTouchIdAuth = true; # For home-manager to work. @@ -74,11 +18,6 @@ # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; - # nix.package = pkgs.nix; - - # Create /etc/bashrc that loads the nix-darwin environment. - # programs.zsh.enable = true; # default shell on catalina - # programs.fish.enable = true; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog