-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
79 lines (71 loc) · 2.55 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "Opinionated shared nixos configurations";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixos-modules = {
url = "github:NuschtOS/nixos-modules";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NuschtOS/nuschtpkgs/nixos-unstable";
nvim = {
url = "github:NuschtOS/nvim.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, flake-utils, nixos-modules, nixpkgs, nvim, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
# required for vscode-langservers-extracted which uses VSCodium as source
nixpkgs.config.allowNonSource = true;
};
inherit (pkgs) lib;
in {
packages = {
default = self.packages.${system}.shell;
shell = pkgs.symlinkJoin {
name = "nuschtos-shell";
paths = [
nixos-modules.packages.${system}.debugging
(nvim.packages.${system}.nixvimWithOptions {
inherit pkgs;
options.enableMan = false;
})
(let
tmuxConf = /* tmux */ ''
set -g default-terminal "xterm-256color"
set -g base-index 1
setw -g pane-base-index 1
set -g focus-events on
set -g mode-keys emacs
set -g mouse on
set -g status-keys emacs
setw -g aggressive-resize on
setw -g clock-mode-style 24
set -s escape-time 100
set -g history-limit 50000
# open new tab in PWD
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# don't clear selection on copy
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-no-clear
bind-key -Tcopy-mode-vi y send -X copy-selection-no-clear
'';
in pkgs.runCommand "tmux-with-config" {
nativeBuildInputs = with pkgs; [ makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${lib.getExe pkgs.tmux} $out/bin/tmux \
--add-flags "-f ${pkgs.writeText "tmux.conf" tmuxConf}"
'')
pkgs.bashInteractive
];
meta.mainProgram = "bash";
};
};
});
}