From 44121f046701015d5eb594dae5fb17448731e2f6 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Sat, 21 Aug 2021 13:47:36 -0500 Subject: [PATCH] make an overlay and call it from everywhere --- flake.lock | 19 ++++++++++++++++++- flake.nix | 21 +++++++++++++++++++++ machines/torch/default.nix | 3 ++- machines/vbox-dev/default.nix | 3 ++- nixos/nix/default.nix | 6 +++++- 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index a276439..863ac55 100644 --- a/flake.lock +++ b/flake.lock @@ -68,7 +68,24 @@ "inputs": { "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "tmux": "tmux" + } + }, + "tmux": { + "flake": false, + "locked": { + "lastModified": 1629558086, + "narHash": "sha256-KyAsIXdzLh/PKEvPCmQATVCYPfEyUJu81vH5F9QV7XI=", + "owner": "tmux", + "repo": "tmux", + "rev": "4d3367e9657002c4b68867c8d58e2f5b7ae90612", + "type": "github" + }, + "original": { + "owner": "tmux", + "repo": "tmux", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index e08e79f..a2da007 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,30 @@ nixpkgs.url = "github:NixOS/nixpkgs/release-21.05"; nixos-hardware.url = "github:NixOS/nixos-hardware"; home-manager.url = "github:nix-community/home-manager/release-21.05"; + + tmux = { + url = "github:tmux/tmux"; + flake = false; + }; }; outputs = inputs: { + overlay = final: prev: { + tmux = prev.tmux.overrideAttrs (attrs: + attrs // { + src = inputs.tmux; + + # macOS does some weird stuff with locales and character widths. + # Practically, that means that without extra support tmux will + # behave weirdly around multi-byte characters like emoji. Enabling + # utf8proc support should backfill the right tables so that tmux + # can get the correct character widths. + buildInputs = attrs.buildInputs ++ [ prev.utf8proc ]; + configureFlags = attrs.configureFlags ++ [ "--enable-utf8proc" ]; + } + ); + }; + nixosConfigurations.torch = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ diff --git a/machines/torch/default.nix b/machines/torch/default.nix index a47f706..23468cb 100644 --- a/machines/torch/default.nix +++ b/machines/torch/default.nix @@ -11,11 +11,12 @@ inputs: "${inputs.nixos-hardware}/apple/macbook-pro/12-1" # system setup + (import ../../nixos/nix inputs) + ../../nixos/bluetooth ../../nixos/brian ../../nixos/gnome-keyring ../../nixos/networkmanager - ../../nixos/nix ../../nixos/upower ../../nixos/xmonad ]; diff --git a/machines/vbox-dev/default.nix b/machines/vbox-dev/default.nix index ef333b8..a5ac7a5 100644 --- a/machines/vbox-dev/default.nix +++ b/machines/vbox-dev/default.nix @@ -9,8 +9,9 @@ inputs: [ # Include the results of the hardware scan. ./hardware-configuration.nix + (import ../../nixos/nix inputs) + ../../nixos/brian - ../../nixos/nix ../../nixos/xmonad ../../nixos/xserver ]; diff --git a/nixos/nix/default.nix b/nixos/nix/default.nix index dd9e29d..ea2128e 100644 --- a/nixos/nix/default.nix +++ b/nixos/nix/default.nix @@ -1,3 +1,4 @@ +inputs: { pkgs, ... }: { nix = { # TODO: might have to disable this to get home-manager working @@ -7,5 +8,8 @@ ''; }; - nixpkgs.config.allowUnfree = true; + nixpkgs = { + config.allowUnfree = true; + overlays = [ inputs.self.overlay ]; + }; }